@zeniai/web-app-ui 5.0.71-dev → 5.0.72-dev

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/assets/AddressRoutes-C-QI3DFo.js +1 -0
  2. package/dist/assets/{AddressScreen-IPMb-Lqg.js → AddressScreen--B-G7QO-.js} +2 -2
  3. package/dist/assets/{AiCfoScreen-DxwryQBf.js → AiCfoScreen-B1XtoO1j.js} +3 -3
  4. package/dist/assets/{BillPayApprovalRoutes-B33P7K39.js → BillPayApprovalRoutes-BTct1_HT.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-D2OQNHTr.js → BillPayRoutes-0Ir4R_dy.js} +17 -17
  6. package/dist/assets/{BusinessVerificationPageScreen-BI3GYpKu.js → BusinessVerificationPageScreen-C5SO6Pvr.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-DZTXpkWd.js → ChargeCardRoutes-DYWYfiCF.js} +9 -9
  8. package/dist/assets/CompanyPassportScreen-ImtgWbLz.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-Cb9jSvP9.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-C59aPPyy.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-D083k3se.js +23 -0
  12. package/dist/assets/{DashboardRoutes-Ckl1eEC2.js → DashboardRoutes-DCYo-RgX.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-TLtEW787.js → DefaultTenantHome-BZpowVvC.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-C7OJwgdT.js +18 -0
  15. package/dist/assets/{DrawerScreen-B_tMe04S.js → DrawerScreen-BZUjw4oO.js} +1 -1
  16. package/dist/assets/EntityDetailRoutes-D0h8mKin.js +1 -0
  17. package/dist/assets/{ExpenseAutomationRoutes-BqK3TSEk.js → ExpenseAutomationRoutes-CsEeiul8.js} +5 -5
  18. package/dist/assets/FeaturePreviewScreen-K5aATczv.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-BQBDXWqr.js +1 -0
  20. package/dist/assets/MagicLinkRoutes-CE-gub2V.js +72 -0
  21. package/dist/assets/MagicLinkSignInScreen-CQSnWkbc.js +12 -0
  22. package/dist/assets/{MobileAppDrawer-BDT0TmvR.js → MobileAppDrawer-Cgt4TE38.js} +1 -1
  23. package/dist/assets/NotFoundScreen-gdNFrdCn.js +1 -0
  24. package/dist/assets/{NotificationRoutes-BblXuLTj.js → NotificationRoutes-BdPqco6s.js} +1 -1
  25. package/dist/assets/OAuthConsentScreen-D0N2LAnp.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-Bm69S-Ti.js +1 -0
  27. package/dist/assets/PeopleRoutes-jbfRIyVB.js +22 -0
  28. package/dist/assets/PerformanceRoutes-Bmd54T25.js +1 -0
  29. package/dist/assets/{Preview-IJkS64Sk.js → Preview-fN-QilxH.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-DQkFbpJH.js → QBOConnectionScreen-BdH_dfqU.js} +1 -1
  31. package/dist/assets/ReferralListScreen-ChHWDxsd.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-TgmzGWOx.js +1 -0
  33. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-DMdpETrG.js → ReimbursementApprovalRuleDetailScreen-DC3PDULr.js} +1 -1
  34. package/dist/assets/{ReimbursementRoutes-u-qnVfy0.js → ReimbursementRoutes-CSWRe0vq.js} +5 -5
  35. package/dist/assets/{ReportsRoutes-CqNp_xpd.js → ReportsRoutes-DKXm4KKp.js} +1 -1
  36. package/dist/assets/RewardsRoutes-vGbrbx2s.js +1 -0
  37. package/dist/assets/ScreenRoutes-C_esjW3S.js +2 -0
  38. package/dist/assets/SettingsRoutes-DVvUA_Bx.js +57 -0
  39. package/dist/assets/{SetupPagesScreen-Cdo59_U5.js → SetupPagesScreen-DucLsH4D.js} +5 -5
  40. package/dist/assets/SignInScreen-0ZDiC6ii.js +1 -0
  41. package/dist/assets/SignOutScreen-BBFPJdbD.js +9 -0
  42. package/dist/assets/{TaskListScreen-C1G-Z2qb.js → TaskListScreen-38bto6MZ.js} +2 -2
  43. package/dist/assets/TaskRoutes-Tf445JV3.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-DiMG8Ceq.js +1 -0
  45. package/dist/assets/TransactionDetailScreen-eONbl3-5.js +5 -0
  46. package/dist/assets/{TransactionListRoutes-r3XEp13P.js → TransactionListRoutes-zno0rGgt.js} +1 -1
  47. package/dist/assets/{TreasuryRoutes-Cp7F7y4J.js → TreasuryRoutes-LPcPr4Bm.js} +6 -6
  48. package/dist/assets/{VendorsRoutes-BBf47BBb.js → VendorsRoutes-B9bJ-Aua.js} +21 -21
  49. package/dist/assets/WiseConfirmationScreen-QWHy02om.js +12 -0
  50. package/dist/assets/{ZeniAccountRoutes--fSibHTb.js → ZeniAccountRoutes-Dsy44Rah.js} +12 -12
  51. package/dist/assets/ZeniAccountStatementScreen-vtEr6xSK.js +9 -0
  52. package/dist/assets/{accountMappingHelper-COFGwnKa.js → accountMappingHelper-yvOeY36k.js} +1 -1
  53. package/dist/assets/{analytics-CgF6EPDF.js → analytics-CFOBCmx3.js} +1 -1
  54. package/dist/assets/{analyticsHelper-DUlInMOD.js → analyticsHelper-ByPPdEaS.js} +1 -1
  55. package/dist/assets/{core-C_ZreJAw.js → core-B86WF2Ww.js} +1 -1
  56. package/dist/assets/{decodeURIComponentSafe-BP018w8C.js → decodeURIComponentSafe-C-DNZuqb.js} +1 -1
  57. package/dist/assets/{dnd-C3uQO7Bn.js → dnd-DrUSXn8k.js} +1 -1
  58. package/dist/assets/{empty-wr1Sjolf.js → empty-CRbjQ82E.js} +1 -1
  59. package/dist/assets/empty-Dfl21Uq6.js +1 -0
  60. package/dist/assets/{emptyVideoElement-DDjbVU1E.js → emptyVideoElement-Cn2ijyYz.js} +1 -1
  61. package/dist/assets/epic-D4mIFLgi.js +2 -0
  62. package/dist/assets/getLocaleForTenant-CRLTWbEq.js +1 -0
  63. package/dist/assets/{index-CGS6zWWp.js → index-B7GRpDkc.js} +14093 -13666
  64. package/dist/assets/index-BHE-07hU.js +1 -0
  65. package/dist/assets/{index-DpCPl3KC.js → index-BaOA81A8.js} +1 -1
  66. package/dist/assets/{empty-D-N5n4Nc.js → index-BeL81npV.js} +1 -1
  67. package/dist/assets/{index-T4vVJHIk.js → index-CcACvObI.js} +1 -1
  68. package/dist/assets/{index-CWsQVRWF.js → index-Ch8CfHB9.js} +1 -1
  69. package/dist/assets/{index-BYIPlMHr.js → index-D-Bl3J2P.js} +1 -1
  70. package/dist/assets/{index-CnROQyBG.js → index-vzrF8p0m.js} +2 -2
  71. package/dist/assets/{lexical-E_ubWL4u.js → lexical-COpm991f.js} +1 -1
  72. package/dist/assets/{liveblocks-BdePShct.js → liveblocks-D41N0IlG.js} +1 -1
  73. package/dist/assets/{lottie-CUKBWgbe.js → lottie-BHETr187.js} +1 -1
  74. package/dist/assets/{mui-BtnH6ELy.js → mui-DZd7XaFW.js} +1 -1
  75. package/dist/assets/{pathToGoBack-Bg0yBLYd.js → pathToGoBack-Dt_z5GBF.js} +1 -1
  76. package/dist/assets/{pdf-CH0jWS01.js → pdf-BdWka_4Q.js} +4 -4
  77. package/dist/assets/{pdf-lib-th4agIPv.js → pdf-lib-DmLnrwkt.js} +1 -1
  78. package/dist/assets/{plaid-CLHQ0yLv.js → plaid-CZm5yErz.js} +1 -1
  79. package/dist/assets/{pusher-DTlPALAn.js → pusher-BTnbGSy-.js} +1 -1
  80. package/dist/assets/{react-B1z9ZoMC.js → react-5WKYmmJ2.js} +1 -1
  81. package/dist/assets/{react-BYz405pF.js → react-BBgH-vWa.js} +1 -1
  82. package/dist/assets/{react-COj3_dzF.js → react-BcXMc1LZ.js} +1 -1
  83. package/dist/assets/{react-4Ap2VUmu.js → react-CEFsrN8T.js} +1 -1
  84. package/dist/assets/{react-CcfFphdJ.js → react-CqgPSYXh.js} +1 -1
  85. package/dist/assets/{react-Bxo6GPqK.js → react-DLXiwY4W.js} +1 -1
  86. package/dist/assets/{recharts-CHr9O26_.js → recharts-BHLF4b4u.js} +1 -1
  87. package/dist/assets/{routePaths-DZkWYInw.js → routePaths-PD5Rqyfc.js} +1 -1
  88. package/dist/assets/{sentry-CX_3yQh7.js → sentry-Bhr8KU--.js} +1 -1
  89. package/dist/assets/{url-CcaHVDFu.js → url-CgMNpbBl.js} +1 -1
  90. package/dist/assets/{url-BBCQjahk.js → url-qE7MaS1D.js} +1 -1
  91. package/dist/assets/useAskAiCfoHostNavButtonProps-BfmyGytS.js +1 -0
  92. package/dist/assets/{useDeviceId-DtlEyHOn.js → useDeviceId-rK1IEgER.js} +1 -1
  93. package/dist/assets/useFetchSuggestedQuestionsWhenReady-B1r7XRNi.js +1 -0
  94. package/dist/assets/{useInitialThreadRequest-AyrSL871.js → useInitialThreadRequest-Oe-7-CI7.js} +1 -1
  95. package/dist/assets/{utils-Dw8b4HCO.js → utils-Mvk27uIx.js} +1 -1
  96. package/dist/assets/{withTransactionSidePanel-BmH5jBz_.js → withTransactionSidePanel-7uc9rYEd.js} +2 -2
  97. package/dist/assets/{zeni-epic-state-H6DZSSlf.js → zeni-epic-state-BLvcbIPk.js} +6 -6
  98. package/dist/index.html +1 -1
  99. package/package.json +3 -3
  100. package/dist/assets/AddressRoutes-DkpE57wD.js +0 -1
  101. package/dist/assets/CompanyPassportScreen-kKTXGF13.js +0 -1
  102. package/dist/assets/ConnectionAuthScreen-CYS4bJsi.js +0 -11
  103. package/dist/assets/CustomerOnboardingAuthScreen-CFcE03ug.js +0 -1
  104. package/dist/assets/CustomerOnboardingRoutes-jk197VvK.js +0 -23
  105. package/dist/assets/DomesticWireDetailScreen-BkEDowN8.js +0 -18
  106. package/dist/assets/EntityDetailRoutes-DlKVqtyC.js +0 -1
  107. package/dist/assets/FeaturePreviewScreen-aYYY9m7f.js +0 -1
  108. package/dist/assets/MagicLinkRoutes-BLaYeloO.js +0 -72
  109. package/dist/assets/MagicLinkSignInScreen-CUegQSoi.js +0 -12
  110. package/dist/assets/NotFoundScreen-C4aqnA8_.js +0 -1
  111. package/dist/assets/OAuthConsentScreen-sykQomv8.js +0 -1
  112. package/dist/assets/PandLWithForecastRoutes-CBrTW5wX.js +0 -1
  113. package/dist/assets/PeopleRoutes-B9d9GdEF.js +0 -22
  114. package/dist/assets/PerformanceRoutes-BFJ-jyRc.js +0 -1
  115. package/dist/assets/ReferralListScreen-CyoB8VnU.js +0 -5
  116. package/dist/assets/ReimbursementApprovalRoutes-B00fD8b9.js +0 -1
  117. package/dist/assets/RewardsRoutes-R2VgDdnw.js +0 -1
  118. package/dist/assets/ScreenRoutes-9MMqpDv8.js +0 -2
  119. package/dist/assets/SettingsRoutes-KHzSnNUm.js +0 -57
  120. package/dist/assets/SignInScreen-DX4DUgMU.js +0 -1
  121. package/dist/assets/SignOutScreen-DOTJzbce.js +0 -9
  122. package/dist/assets/TaskRoutes-DeZTJnM4.js +0 -9
  123. package/dist/assets/TransactionDetailRoutes-CxGTwTQr.js +0 -1
  124. package/dist/assets/TransactionDetailScreen-DbXqL9Dv.js +0 -5
  125. package/dist/assets/WiseConfirmationScreen-BZsn9iwu.js +0 -12
  126. package/dist/assets/ZeniAccountStatementScreen-BKbkGQh4.js +0 -9
  127. package/dist/assets/epic-DKrR9LyJ.js +0 -2
  128. package/dist/assets/getLocaleForTenant-C-vhBCTM.js +0 -1
  129. package/dist/assets/index-CUa_5F-3.js +0 -1
  130. package/dist/assets/index-DJtUADrm.js +0 -1
  131. package/dist/assets/useAskAiCfoHostNavButtonProps-Nsv7MqoG.js +0 -1
  132. package/dist/assets/useFetchSuggestedQuestionsWhenReady-C86A67zi.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as Ol}from"./liveblocks-BdePShct.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-CX_3yQh7.js";import{L as dt,bS as Tc,eO as Ac,IA as Rc,J0 as kl,c1 as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-H6DZSSlf.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-Dw8b4HCO.js";import{r as un}from"./empty-wr1Sjolf.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-th4agIPv.js";import{r as Gl}from"./index-T4vVJHIk.js";import{r as zl}from"./index-CUa_5F-3.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-C_ZreJAw.js";import{u as Kl,z as Pc,L as Wl,I as Jl,J as Xl,i as Ql,c as tf}from"./index-CGS6zWWp.js";import"./mui-BtnH6ELy.js";import{d as Pe}from"./decodeURIComponentSafe-BP018w8C.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]="4ac5fc05-002d-4438-9a4e-04f87986fb32",t._sentryDebugIdIdentifier="sentry-dbid-4ac5fc05-002d-4438-9a4e-04f87986fb32")}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-D41N0IlG.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-Bhr8KU--.js";import{L as dt,bS as Tc,eO as Ac,IQ as Rc,Ji as kl,c1 as Tl,fi as Al,fj as Rl}from"./zeni-epic-state-BLvcbIPk.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,n as Yt,o as ue,p as Dl}from"./utils-Mvk27uIx.js";import{r as un}from"./empty-CRbjQ82E.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-DmLnrwkt.js";import{r as Gl}from"./index-CcACvObI.js";import{r as zl}from"./index-BHE-07hU.js";import{j as Zl,u as Hl,h as Vl,g as En,k as Yl}from"./core-B86WF2Ww.js";import{u as Kl,z as Pc,L as Wl,I as Jl,J as Xl,f as Ql,c as tf}from"./index-B7GRpDkc.js";import"./mui-DZd7XaFW.js";import{d as Pe}from"./decodeURIComponentSafe-C-DNZuqb.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]="d66fcc5e-6f56-4ff9-a535-e7424ffd3ffe",t._sentryDebugIdIdentifier="sentry-dbid-d66fcc5e-6f56-4ff9-a535-e7424ffd3ffe")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g}(d)}(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")}(this,g),S=b.call(this,function(w,_,M){return typeof e=="string"?e:e(w,_,M)}(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d}(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map(function(p){return String(p)}),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c}(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1}(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))},TypeError),i("ERR_INVALID_ARG_VALUE",function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)},TypeError),i("ERR_INVALID_RETURN_VALUE",function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")},TypeError),i("ERR_MISSING_ARGS",function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map(function(d){return'"'.concat(d,'"')}),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")},TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter(function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable})),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach(function(x){m(k,x,j[x])}):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach(function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))})}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}}(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)}(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach(function(x){j[x]=k[x]}),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
2
2
  `),I=_(E).split(`
3
3
  `),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
4
4
 
@@ -0,0 +1,5 @@
1
+ import{j as s}from"./liveblocks-D41N0IlG.js";import{a as o}from"./sentry-Bhr8KU--.js";import{g as f,j as L,h as M,u as V,k as _}from"./core-B86WF2Ww.js";import{m as F,Z as N,z as R,b4 as W,E as U,R as $,w as z,c as l,e as Y,a3 as Q,b5 as Z}from"./index-B7GRpDkc.js";import{eY as q,eO as G,Ma as I,Mb as J,tI as K,ty as g,e_ as X,bN as ee,tD as ae,Mc as re}from"./zeni-epic-state-BLvcbIPk.js";import{D as ne,e as te,n as se,S as oe}from"./mui-DZd7XaFW.js";import{u as ie}from"./useAskAiCfoHostNavButtonProps-BfmyGytS.js";import{c as le}from"./useFetchSuggestedQuestionsWhenReady-B1r7XRNi.js";import{M as ce}from"./MobileAppDrawer-Cgt4TE38.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="cdbb509e-f466-4460-a294-6c89a0f1ba55",e._sentryDebugIdIdentifier="sentry-dbid-cdbb509e-f466-4460-a294-6c89a0f1ba55")}catch{}})();const de={overlayWidth:new U(100,100,30)},fe=({isReferralDrawerOpen:e,closeDrawerHandler:a})=>{const r=F(),n=N();if(R.getSignedInUser()==null)throw Error("Can't access How Referral works without signing in...");const i=()=>{a(!0)},u=f(c=>q(c));return s.jsx(ne,{anchor:"right",open:e,PaperProps:{style:{width:de.overlayWidth.valuePercentage(n),boxShadow:"none"}},slotProps:{backdrop:{style:{opacity:.75,backgroundColor:r.colors.black,cursor:"pointer"}}},onClose:()=>i(),children:s.jsx(te,{in:e,direction:"left",children:s.jsx(ue,{onClick:c=>c.stopPropagation(),children:s.jsx(W,{onDismissClick:i,rewardsPlan:u.rewardsPlan})})})})},ue=se(oe)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `,P="refer-and-earn-status-update",we=_(function(e){const a=I(e),r=e.referralViewState.rewardsPlanFetchState,n=ee([a,r]);return{inviteList:a.invitations,uiState:a.uiState,pendingBonus:a.pendingBonus,earnedBonus:a.earnedBonus,pendingReferrals:a.pendingReferrals,fetchState:n.fetchState,rewardsPlan:a.rewardsPlan}},function(e,a){const{navigate:r}=a;return{onColumnSortConfigChanged:(n,i)=>{e(re({sortOrder:i,sortkey:n}))},onInviteClick:()=>{l.trackRewardsPageClicked("invite via email"),r("../refer")},onHowItWorksClick:()=>{l.trackRewardsPageClicked("know more"),r("../how-it-works")},onResendInviteClick:n=>{l.trackRewardsPageClicked("resend invite"),e(ae(n))},onBackClick:()=>{r("../",{relative:"path"})},onReloadInvitees:()=>{e(g(!0))},onCopyReferralLink:()=>{l.trackRewardsPageClicked("copy referral link")},onClickRefer:()=>{l.trackRewardsPageClicked("refer")},onEventReceived:n=>{n===P&&e(g(!0,!0))}}})(Q(Z));function Se({isReferralDrawerOpen:e}){const a=L(),r=M(),n=V(),[i,u]=o.useState(!1),[c,D]=o.useState(!1),[x,E]=o.useState(!1),[k,m]=o.useState(!1),w=R.getSignedInUser(),C=f(t=>G(t)),b=f(t=>I(t)),h=b.fetchState,p=f(t=>t.referralViewState.rewardsPlanFetchState),y=J([b,p]),{areTenantIdsInSync:d}=$();o.useEffect(()=>{C?.rewardsLastViewedTime==null&&x===!1&&(r(K()),E(!0))},[]),o.useEffect(()=>{!i&&h==="Not-Started"&&d&&(u(!0),r(g(!0)))},[h,r,d]),o.useEffect(()=>{!c&&p.fetchState==="Not-Started"&&d&&(D(!0),r(X(!0)))},[p,r,d]),o.useEffect(()=>{m(e!=null&&e===!0)},[e]);const[j,A]=o.useState(!1),v=t=>{A(t)},{isAiCfoAccessEnabled:O,onAskAiCfoClick:T}=ie({mobileExploreReferrer:"Rewards"});le({isDataReady:y===!0});const B={events:w?.userId!=null?[`private-encrypted-${w.userId}.${P}`]:[],eventCallback:(t,S,H)=>{H.onEventReceived(t)}};return s.jsxs(s.Fragment,{children:[y===!0?s.jsx(z,{analytics:l,onLoad:t=>(S=>{w!=null&&S.trackPageLoaded(Y.Event.rewardsPageViewed)})(t)}):null,s.jsx(ce,{isAppContentDrawerOpen:j,handleDrawerToggle:v}),k===!0?s.jsx(fe,{closeDrawerHandler:()=>{m(!1),a("..")},isReferralDrawerOpen:k}):null,s.jsx(we,{location:n,navigate:a,currentTenant:C,onClickMenuIcon:()=>{v(!0)},isAiCfoAccessEnabled:O,onAskAiCfoClick:T,...B})]})}export{Se as R};
@@ -0,0 +1 @@
1
+ import{j as t}from"./liveblocks-D41N0IlG.js";import x from"./NotFoundScreen-gdNFrdCn.js";import{a as p}from"./sentry-Bhr8KU--.js";import{j as C,u as I,h as A,g as u,N as E,k,n as D,o as c}from"./core-B86WF2Ww.js";import{eO as N,N4 as g,Nk as S,CF as T,BO as V,CE as d,Cv as O,NA as U}from"./zeni-epic-state-BLvcbIPk.js";import{m as _,z as B,B as $,a3 as W,bK as z,ac as F}from"./index-B7GRpDkc.js";import"./mui-DZd7XaFW.js";import{R as h}from"./ReimbursementApprovalRuleDetailScreen-DC3PDULr.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]="ebd586f6-12d1-4237-a10a-dc8ea0340986",e._sentryDebugIdIdentifier="sentry-dbid-ebd586f6-12d1-4237-a10a-dc8ea0340986")}catch{}})();const m="reimbursement-approval-rule-update",K=k(function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}},function(e,r){const{navigate:a,location:l}=r;return{onApprovalRulesEventReceived:s=>{s.endsWith(m)&&e(U(!1))},onBackClick:()=>{F(l)?a("../../"):a("../../../reimbursements/setup")},onDeleteRuleClick:s=>{e(O(s))},onEditRuleClick:s=>{s!=null?(e(d(s)),a(`./${s}/edit`)):(e(d()),a("./new"))}}})(W(z)),P=()=>{const e=C(),r=I(),a=A(),[l,s]=p.useState(!1),[f,y]=p.useState(!1),v=u(n=>n.remiSetupApproverViewState.fetchState),o=u(n=>N(n)),w=_(),i=u(n=>g(n)),b=u(n=>S(n).remiSetupApproverViewUpdateData);if(p.useEffect(()=>{b?.updateStatus.fetchState==="Completed"&&a(T())},[b]),p.useEffect(()=>{l||v!=="Not-Started"||(s(!0),a(V(!0)))},[l,v,a]),B.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(f||(y(!0),a(d())),e("./new"))},[f,i,a]);const j={events:o.companyId!=null?[`private-encrypted-${o.companyId}.${m}`]:[],eventCallback:(n,q,R)=>{n.endsWith(m)&&R.onApprovalRulesEventReceived(n)}};return o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?t.jsx(E,{to:"../../promo"}):o.companyReimbursementInfo?.info?.isReimbursementTOSAccepted!==!0||i.fetchState!=="Completed"&&i.fetchState!=="Error"?t.jsx($,{fetchState:"In-Progress",style:{backgroundColor:w.colors.grey5}}):t.jsx(K,{currentTenant:o,location:r,navigate:e,...j})};function Z(){return t.jsxs(D,{children:[t.jsx(c,{path:"/",element:t.jsx(P,{})}),t.jsx(c,{path:"/new",element:t.jsx(h,{})}),t.jsx(c,{path:"/:approvalRuleId/edit",element:t.jsx(h,{})}),t.jsx(c,{path:"*",element:t.jsx(x,{})})]})}export{Z as R};
@@ -1 +1 @@
1
- import{j as g}from"./liveblocks-BdePShct.js";import{a as y}from"./sentry-CX_3yQh7.js";import{j as w,h as A,u as C,l as T,g as b,k as U}from"./core-C_ZreJAw.js";import{N2 as R,MO as E,Ci as x,Cr as _,Cp as S,Cq as h,N3 as B}from"./zeni-epic-state-H6DZSSlf.js";import{z as k,m as V,B as N,bB as O,ac as j}from"./index-CGS6zWWp.js";import"./mui-BtnH6ELy.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="33ed4f87-75cb-4bc0-9f0e-362234c77f6f",e._sentryDebugIdIdentifier="sentry-dbid-33ed4f87-75cb-4bc0-9f0e-362234c77f6f")}catch{}})();function F(e){return B(e)==null}const $=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=j(a.location);return{onApprovalRuleDataUpdated:o=>{const c=p=>{const f=[];return p.forEach(u=>{const D=u.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=u.actors.selectedNonUsers.map(d=>{const m=!!F(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),v=D.concat(I);f.push({action:u.stepType.selectedOption,actors:v,operator:v.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),f};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:c(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(O);function H(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=V(),r=b(p=>R(p)),i=b(p=>E(p)),[o,c]=y.useState(!1);if(y.useEffect(()=>{o||(c(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(N,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{H as R,F as i};
1
+ import{j as g}from"./liveblocks-D41N0IlG.js";import{a as y}from"./sentry-Bhr8KU--.js";import{j as w,h as A,u as C,l as T,g as b,k as U}from"./core-B86WF2Ww.js";import{Nk as R,N4 as E,Cy as x,CH as _,CF as S,CG as h,Nl as B}from"./zeni-epic-state-BLvcbIPk.js";import{z as k,m as N,B as V,bB as F,ac as j}from"./index-B7GRpDkc.js";import"./mui-DZd7XaFW.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="5ea47923-200d-4d45-8dfb-8073b5f90555",e._sentryDebugIdIdentifier="sentry-dbid-5ea47923-200d-4d45-8dfb-8073b5f90555")}catch{}})();function O(e){return B(e)==null}const $=U(function(e,a){const t=R(e),s=t.remiSetupApproverViewUpdateData?.type??"approval_create",n=s==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return a.approvalRuleId&&(l=t.allApprovalRules.findIndex(r=>r.approvalRuleId===a.approvalRuleId)===0),{localData:t,hideUpperBoundField:n,isLowerBoundDisabled:l,approvalUpdateActionType:s}},function(e,a){const{navigate:t,approvalUpdateDataView:s,approverViewData:n,approvalRuleId:l}=a,r=s.remiSetupApproverViewUpdateData?.type,i=j(a.location);return{onApprovalRuleDataUpdated:o=>{const u=p=>{const v=[];return p.forEach(c=>{const D=c.actors.selectedUsers.map(d=>({type:"user",subType:void 0,userId:d.userId,idType:"user",isImplicitActor:!1})),I=c.actors.selectedNonUsers.map(d=>{const m=!!O(d.value);return{type:m?"attribute":"role",subType:d.value,userId:void 0,idType:void 0,isImplicitActor:!m}}),f=D.concat(I);v.push({action:c.stepType.selectedOption,actors:f,operator:f.length>1?c.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),v};if(r==="approval_create"){const p={criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}else{const p={approvalRuleId:l,criteria:{rangeType:"range",rangeEntity:"currency",range:{min:{amount:o.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:o.upperBound,currencyCode:"USD",currencySymbol:"$"}}},steps:u(o.steps),isApplicableOnPendingApprovalEntity:o.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(h(p))}},onResetClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(S()),r==="approval_update"||i?t("../"):n.allApprovalRules.length===0&&n.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(_())},onSaveRuleSuccess:()=>{t("../")}}})(F);function J(){const e=w(),a=A(),t=C(),{approvalRuleId:s}=T(),n=k.getSignedInUser(),l=N(),r=b(p=>R(p)),i=b(p=>E(p)),[o,u]=y.useState(!1);if(y.useEffect(()=>{o||(u(!0),a(x(!0)))}),y.useEffect(()=>{i.fetchState==="Not-Started"&&e(s!=null?"../../":"../")},[i,s]),n==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(V,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):g.jsx($,{navigate:e,approvalUpdateDataView:r,approvalRuleId:s,approverViewData:i,location:t})}export{J as R,O as i};
@@ -1,10 +1,10 @@
1
- import{j as s}from"./liveblocks-BdePShct.js";import{j as J,h as re,u as Z,l as X,g as E,N as $,k as q,i as mt,n as ct,o as C}from"./core-C_ZreJAw.js";import{eO as V,Ni as le,c1 as me,Bt as xe,jC as dt,BG as ne,BF as ae,Nj as ut,bn as ce,fI as Te,Nk as pt,JG as bt,jr as De,JH as Se,JI as gt,il as ht,MA as ft,iB as St,Bh as It,s6 as yt,it as Rt,C1 as je,Nl as Fe,Nm as At,Nn as kt,No as vt,Np as Ct,Nq as Et,BN as Ie,iH as Bt,MJ as wt,BH as xt,Br as Tt,Nr as Dt,Bq as jt,Ns as Ft,Bz as ye,BR as Ut,BQ as Nt,BM as Lt,Nt as Ue,GS as Pt,bo as Mt,BC as $t,Cj as _t,Nu as Ot,Nv as Gt,BZ as zt,BW as Re,M3 as Ht,Bo as Zt,Nw as Ne,CI as Ae,CQ as Vt,Nx as Wt,Ny as z,Nz as Jt,NA as Le,NB as qt,NC as Pe,ND as Me,C9 as se,bt as Kt,bF as de,cB as ue,eU as $e,eS as _e,NE as Qt,gD as Xt,Mg as Yt,NF as en,NG as Oe,Mk as tn,N2 as nn,NH as an,Nh as sn,CN as ke,CM as on,NI as rn,NJ as ln,NK as mn,NL as cn,NM as dn,MP as un,CD as pn,CH as bn,bv as gn,bE as hn,cw as fn,ck as Sn,bs as In,IC as yn,cM as Rn,cO as An,cN as kn,cv as vn}from"./zeni-epic-state-H6DZSSlf.js";import{V as Ge,Z as ze,y as Y,$ as k,z as P,bL as He,A as ee,c as v,aE as ve,o as j,aq as Q,G as Cn,D as Ze,bM as En,s as H,bN as Bn,k as te,bO as wn,R as xn,E as Tn,B as pe,f as Ve,a3 as Dn,bc as jn,W as Fn,m as We,bP as Un,a6 as Nn}from"./index-CGS6zWWp.js";import{n as _,S as Ln}from"./mui-BtnH6ELy.js";import ie from"./NotFoundScreen-C4aqnA8_.js";import{S as Ce}from"./SetupPagesScreen-Cdo59_U5.js";import{F as Je}from"./FeaturePreviewScreen-aYYY9m7f.js";import{a as f}from"./sentry-CX_3yQh7.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-Nsv7MqoG.js";import{u as qe}from"./useInitialThreadRequest-AyrSL871.js";import{c as Ke}from"./useFetchSuggestedQuestionsWhenReady-C86A67zi.js";import{D as Pn}from"./DrawerScreen-B_tMe04S.js";import{M as Qe}from"./MobileAppDrawer-BDT0TmvR.js";import{R as Mn}from"./ReimbursementApprovalRoutes-B00fD8b9.js";import{FallBackRoute as $n}from"./ScreenRoutes-9MMqpDv8.js";import"./recharts-CHr9O26_.js";import"./analytics-CgF6EPDF.js";import"./plaid-CLHQ0yLv.js";import"./dnd-C3uQO7Bn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CUKBWgbe.js";import"./lexical-E_ubWL4u.js";import"./pdf-CH0jWS01.js";import"./utils-Dw8b4HCO.js";import"./analyticsHelper-DUlInMOD.js";import"./routePaths-DZkWYInw.js";import"./BusinessVerificationPageScreen-BI3GYpKu.js";import"./ReimbursementApprovalRuleDetailScreen-DMdpETrG.js";import"./getLocaleForTenant-C-vhBCTM.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]="a36bbba5-8039-4f77-b8c3-2e4929c2b9cb",e._sentryDebugIdIdentifier="sentry-dbid-a36bbba5-8039-4f77-b8c3-2e4929c2b9cb")}catch{}})();const Xe=e=>`/${e}/reimbursements`,_n=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:N}}}=Ze.getLocalizedStrings(),On=q(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.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:`${Q.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:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Lt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Nt())},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(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({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(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(wt({data:l}))},onFetchBankName:i=>{e(Bt(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=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(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=J(),t=re(),n=Z(),{reimbursementId:r}=X(),d=Ge(),c=ze(),[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"}),B=Z().pathname,D=B.includes("edit"),A=B.includes("reimbursement/new"),[F,w]=f.useState(!1),x=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),L=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(w(!0),t(xe(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(x==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(He,{isNewReimbursement:r==null}):s.jsxs(Gn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(zn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:N.dropReceipt.upload,single:N.dropReceipt.single,or:N.dropReceipt.or,multiple:N.dropReceipt.multiple,receipts:N.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:N.dropReceipt.upload,single:N.dropReceipt.single,or:N.dropReceipt.or,multiple:N.dropReceipt.multiple,receipts:N.dropReceipt.receipts}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:L??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 Gn=_.div`
1
+ import{j as s}from"./liveblocks-D41N0IlG.js";import{j as J,h as re,u as Z,l as Y,g as E,N as $,k as q,i as mt,n as ct,o as C}from"./core-B86WF2Ww.js";import{eO as V,NB as le,c1 as me,BJ as xe,jL as dt,BW as ne,BV as ae,NC as ut,bn as ce,fI as Te,ND as pt,JY as bt,jA as De,JZ as Se,J_ as gt,iv as ht,MS as ft,iK as St,Bx as It,sm as yt,iC as Rt,Ch as je,NE as Fe,NF as At,NG as kt,NH as vt,NI as Ct,NJ as Et,C1 as Ie,iQ as wt,M$ as Bt,BX as xt,BH as Tt,NK as Dt,BG as jt,NL as Ft,BP as ye,C5 as Ut,C4 as Lt,C0 as Nt,NM as Ue,H6 as Pt,bo as Mt,BS as $t,Cz as _t,NN as Ot,NO as zt,Cd as Gt,Ca as Re,Ml as Ht,BE as Zt,NP as Le,CY as Ae,D4 as Vt,NQ as Wt,NR as G,NS as Jt,NT as Ne,NU as qt,NV as Pe,NW as Me,Cp as se,bt as Kt,bF as de,cB as ue,eU as $e,eS as _e,NX as Xt,gM as Yt,My as Qt,NY as en,NZ as Oe,MC as tn,Nk as nn,N_ as an,NA as sn,D1 as ke,D0 as on,N$ as rn,O0 as ln,O1 as mn,O2 as cn,O3 as dn,N5 as un,CT as pn,CX as bn,bv as gn,bE as hn,cw as fn,ck as Sn,bs as In,IS as yn,cM as Rn,cO as An,cN as kn,cv as vn}from"./zeni-epic-state-BLvcbIPk.js";import{q as ze,Z as Ge,y as Q,S as k,z as P,bL as He,w as ee,c as v,aE as ve,o as j,aq as X,G as Cn,D as Ze,bM as En,n as H,bN as wn,k as te,bO as Bn,R as xn,E as Tn,B as pe,e as Ve,a3 as Dn,bc as jn,W as Fn,m as We,bP as Un,a6 as Ln}from"./index-B7GRpDkc.js";import{n as _,S as Nn}from"./mui-DZd7XaFW.js";import ie from"./NotFoundScreen-gdNFrdCn.js";import{S as Ce}from"./SetupPagesScreen-DucLsH4D.js";import{F as Je}from"./FeaturePreviewScreen-K5aATczv.js";import{a as f}from"./sentry-Bhr8KU--.js";import{u as be}from"./useAskAiCfoHostNavButtonProps-BfmyGytS.js";import{u as qe}from"./useInitialThreadRequest-Oe-7-CI7.js";import{c as Ke}from"./useFetchSuggestedQuestionsWhenReady-B1r7XRNi.js";import{D as Pn}from"./DrawerScreen-BZUjw4oO.js";import{M as Xe}from"./MobileAppDrawer-Cgt4TE38.js";import{R as Mn}from"./ReimbursementApprovalRoutes-TgmzGWOx.js";import{FallBackRoute as $n}from"./ScreenRoutes-C_esjW3S.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.js";import"./analyticsHelper-ByPPdEaS.js";import"./routePaths-PD5Rqyfc.js";import"./BusinessVerificationPageScreen-C5SO6Pvr.js";import"./ReimbursementApprovalRuleDetailScreen-DC3PDULr.js";import"./getLocaleForTenant-CRLTWbEq.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]="c95c20d9-b5f8-48c9-aa2b-d7757a05c3ce",e._sentryDebugIdIdentifier="sentry-dbid-c95c20d9-b5f8-48c9-aa2b-d7757a05c3ce")}catch{}})();const Ye=e=>`/${e}/reimbursements`,_n=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}}}=Ze.getLocalizedStrings(),On=q(function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=P.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:`${X.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:u},authParams:i,defaultCurrency:{currencySymbol:o?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:o?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:o?.company.configInfo.mileageRateConfig,createdBy: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:De(e)}},function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=P.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(ae(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ye(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Nt(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(jt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(Dt({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(xt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(Ie(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(Bt({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=Ye(o),l=H(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(je(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=J(),t=re(),n=Z(),{reimbursementId:r}=Y(),d=ze(),c=Ge(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=Q(),{isFeatureEnabled:b}=l(k.isLimitedCategoryForReimbursement),{isFeatureEnabled:R}=l(k.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(k.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=be({mobileExploreReferrer:"Reimbursement Details"}),w=Z().pathname,D=w.includes("edit"),A=w.includes("reimbursement/new"),[F,B]=f.useState(!1),x=P.getSignedInUser(),I=E(p=>V(p)),g=E(p=>le(p,r)),N=qe(I?.companyId,{clearParams:g.fetchState==="Completed"}),U=me(I?.userRole??[]);f.useEffect(()=>{(A&&!F||D&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(xe(!1,b,R,r)))});const M=E(p=>dt(p.accountState,p.accountListState,"reimbursementAccountList"));if(x==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(He,{isNewReimbursement:r==null}):s.jsxs(zn,{windowSize:c,children:[s.jsx(ee,{analytics:v,onLoad:p=>(W=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&W.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(Hn,{children:s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.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(Zn,{children:[s.jsx(Vn,{onClick:()=>o(!1),children:s.jsx(_n,{})}),s.jsx(ve,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:x?.userId??"",sessionId:x?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(ae(p,a,!0,r,x?.userId))},updateInvoiceUploadFetchState:p=>{t(ne({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.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(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:N??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 zn=_.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
- `,zn=_.div`
7
+ `,Gn=_.div`
8
8
  position: fixed;
9
9
  top: 0;
10
10
  left: 0;
@@ -53,7 +53,7 @@ import{j as s}from"./liveblocks-BdePShct.js";import{j as J,h as re,u as Z,l as X
53
53
  flex-direction: column;
54
54
  width: 100%;
55
55
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
56
- `,Jn=q(function(e,t){const n=Ue(e,t.reimbursementId),r=P.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=Ot(n.remiActivities,Gt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${Q.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(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=H(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({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=H(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(zt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(Bn);function qn(){const e=J(),t=re(),n=Z(),r=n.hash.substring(1),d=Ge(),{reimbursementId:c}=X(),m=P.getSignedInUser(),o=E(y=>V(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"});Ke({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Y(),{isFeatureEnabled:T}=h(k.isLimitedCategoryForReimbursement),[u,B]=f.useState(!1),[D,A]=f.useState(!1),[F,w]=f.useState(!1),{isFeatureEnabled:x}=h(k.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(k.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),L=Pt(o),U=Mt(o.userRole),M=a.fetchState;if(f.useEffect(()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t($t(c,!1,I)))},[u,c,t,M]),f.useEffect(()=>{I&&a.remiDetails?.isDeleted===!0||o.isZeni===!0&&m?.userEmailDomain==="zeni.ai"&&L===!1?w(!1):w(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,L,m]),f.useEffect(()=>{D||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(xe(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(_t(!1,!0,!0,a.lastUpdatedByUserId)))},[D,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(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(Jn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:x,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const Kn=q(function(e,t){return{remisReviewView:Ne(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(z())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(wn);function Qn(){const e=J(),t=E(c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState),{remisForReview:n}=E(c=>Ne(c)),r=te(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect(()=>{t!=="Completed"&&n.length!==0||e("./")},[t,n.length]),s.jsx(Kn,{navigate:e,analytics:v,isAdmin:d})}const G=tn(),Ye="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Xn,common:Be}=Ze.getLocalizedStrings(),we=Xn.reimbursement.bulkActions,Yn=_.div`
56
+ `,Jn=q(function(e,t){const n=Ue(e,t.reimbursementId),r=P.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=Ot(n.remiActivities,zt(t.currentTenant),r));const i=me(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:De(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=H(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(Ht({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=H(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(je(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}})(wn);function qn(){const e=J(),t=re(),n=Z(),r=n.hash.substring(1),d=ze(),{reimbursementId:c}=Y(),m=P.getSignedInUser(),o=E(y=>V(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"});Ke({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=Q(),{isFeatureEnabled:T}=h(k.isLimitedCategoryForReimbursement),[u,w]=f.useState(!1),[D,A]=f.useState(!1),[F,B]=f.useState(!1),{isFeatureEnabled:x}=h(k.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(k.isShowDeletedReimbursementsFeatureEnabled),g=E(y=>le(y,c??"")),N=Pt(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"&&N===!1?B(!1):B(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,N,m]),f.useEffect(()=>{D||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(xe(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(_t(!1,!0,!0,a.lastUpdatedByUserId)))},[D,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(He,{}):s.jsxs(s.Fragment,{children:[s.jsx(ee,{analytics:v,onLoad:y=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(y)}),s.jsx(Jn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:x,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:F,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:R})]})}const Kn=q(function(e,t){return{remisReviewView:Le(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Wt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Vt());break;case"approve":e(Ae("approved",r??""));break;case"reject":e(Ae("rejected",r??""))}}}})(Bn);function Xn(){const e=J(),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(Kn,{navigate:e,analytics:v,isAdmin:d})}const z=tn(),Qe="bulk-operation-update",oe="reimbursement-approval-rule-update",{spendManagement:Yn,common:we}=Ze.getLocalizedStrings(),Be=Yn.reimbursement.bulkActions,Qn=_.div`
57
57
  display: flex;
58
58
  min-height: 100%;
59
59
  width: 100%;
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-BdePShct.js";import{j as J,h as re,u as Z,l as X
61
61
  flex-direction: column;
62
62
  align-items: center;
63
63
  background-color: ${e=>e.theme.colors.grey4};
64
- `,ea=q(function(e,t){const n=Me(e,G,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,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:G,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(Le(o))},onSubtabChange:o=>{e(z()),e(Pe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=H(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=H(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=H(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(z())},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())}}})(Dn(jn));function ta(){const e=J(),t=re(),n=Z(),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=Jt(r.tab.toString());S!=null?t(Le(S)):console.log("Warning:Not a valid remiListTab");const O=qt(r.subTab.toString());O!=null?t(Pe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(z())}},[]);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=P.getSignedInUser(),u=E(S=>V(S)),[B,D]=f.useState(!1),[A,F]=f.useState(!1),w=te(),x=w?.loggedInUserRole?.includes("admin")===!0,I=E(S=>Me(S,G,h)),{areTenantIdsInSync:g}=xn(),L=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:M}=be({mobileExploreReferrer:"Reimbursement List"});if(Ke({isDataReady:L==="Completed"}),f.useEffect(()=>{!A&&g&&(F(!0),t(se(G,!0,l,!1,!0)))},[A,G,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&Kt(u),p=de(w?.loggedInUserRoleMap),W=ue(w?.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=>{D(S)},{isFeatureEnabled:it}=a(k.isDebitCardFeatureEnabled),ot=$e(it,u),rt=_e(u),{remisProcessed:K,remisProcessing:he}=E(S=>Qt(S));f.useEffect(()=>{K===he&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:K>1?we.reports:we.report},{variableName:"_has_",variableValue:K>1?Be.texts.have:Be.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout(()=>{t(se(G,!0,l,!1,!0,!0))},3e3),m(null))},[K,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Ye}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,O,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.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)||W&&et?s.jsxs(s.Fragment,{children:[L==="Completed"?s.jsx(ee,{analytics:v,onLoad:S=>(O=>O.trackPageLoaded(Ve.Event.reimbursementHome))(S)}):null,s.jsx(Qe,{isAppContentDrawerOpen:B,handleDrawerToggle:ge}),s.jsxs(Yn,{windowSize:d,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(z())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Qn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:G,isAdmin:x,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"}):w!=null&&Oe(u,w.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=_(Ln)`
64
+ `,ea=q(function(e,t){const n=Me(e,z,t.isBulkActionEnabled);let r=n.allSubTabs;const d=P.getSignedInUser(),c=ce(d),m=e.tenantState.currentTenantId,o=V(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter(h=>h!=="deleted"));const b=n.fetchState,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:z,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(Ne(o))},onSubtabChange:o=>{e(G()),e(Pe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=H(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=H(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=H(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===Qe&&e(an())}}})(Dn(jn));function ta(){const e=J(),t=re(),n=Z(),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=Jt(r.tab.toString());S!=null?t(Ne(S)):console.log("Warning:Not a valid remiListTab");const O=qt(r.subTab.toString());O!=null?t(Pe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}},[]);const{useFeatureGate:a}=Q(),{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=P.getSignedInUser(),u=E(S=>V(S)),[w,D]=f.useState(!1),[A,F]=f.useState(!1),B=te(),x=B?.loggedInUserRole?.includes("admin")===!0,I=E(S=>Me(S,z,h)),{areTenantIdsInSync:g}=xn(),N=I.fetchState,{isAiCfoAccessEnabled:U,onAskAiCfoClick:M}=be({mobileExploreReferrer:"Reimbursement List"});if(Ke({isDataReady:N==="Completed"}),f.useEffect(()=>{!A&&g&&(F(!0),t(se(z,!0,l,!1,!0)))},[A,z,t,g]),T==null)throw Error("Can't access address page without signing in...");const y=!!u?.userRole&&Kt(u),p=de(B?.loggedInUserRoleMap),W=ue(B?.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=>{D(S)},{isFeatureEnabled:it}=a(k.isDebitCardFeatureEnabled),ot=$e(it,u),rt=_e(u),{remisProcessed:K,remisProcessing:he}=E(S=>Xt(S));f.useEffect(()=>{K===he&&c!=null&&(t(Yt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:K>1?Be.reports:Be.report},{variableName:"_has_",variableValue:K>1?we.texts.have:we.texts.has},{variableName:"_action_",variableValue:Qt(c)}]})),t(en()),setTimeout(()=>{t(se(z,!0,l,!1,!0,!0))},3e3),m(null))},[K,he]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${Qe}`,`private-encrypted-${u.companyId}.${oe}`]:[],eventCallback:(S,O,fe)=>{S.endsWith(oe)?fe.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.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)||W&&et?s.jsxs(s.Fragment,{children:[N==="Completed"?s.jsx(ee,{analytics:v,onLoad:S=>(O=>O.trackPageLoaded(Ve.Event.reimbursementHome))(S)}):null,s.jsx(Xe,{isAppContentDrawerOpen:w,handleDrawerToggle:ge}),s.jsxs(Qn,{windowSize:d,children:[s.jsx(Pn,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Xn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:R,location:n,navigate:e,currentTenant:u,period:z,isAdmin:x,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"}):B!=null&&Oe(u,B.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=_(Nn)`
65
65
  display: flex;
66
66
  min-height: 100%;
67
67
  flex-direction: column;
68
- `,ia=q(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=J(),t=Z(),{tenantEmailDomain:n}=X(),r=We(),[d,c]=f.useState(!1),m=E(A=>V(A)),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.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,B=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,D=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"}):B&&R?s.jsx($,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!B||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(Qe,{isAppContentDrawerOpen:d,handleDrawerToggle:D}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{D(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=E(W=>V(W)),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=_e(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),B=T&&u,{isFeatureEnabled:D}=m(k.isDepositAccountsFeatureEnabled),A=D&&!b&&Sn(t?.loggedInUserRoleMap),F=Nn(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),w=yn(t?.loggedInUserRoleMap),x=Rn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),L=vn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:M}=X(),y=Z(),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:B,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:w,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:w,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:B?s.jsx(Mn,{}):s.jsx($n,{isUserHasZeniAccountsAccess:x,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:L,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&&Oe(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(qn,{})}),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 ${j.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: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=J(),t=Z(),{tenantEmailDomain:n}=Y(),r=We(),[d,c]=f.useState(!1),m=E(A=>V(A)),o=P.getSignedInUserTenant(n)?.companyId??m.companyId,a=P.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,D=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(Xe,{isAppContentDrawerOpen:d,handleDrawerToggle:D}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{D(!0)}})]}):s.jsx(pe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=E(W=>V(W)),t=te(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=We(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=Q(),{isFeatureEnabled:o}=m(k.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(k.isDebitCardFeatureEnabled),i=$e(a,e),l=_e(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:D}=m(k.isDepositAccountsFeatureEnabled),A=D&&!b&&Sn(t?.loggedInUserRoleMap),F=Ln(e,o,a)&&!b&&In(t?.loggedInUserRoleMap),B=yn(t?.loggedInUserRoleMap),x=Rn(t?.loggedInUserRoleMap),I=An(t?.loggedInUserRoleMap),g=kn(t?.loggedInUserRoleMap),N=vn(t?.loggedInUserRoleMap),U=ue(t?.loggedInUserRoleMap),{tenantEmailDomain:M}=Y(),y=Z(),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:B,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Ce,{isBillPayAdminLevelAccess:R,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:w,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:F,isUserHasOnlyCardAccess:B,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:x,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:N,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&&Oe(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(qn,{})}),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 ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(ie,{})})]})}export{Pa as default};
@@ -1 +1 @@
1
- import{j as p}from"./liveblocks-BdePShct.js";import{u as z,j as ye,h as Ce,l as ge,g as d,k as Se,n as we,o as G}from"./core-C_ZreJAw.js";import{eO as L,f8 as S,J1 as Ie,jr as W,J2 as K,pJ as k,jf as Te,ii as Re,t6 as X,pO as Oe,bv as ke,J3 as Ae,bn as Fe,u5 as De,J4 as je,J5 as Ee,s_ as Pe,J6 as H,J7 as Le,J8 as Me,J9 as Be,Ja as Je,Jb as w,Jc as A,Jd as F,Je as N,Jf as D,Jg as j,dC as ve,tN as Ue,tB as Y,tC as $,tT as Ve,tG as q,tZ as xe,Jh as ze,Ji as Ge,Jj as He,Jk as Ne,Jl as Ye,eU as $e,eS as qe}from"./zeni-epic-state-H6DZSSlf.js";import{N as Ze,Q as Qe,Z as We,y as ee,$ as E,z as ae,R as Ke,k as Xe,a as ea,A as aa,c as P,f as sa,s as se,T as ta,U as oa,W as na}from"./index-CGS6zWWp.js";import"./mui-BtnH6ELy.js";import ra from"./NotFoundScreen-C4aqnA8_.js";import{F as ia}from"./FeaturePreviewScreen-aYYY9m7f.js";import{a as _}from"./sentry-CX_3yQh7.js";import{u as la,a as ca,b as da,c as pa}from"./useFetchSuggestedQuestionsWhenReady-C86A67zi.js";import{u as fa}from"./useInitialThreadRequest-AyrSL871.js";import{t as Z,a as Q}from"./routePaths-DZkWYInw.js";import{M as ma}from"./MobileAppDrawer-BDT0TmvR.js";import"./recharts-CHr9O26_.js";import"./analytics-CgF6EPDF.js";import"./plaid-CLHQ0yLv.js";import"./dnd-C3uQO7Bn.js";import"./stripe-DMRn4zHo.js";import"./lottie-CUKBWgbe.js";import"./lexical-E_ubWL4u.js";import"./pdf-CH0jWS01.js";import"./utils-Dw8b4HCO.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]="90c50615-12e6-4cbe-9dfc-f0b66c64ad3c",e._sentryDebugIdIdentifier="sentry-dbid-90c50615-12e6-4cbe-9dfc-f0b66c64ad3c")}catch{}})();const ua=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(A({resetLeftScroll:!0}))},_a=e=>{e(Ge()),e(He()),e(Ne()),e(Ye())},ha=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=S(e),r=Ae(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:W(e),isAccountingProjectsEnabled:K(e),currentTenantCompanyName:a,statementEndPoint:`${na}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(k(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:m,balancesRange:l}=c;let i=[...m];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(Y(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),m.length>0&&e($(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.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(q({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(q(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(Y(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(Ue({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,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{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,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return Q(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,c):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,c):void 0})();if(l!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(l,{state:{pathnameStackToGoBack:i,referrer:I(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({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(A({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(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({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(A({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(Je({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",I(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",I(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",I(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{_a(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ta);function ba(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Qe(),f=We(),u=oa(f),a=ye(),s=Ce(),t=z(),{tenantEmailDomain:r}=ge(),{useFeatureGate:c}=ee(),{isFeatureEnabled:m}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=ae.getSignedInUser(),[i,C]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const J=d(n=>L(n)),oe=J.company?.companyInfo.firstMonthOfFY??1,ne=fa(B?J?.companyId:void 0),g=d(n=>S(n).fetchState),re=d(n=>Ie(n)),{areTenantIdsInSync:h}=Ke(),T=d(n=>n.financeStatementState.selectedReportId),v=d(n=>W(n)),R=d(n=>K(n)),ie=d(n=>S(n).isCompareModeOn),b=d(n=>S(n).filter),O=d(n=>S(n).selectedReportAndTimeframeFetchState),le=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(k(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!M&&g==="Completed"&&h&&(s(k(l.userId,!1,!0,!1)),te(!0))},[i,M,g,h]),_.useEffect(()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(T){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":R&&s(X());break;case"balance_sheet":s(Re(b.timeframe));break;case"cash_flow":s(Te(b.timeframe))}},[i,T,O,h,v,R]);const U=Xe(),ce=U?.loggedInUserRole!=null&&ke(U?.loggedInUserRole)!==!0,[de,pe]=_.useState(!1),V=n=>{pe(n)},fe=ea(),me=da();return function(n){const{isDataReady:ue}=n,{pathname:_e}=z(),x=Ze(_e??"")==="reports",he=la(ue),be=_.useMemo(()=>x?ua:void 0,[x]);ca({canFetchSuggestedQuestions:he,pageContexts:be})}({isDataReady:g==="Completed"}),pa({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(aa,{analytics:P,onLoad:n=>n.trackPageLoaded(sa.Event.reports)}):null,p.jsx(ma,{isAppContentDrawerOpen:de,handleDrawerToggle:V}),p.jsx(ha,{firstMonthOfFY:oe,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:le,selectedReportID:T,analytics:P,filter:b,isAccountingClassesEnabled:v,isAccountingProjectsEnabled:R,isCompareModeOn:ie,hasTransactionAccess:ce,signedInUser:l,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:V,reportsResyncFetchState:re.reportsResyncFetchState,isAiCfoAccessEnabled:me&&fe&&!e,onAskAiCfoClick:()=>{if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:ne})]})}const I=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 Ua(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=$e(f,e),a=qe(e);return u===!0||a===!0?p.jsx(ia,{}):p.jsxs(we,{children:[p.jsx(G,{path:"/",element:p.jsx(ba,{})}),p.jsx(G,{path:"*",element:p.jsx(ra,{})})]})}export{Ua as default};
1
+ import{j as p}from"./liveblocks-D41N0IlG.js";import{u as z,j as ye,h as Ce,l as ge,g as d,k as Se,n as we,o as G}from"./core-B86WF2Ww.js";import{eO as L,f8 as S,Jj as Ie,jA as Z,Jk as X,pS as O,jo as Re,is as Te,tm as K,pX as Ae,bv as Oe,Jl as ke,bn as Fe,ul as De,Jm as je,Jn as Ee,te as Pe,Jo as H,Jp as Le,Jq as Me,Jr as Be,Js as Je,Jt as w,Ju as k,Jv as F,Jw as Y,Jx as D,Jy as j,dC as ve,u1 as Ue,tR as N,tS as q,u7 as Ve,tW as $,ud as xe,Jz as ze,JA as Ge,JB as He,JC as Ye,JD as Ne,eU as qe,eS as $e}from"./zeni-epic-state-BLvcbIPk.js";import{M as Qe,Q as We,Z as Ze,y as ee,S as E,z as ae,R as Xe,k as Ke,a as ea,w as aa,c as P,e as sa,n as se,U as ta,V as oa,W as na}from"./index-B7GRpDkc.js";import"./mui-DZd7XaFW.js";import ra from"./NotFoundScreen-gdNFrdCn.js";import{F as ia}from"./FeaturePreviewScreen-K5aATczv.js";import{a as _}from"./sentry-Bhr8KU--.js";import{u as la,a as ca,b as da,c as pa}from"./useFetchSuggestedQuestionsWhenReady-B1r7XRNi.js";import{u as ma}from"./useInitialThreadRequest-Oe-7-CI7.js";import{t as Q,a as W}from"./routePaths-PD5Rqyfc.js";import{M as fa}from"./MobileAppDrawer-Cgt4TE38.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.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]="d32b3a36-757f-49e0-8814-857c79ee3289",e._sentryDebugIdIdentifier="sentry-dbid-d32b3a36-757f-49e0-8814-857c79ee3289")}catch{}})();const ua=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(F({resetLeftScroll:!0})),e(k({resetLeftScroll:!0}))},_a=e=>{e(Ge()),e(He()),e(Ye()),e(Ne())},ha=Se(function(e){const o=ae.getSignedInUser(),m=e.tenantState.currentTenantId,u=L(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:m??""},t=S(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:Z(e),isAccountingProjectsEnabled:X(e),currentTenantCompanyName:a,statementEndPoint:`${na}/statement`,authParams:s,isZeniCOAUsed:r}},function(e,o){const{navigate:m,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(ze(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(xe(a)),s){const{isCompareModeOn:r,filter:c}=o,{additionalBalances:f,balancesRange:l}=c;let i=[...f];a==="year"&&(i=i.filter(C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year")),e(N(o.firstMonthOfFY,r,l.numberOfPeriods<1?1:l.numberOfPeriods,i)),f.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",l.numberOfPeriods<1?1:l.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($({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($(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(Ve(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e(N(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(Ue({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,c;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,c=ve(s)):s.balanceTimeFrame==="year"?(r="quarter",c={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),c!=null&&r!=null){const f=a.accountName===""?a.accountDescription:a.accountName,l=(()=>{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,f,r,c);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return W(o.tenantEmailDomain,a.accountId,a.accountType,s.id,f,r,c)}return a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?W(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],f,r,c):a.accountType!=null?Q(o.tenantEmailDomain,a.accountId,a.accountType,f,r,c):void 0})();if(l!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);m(l,{state:{pathnameStackToGoBack:i,referrer:I(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(j({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(D({scrollPosition:s}));break;case"profit_and_loss_by_projects":e(Y({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(j({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(D({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e(Y({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:()=>{m("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Je({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",I(o.selectedReportID)),e(w("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",I(o.selectedReportID)),e(w("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",I(o.selectedReportID)),e(w("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Me({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(H({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(K())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{_a(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}})(ta);function ba(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=We(),m=Ze(),u=oa(m),a=ye(),s=Ce(),t=z(),{tenantEmailDomain:r}=ge(),{useFeatureGate:c}=ee(),{isFeatureEnabled:f}=c(E.isReportsHorizontalClassLayoutSwitchEnabled),l=ae.getSignedInUser(),[i,C]=_.useState(!1),[M,te]=_.useState(!1),{isFeatureEnabled:B}=c(E.isReportsCommentingEnabled);if(l==null)throw Error("Can't access reports page without signing in...");const J=d(n=>L(n)),oe=J.company?.companyInfo.firstMonthOfFY??1,ne=ma(B?J?.companyId:void 0),g=d(n=>S(n).fetchState),re=d(n=>Ie(n)),{areTenantIdsInSync:h}=Xe(),R=d(n=>n.financeStatementState.selectedReportId),v=d(n=>Z(n)),T=d(n=>X(n)),ie=d(n=>S(n).isCompareModeOn),b=d(n=>S(n).filter),A=d(n=>S(n).selectedReportAndTimeframeFetchState),le=d(n=>n.profitAndLossClassesViewState.uiState.classViewLayout);_.useEffect(()=>{!i&&h&&(C(!0),s(O(l.userId,!0,!0,!1)))},[i,l,s,h]),_.useEffect(()=>{i&&!M&&g==="Completed"&&h&&(s(O(l.userId,!1,!0,!1)),te(!0))},[i,M,g,h]),_.useEffect(()=>{if(i&&A.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Ae(b.timeframe));break;case"profit_and_loss_by_projects":T&&s(K());break;case"balance_sheet":s(Te(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}},[i,R,A,h,v,T]);const U=Ke(),ce=U?.loggedInUserRole!=null&&Oe(U?.loggedInUserRole)!==!0,[de,pe]=_.useState(!1),V=n=>{pe(n)},me=ea(),fe=da();return function(n){const{isDataReady:ue}=n,{pathname:_e}=z(),x=Qe(_e??"")==="reports",he=la(ue),be=_.useMemo(()=>x?ua:void 0,[x]);ca({canFetchSuggestedQuestions:he,pageContexts:be})}({isDataReady:g==="Completed"}),pa({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(aa,{analytics:P,onLoad:n=>n.trackPageLoaded(sa.Event.reports)}):null,p.jsx(fa,{isAppContentDrawerOpen:de,handleDrawerToggle:V}),p.jsx(ha,{firstMonthOfFY:oe,tenantEmailDomain:r,location:t,navigate:a,windowSize:m,classViewLayout:le,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:v,isAccountingProjectsEnabled:T,isCompareModeOn:ie,hasTransactionAccess:ce,signedInUser:l,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:V,reportsResyncFetchState:re.reportsResyncFetchState,isAiCfoAccessEnabled:fe&&me&&!e,onAskAiCfoClick:()=>{if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0)},isHorizontalClassReportSwitchEnabled:f,isReportsCommentingEnabled:B,initialOpenThreadRequest:ne})]})}const I=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 Ua(){const e=d(s=>L(s)),{useFeatureGate:o}=ee(),{isFeatureEnabled:m}=o(E.isDebitCardFeatureEnabled),u=qe(m,e),a=$e(e);return u===!0||a===!0?p.jsx(ia,{}):p.jsxs(we,{children:[p.jsx(G,{path:"/",element:p.jsx(ba,{})}),p.jsx(G,{path:"*",element:p.jsx(ra,{})})]})}export{Ua as default};
@@ -0,0 +1 @@
1
+ import{j as a}from"./liveblocks-D41N0IlG.js";import{y as x,z as j,aK as y,w as E,c as p,e as P,cG as F,S as L}from"./index-B7GRpDkc.js";import"./mui-DZd7XaFW.js";import l from"./NotFoundScreen-gdNFrdCn.js";import{a as f}from"./sentry-Bhr8KU--.js";import{h as T,g as b,j as V,u as A,k as R,n as U,o as u}from"./core-B86WF2Ww.js";import{eO as z,PW as C,ML as G,PX as _,tI as Y,e_ as O,PY as K,tG as M}from"./zeni-epic-state-BLvcbIPk.js";import{R as w}from"./ReferralListScreen-ChHWDxsd.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.js";import"./useAskAiCfoHostNavButtonProps-BfmyGytS.js";import"./useFetchSuggestedQuestionsWhenReady-B1r7XRNi.js";import"./MobileAppDrawer-Cgt4TE38.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]="0fbb9d32-dafb-4aac-ac16-f4147f2056ec",e._sentryDebugIdIdentifier="sentry-dbid-0fbb9d32-dafb-4aac-ac16-f4147f2056ec")}catch{}})();const W=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=j.getSignedInUser();return{onDismissClick:()=>{e(_()),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(M())},onUpdateInviteFormLocalData:s=>{e(K({localData:s}))},onSubmitSuccess:()=>{n("../../")},onCancelClick:()=>{i!=null&&p.trackInviteEmailClicked("cancel")}}})(F),X=()=>{const e=T(),[t,n]=f.useState(!1),[i,s]=f.useState(!1),r=b(o=>z(o)),c=V(),k=A(),{useDynamicConfig:g}=x(),d=j.getSignedInUser();if(d==null)throw Error("Can't access invite referral screen without signing in...");const m=b(o=>C(o)),D=d?.firstName!=null?d.firstName:"User",{configValue:h}=g(y.zeniCardsConfig),{configValue:S}=g(y.zeniAccountsConfig),v=G(S);f.useEffect(()=>{e(_()),r?.rewardsLastViewedTime==null&&i===!1&&(e(Y()),s(!0))},[]),f.useEffect(()=>{t||m.fetchState!=="Not-Started"||(n(!0),e(O(!0)))},[m.fetchState,e]);const I=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[m.fetchState==="Completed"?a.jsx(E,{analytics:p,onLoad:o=>(N=>N.trackPageLoaded(P.Event.inviteEmailViewed))(o)}):null,a.jsx(W,{navigate:c,location:k,currentTenant:r,companyName:I,userName:D,inviteFormCompayData:m.localData,chargeCardCashbackRatePerTransaction:h.charge_card_cashback_rate_per_transaction!=null?h.charge_card_cashback_rate_per_transaction:.0175,maxAnnualPercentageYield:v.maxAnnualPercentageYield})]})};function de(){const{useFeatureGate:e}=x(),{isFeatureEnabled:t}=e(L.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(u,{path:"/",element:t?a.jsx(w,{}):a.jsx(l,{})}),a.jsx(u,{path:"how-it-works",element:t?a.jsx(w,{isReferralDrawerOpen:!0}):a.jsx(l,{})}),a.jsx(u,{path:"refer/*",element:t?a.jsx(X,{}):a.jsx(l,{})}),a.jsx(u,{path:"*",element:a.jsx(l,{})})]})}export{de as default};
@@ -0,0 +1,2 @@
1
+ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-DCYo-RgX.js","assets/sentry-Bhr8KU--.js","assets/core-B86WF2Ww.js","assets/zeni-epic-state-BLvcbIPk.js","assets/index-B7GRpDkc.js","assets/mui-DZd7XaFW.js","assets/analytics-CFOBCmx3.js","assets/utils-Mvk27uIx.js","assets/withTransactionSidePanel-7uc9rYEd.js","assets/useAskAiCfoHostNavButtonProps-BfmyGytS.js","assets/useFetchSuggestedQuestionsWhenReady-B1r7XRNi.js","assets/TransactionDetailScreen-eONbl3-5.js","assets/decodeURIComponentSafe-C-DNZuqb.js","assets/routePaths-PD5Rqyfc.js","assets/NotFoundScreen-gdNFrdCn.js","assets/analyticsHelper-ByPPdEaS.js","assets/CompanyPassportScreen-ImtgWbLz.js","assets/MobileAppDrawer-Cgt4TE38.js","assets/FeaturePreviewScreen-K5aATczv.js","assets/ReferralListScreen-ChHWDxsd.js","assets/index-Bc34frN_.css","assets/BillPayRoutes-0Ir4R_dy.js","assets/AddressScreen--B-G7QO-.js","assets/DomesticWireDetailScreen-C7OJwgdT.js","assets/useInitialThreadRequest-Oe-7-CI7.js","assets/DrawerScreen-BZUjw4oO.js","assets/SetupPagesScreen-DucLsH4D.js","assets/BusinessVerificationPageScreen-C5SO6Pvr.js","assets/BillPayApprovalRoutes-BTct1_HT.js","assets/ReimbursementApprovalRuleDetailScreen-DC3PDULr.js","assets/getLocaleForTenant-CRLTWbEq.js","assets/ReimbursementRoutes-CSWRe0vq.js","assets/ReimbursementApprovalRoutes-TgmzGWOx.js","assets/TransactionListRoutes-zno0rGgt.js","assets/ZeniAccountStatementScreen-vtEr6xSK.js","assets/SettingsRoutes-DVvUA_Bx.js","assets/accountMappingHelper-yvOeY36k.js","assets/QBOConnectionScreen-BdH_dfqU.js","assets/empty-CRbjQ82E.js","assets/index-CcACvObI.js","assets/url-CgMNpbBl.js","assets/index-BHE-07hU.js","assets/ReportsRoutes-DKXm4KKp.js","assets/ChargeCardRoutes-DYWYfiCF.js","assets/PeopleRoutes-jbfRIyVB.js","assets/ExpenseAutomationRoutes-CsEeiul8.js","assets/TreasuryRoutes-LPcPr4Bm.js","assets/VendorsRoutes-B9bJ-Aua.js","assets/pathToGoBack-Dt_z5GBF.js","assets/ZeniAccountRoutes-Dsy44Rah.js","assets/AddressRoutes-C-QI3DFo.js","assets/PandLWithForecastRoutes-Bm69S-Ti.js","assets/CustomerOnboardingRoutes-D083k3se.js","assets/TransactionDetailRoutes-DiMG8Ceq.js","assets/EntityDetailRoutes-D0h8mKin.js","assets/NotificationRoutes-BdPqco6s.js","assets/PerformanceRoutes-Bmd54T25.js","assets/RewardsRoutes-vGbrbx2s.js","assets/TaskRoutes-Tf445JV3.js","assets/TaskListScreen-38bto6MZ.js","assets/AiCfoScreen-B1XtoO1j.js"])))=>i.map(i=>d[i]);
2
+ import{_ as n,bn as os,eO as ls,eU as cs,eS as ds,eT as ms,fD as us,eQ as _s,cP as Ee,cw as Es,f9 as As,co as ps,bD as Is,bq as gs,fe as xs,v as Ts,IR as hs,bv as js,IS as Us,bF as Ds,fb as Hs,bE as Rs,bs,ck as ys,IT as fs,IU as Cs,cM as vs,cO as Os,cN as Ps,cv as Fs,cB as Ls,mv as Ae,eP as pe,fN as Bs,fi as Ie,fK as ge,fL as xe,fj as ks}from"./zeni-epic-state-BLvcbIPk.js";import{j as e}from"./liveblocks-D41N0IlG.js";import{a as v}from"./sentry-Bhr8KU--.js";import{h as Ss,j as Vs,l as Ns,u as Ms,g as z,i as Te,N as c,n as Zs,o as t}from"./core-B86WF2Ww.js";import{m as ws,u as zs,z as H,y as Gs,a as $s,j as Ys,S as L,k as qs,L as B,D as he,t as _,P as Ws,c as X,l}from"./index-B7GRpDkc.js";import"./mui-DZd7XaFW.js";import{f as je}from"./analyticsHelper-ByPPdEaS.js";import{t as Ks}from"./getLocaleForTenant-CRLTWbEq.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.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]="0ac571a7-6922-4271-94e7-2811ec648eff",i._sentryDebugIdIdentifier="sentry-dbid-0ac571a7-6922-4271-94e7-2811ec648eff")}catch{}})();const Qs={dashboard:()=>n(()=>import("./DashboardRoutes-DCYo-RgX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20])),bills:()=>n(()=>import("./BillPayRoutes-0Ir4R_dy.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20])),reimbursement:()=>n(()=>import("./ReimbursementRoutes-CSWRe0vq.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20])),transactions:()=>n(()=>import("./TransactionListRoutes-zno0rGgt.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20])),settings:()=>n(()=>import("./SettingsRoutes-DVvUA_Bx.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20])),reports:()=>n(()=>import("./ReportsRoutes-DKXm4KKp.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20])),chargeCards:()=>n(()=>import("./ChargeCardRoutes-DYWYfiCF.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20])),people:()=>n(()=>import("./PeopleRoutes-jbfRIyVB.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20])),expenseAutomation:()=>n(()=>import("./ExpenseAutomationRoutes-CsEeiul8.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20])),treasury:()=>n(()=>import("./TreasuryRoutes-LPcPr4Bm.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20])),vendors:()=>n(()=>import("./VendorsRoutes-B9bJ-Aua.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20])),zeniAccounts:()=>n(()=>import("./ZeniAccountRoutes-Dsy44Rah.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))},Js=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=i=>{"requestIdleCallback"in window?requestIdleCallback(i):setTimeout(i,100)},Xs=l(()=>n(()=>import("./ReportsRoutes-DKXm4KKp.js"),__vite__mapDeps([42,1,2,3,4,5,6,7,14,18,10,24,13,17,20]))),en=l(()=>n(()=>import("./AddressRoutes-C-QI3DFo.js"),__vite__mapDeps([50,1,2,3,22,4,5,6,7,14,20]))),sn=l(()=>n(()=>import("./PeopleRoutes-jbfRIyVB.js"),__vite__mapDeps([44,1,2,3,4,5,6,7,14,9,10,17,20]))),nn=l(()=>n(()=>import("./PandLWithForecastRoutes-Bm69S-Ti.js"),__vite__mapDeps([51,1,2,3,4,5,6,7,14,18,9,10,24,13,17,20]))),an=l(()=>n(()=>import("./CustomerOnboardingRoutes-D083k3se.js"),__vite__mapDeps([52,1,2,3,22,4,5,6,7,14,37,38,39,40,41,12,20]))),tn=l(()=>n(()=>import("./VendorsRoutes-B9bJ-Aua.js"),__vite__mapDeps([47,1,2,3,4,5,6,7,22,14,18,13,48,9,10,17,25,36,20]))),rn=l(()=>n(()=>import("./TransactionDetailRoutes-DiMG8Ceq.js"),__vite__mapDeps([53,1,2,3,14,4,5,6,7,11,9,10,12,13,20]))),Ue=l(()=>n(()=>import("./EntityDetailRoutes-D0h8mKin.js"),__vite__mapDeps([54,1,2,3,4,5,6,7,12,8,9,10,11,13,20]))),on=l(()=>n(()=>import("./DashboardRoutes-DCYo-RgX.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]))),De=l(()=>n(()=>import("./BillPayRoutes-0Ir4R_dy.js"),__vite__mapDeps([21,1,2,3,4,5,6,7,22,14,23,9,10,24,25,17,18,26,15,13,27,28,29,30,20]))),ln=l(()=>n(()=>import("./SettingsRoutes-DVvUA_Bx.js"),__vite__mapDeps([35,1,2,3,4,5,6,7,17,36,22,14,15,27,13,16,37,38,39,40,41,12,28,29,32,20]))),He=l(()=>n(()=>import("./ReimbursementRoutes-CSWRe0vq.js"),__vite__mapDeps([31,1,2,3,4,5,6,7,14,26,17,15,13,27,18,9,10,24,25,32,29,30,20]))),cn=l(()=>n(()=>import("./ZeniAccountRoutes-Dsy44Rah.js"),__vite__mapDeps([49,1,2,3,4,5,6,7,14,26,17,15,13,27,18,23,22,9,10,34,20]))),dn=l(()=>n(()=>import("./TreasuryRoutes-LPcPr4Bm.js"),__vite__mapDeps([46,1,2,3,4,5,6,7,14,26,17,15,13,27,9,10,18,20]))),mn=l(()=>n(()=>import("./TransactionListRoutes-zno0rGgt.js"),__vite__mapDeps([33,1,2,3,4,5,6,7,8,9,10,11,12,13,34,20]))),un=l(()=>n(()=>import("./ChargeCardRoutes-DYWYfiCF.js"),__vite__mapDeps([43,1,2,3,4,5,6,7,26,17,14,15,13,27,9,10,22,20]))),_n=l(()=>n(()=>import("./NotificationRoutes-BdPqco6s.js"),__vite__mapDeps([55,1,2,3,14,4,5,6,7,9,10,20]))),En=l(()=>n(()=>import("./PerformanceRoutes-Bmd54T25.js"),__vite__mapDeps([56,1,2,3,14,4,5,6,7,9,10,17,20]))),An=l(()=>n(()=>import("./ExpenseAutomationRoutes-CsEeiul8.js"),__vite__mapDeps([45,1,2,3,14,4,5,6,7,9,10,11,12,13,8,36,25,20]))),pn=l(()=>n(()=>import("./RewardsRoutes-vGbrbx2s.js"),__vite__mapDeps([57,1,2,3,4,5,6,7,14,19,9,10,17,20]))),In=l(()=>n(()=>import("./TaskRoutes-Tf445JV3.js"),__vite__mapDeps([58,1,2,3,14,4,5,6,7,24,17,59,9,10,20]))),gn=l(()=>n(()=>import("./AiCfoScreen-B1XtoO1j.js"),__vite__mapDeps([60,1,2,3,4,5,6,7,48,20]))),y=l(()=>n(()=>import("./NotFoundScreen-gdNFrdCn.js"),__vite__mapDeps([14,1,2,3,4,5,6,7,20]))),xn=l(()=>n(()=>import("./TaskListScreen-38bto6MZ.js"),__vite__mapDeps([59,1,2,3,4,5,6,7,9,10,17,20])));function wn({setTenantEmailDomain:i}){const U=Ss(),S=Vs(),{tenantEmailDomain:o}=Ns(),V=ws().mode,{setLoading:f,clearAllLoading:O,clearLoading:Z}=zs(),b=H.getSignedInUserTenant(o)?.tenantId,h=H.getSignedInUser(),K=os(h),G=Ms(),[N,be]=v.useState(!1),r=z(a=>ls(a)),{useFeatureGate:P}=Gs(),Q=$s(),ye=Ys(),{isFeatureEnabled:fe}=P(L.isExpenseAutomationEnabled),{isFeatureEnabled:Ce}=P(L.isExpenseAutomationEnabledV2),ve=Ce||fe&&K,{isFeatureEnabled:Oe}=P(L.isDepositAccountsFeatureEnabled),{isFeatureEnabled:Pe}=P(L.isTreasuryEnabled),{isFeatureEnabled:Fe}=P(L.isChargeCardFeatureEnabled),{isFeatureEnabled:se}=P(L.isDebitCardFeatureEnabled),j=z(a=>a.tenantState.fetchState),A=z(a=>a.tenantState.activeTenantFetchState.fetchState),u=A==="Completed"||j==="Completed"?cs(se,r):void 0,$=A==="Completed"||j==="Completed"?ds(r):void 0,Le=A==="Completed"||j==="Completed"?ms(r):void 0,Be=Fe||se||!!Le||!!$||!!u,{isFeatureEnabled:ke}=P(L.isSettingsFeatureEnabled),{isFeatureEnabled:Se}=P(L.isAiCfoFileUploadEnabled),Y=z(a=>us(a));if(o!=null){const a=H.getSignedInUserTenant(o);h!=null&&a!=null&&je(h,r,V)}const w={tenantId:b,userId:h?.userId,sessionId:h?.zeniSessionId},ne=_s(),E=qs(),Ve=r.company==null||E?.loggedInUserRoleMap!=null&&Ee(E.loggedInUserRole),Ne=Es(E?.loggedInUserRoleMap),ae=v.useRef(!0),te=Te("/:tenantEmailDomain/onboarding/*")!==null,J=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Me=z(a=>w.tenantId!=null?As(a,w.tenantId):void 0);v.useEffect(()=>{f(B.TENANT_FETCHING),i(o)},[o]),v.useEffect(()=>{if(J!=null&&b!=null){const a=J.params.selectedPeriod;if(a!=null){const D=a.split("-");if(D.length===2){const d=ps(Number(D[0])),s=Number(D[1]),m=Is(`01-${d<10?`0${d}`:d}-${s}`,he.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),M=gs();m.isAfter(M,"month")===!1?U(xs(b,{month:d,year:s})):S("./month_end_close_checks/review")}}}},[J,b]),v.useEffect(()=>{N||(be(!0),f(B.TENANT_FETCHING)),ae.current?ae.current=!1:!Ts(ne,w)&&H.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,D,d,s){if(pe(D?.userId,D?.zeniSessionId,a.tenantId),d(Bs(!0)),d(Ie(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const m=H.getSignedInUserTenantWithId(a.tenantId);s&&he.updateAppLocaleID(Ks(s)),m?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(m?.tenantEmailDomain)}a.userId!=null?X.identify(a.userId,{tenant_id:a.tenantId}):X.resetUserIdentity()}(w,h,U,Me))},[w,ne,h,U,H]),v.useEffect(()=>{H.isSignedIn()&&(f(B.TENANT_FETCHING),function(a,D,d,s,m,M,k){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const q=s!=null&&m?.zeniSessionId!=null,ts=d==null||d.tenantId!==s,is=d!=null&&d.excludedResources==null,rs=d!=null&&d.externalConnections==null;if(q&&ts){k(Ie(s));const W=H.getSignedInUserTenantWithId(s);W?.tenantEmailDomain!=null&&H.saveActiveTenantDomainForUser(W?.tenantEmailDomain),pe(m?.userId,m?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)))}else q&&is&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),k(ge(m.userId,s))),q&&rs&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),k(xe(m.userId,s)));if(q){X.identify(m.userId,{tenant_id:s});const W=s==null||s!=null&&(D==="Completed"||D==="Error");a==="Completed"||D!=="Not-Started"&&D!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),M(B.TENANT_FETCHING),k(ks(m.userId,s,m.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),k(Ae(m.userId,m.zeniSessionId)))}}(j,A,r,b,h,f,U))},[b,A]),v.useEffect(()=>{H.isSignedIn()&&j==="Completed"&&Y.tenantsBaseInOrder.length>0&&(Z(B.TENANT_FETCHING),H.saveSignedInUserTenants(hs(Y.tenantsBaseInOrder)),h!=null&&je(h,r,V,void 0,Y.tenantsBaseInOrder))},[Y,j,r,h]),v.useEffect(()=>{A==="In-Progress"&&f(B.TENANT_FETCHING),A!=="Completed"&&A!=="Error"||(A==="Completed"&&b!=null?(O(),_.markActiveTenantFetchCompleted(b)):A==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),Z(B.TENANT_FETCHING),Z(B.TENANT_SWITCHING))),j!=="Completed"&&j!=="Error"||(j==="Completed"?_.markAllTenantsFetchCompleted():j==="Error"&&_.markAllTenantsFetchFailed())},[A,j,b,N]);const ie=v.useRef(!1);v.useEffect(()=>{!ie.current&&A==="Completed"&&N&&(ie.current=!0,function(a=Js,D=3e3){setTimeout(()=>{const d=s=>{if(s>=a.length)return;const m=a[s],M=Qs[m];M!=null?M().then(()=>ee(()=>d(s+1))).catch(()=>ee(()=>d(s+1))):d(s+1)};ee(()=>d(0))},D)}())},[A,N]);const C=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ze}=P(L.isReferralFeatureEnabled),we=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),F=r?.userRole!=null&&Ee(r.userRole),re=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!C,oe=Be&&!C,Ge=Us(E?.loggedInUserRoleMap),$e=r.externalConnections?.accounting[0]?.isValid,le=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!C,de=ce&&Ds(E?.loggedInUserRoleMap),me=Oe&&!C,Ye=r.company!=null&&Hs(r.company),qe=Pe&&Ye===!0&&!C,We=re&&Rs(E?.loggedInUserRoleMap),Ke=oe&&bs(E?.loggedInUserRoleMap),Qe=me&&ys(E?.loggedInUserRoleMap),Je=fs(E?.loggedInUserRoleMap),Xe=Cs(E?.loggedInUserRoleMap),p=vs(E?.loggedInUserRoleMap),I=Os(E?.loggedInUserRoleMap),g=Ps(E?.loggedInUserRoleMap),x=Fs(E?.loggedInUserRoleMap),T=Ls(E?.loggedInUserRoleMap),ue=re&&x,_e=ce&&T,es=me&&p,ss=qe&&I,ns=oe&&g,as=r.excludedResources?.resources?.find(a=>a.resource==="/invites")!=null||Ne===!0||Ge===!0||Je===!0||Xe===!0;return H.isSignedIn()?b==null?j==="Completed"?e.jsx(c,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(h!=null&&j!=="In-Progress"&&U(Ae(h.userId,h.zeniSessionId)),null):A!=="In-Progress"&&A!=="Not-Started"||j==="Completed"?(le===!0||K&&!te)&&$e===!1&&u===!1&&$===!1?(i(void 0),e.jsx(c,{to:"/connection/auth",replace:!0})):!N||le!==!1||te||K?N&&r?.userRole&&u!=null&&$!=null&&o!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Zs,{children:e.jsxs(t,{element:e.jsx(Ws,{}),children:[e.jsx(t,{path:"/",element:e.jsx(Tn,{isDashboardAccess:F,isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,isTenantCardsOnly:$})}),e.jsx(t,{path:"dashboard/*",element:F?e.jsx(on,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reports/*",element:F?e.jsx(Xs,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"people/*",element:as||F?e.jsx(sn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"forecast/*",element:F?e.jsx(nn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"onboarding/*",element:e.jsx(an,{})}),e.jsx(t,{path:"transaction/*",element:F&&C===!1||we||ze?e.jsx(rn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"transactions/*",element:F&&C===!1?e.jsx(mn,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"customer/*",element:F&&C===!1?e.jsx(Ue,{entityType:"customer"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isTenantBankingOnly:u,isUserHasTreasuryAccess:I,tenantEmailDomain:o})}),e.jsx(t,{path:"vendor/*",element:F&&C===!1?e.jsx(Ue,{entityType:"vendor"}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"tasks",element:e.jsx(xn,{})}),e.jsx(t,{path:"tasks/*",element:e.jsx(In,{})}),e.jsx(t,{path:"address/*",element:We||de||Qe||Ke?e.jsx(en,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"checking/*",element:es?e.jsx(cn,{}):e.jsx(y,{})}),e.jsx(t,{path:"treasury/*",element:ss?e.jsx(dn,{}):e.jsx(y,{})}),e.jsx(t,{path:"performance",element:ye?e.jsx(En,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"month_end_close_checks/review/*",element:ve&&C===!1?e.jsx(An,{}):e.jsx(Re,{tenantEmailDomain:o})}),e.jsx(t,{path:"notifications/*",element:e.jsx(_n,{})}),e.jsx(t,{path:"vendors/*",element:Ve?e.jsx(tn,{}):e.jsx(y,{})}),e.jsx(t,{path:"bill/*",element:ue?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"bills/*",element:ue?e.jsx(De,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursement/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"reimbursements/*",element:_e?e.jsx(He,{}):e.jsx(R,{isUserHasZeniAccountsAccess:p,isUserHasChargeCardAccess:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:T,isUserHasTreasuryAccess:I,isTenantBankingOnly:u,tenantEmailDomain:o})}),e.jsx(t,{path:"settings/*",element:ke?e.jsx(ln,{hasAdminLevelAccess:de}):e.jsx(y,{})}),e.jsx(t,{path:"cards/*",element:ns?e.jsx(un,{}):e.jsx(y,{})}),e.jsx(t,{path:"rewards/*",element:Ze?e.jsx(pn,{}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/",element:Q?e.jsx(c,{to:"explore"}):e.jsx(y,{})}),e.jsx(t,{path:"/ai-cfo/:session_id",element:Q?e.jsx(gn,{isFileUploadEnabled:Se}):e.jsx(y,{})}),e.jsx(t,{path:"*",element:e.jsx(y,{})})]})}):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:{...G.state,message:"...",origin:G.pathname}}))}const Tn=({isDashboardAccess:i,isUserHasZeniAccountsAccess:U,isUserHasChargeCardAccess:S,isUserHasBillPayAccess:o,isUserHasReimbursementAccess:V,isUserHasTreasuryAccess:f,isTenantBankingOnly:O,isTenantCardsOnly:Z})=>O===!0&&U?e.jsx(c,{to:"checking"}):Z===!0?e.jsx(c,{to:"cards"}):i?e.jsx(c,{to:"dashboard"}):U?e.jsx(c,{to:"checking"}):f?e.jsx(c,{to:"treasury"}):S?e.jsx(c,{to:"cards"}):o?e.jsx(c,{to:"bills"}):V?e.jsx(c,{to:"reimbursements"}):e.jsx(c,{to:"dashboard"}),R=({isUserHasZeniAccountsAccess:i,isUserHasChargeCardAccess:U,isUserHasBillPayAccess:S,isUserHasReimbursementAccess:o,isUserHasTreasuryAccess:V,isTenantBankingOnly:f,tenantEmailDomain:O})=>f===!0||i?e.jsx(Dn,{tenantEmailDomain:O}):V?e.jsx(Un,{tenantEmailDomain:O}):U?e.jsx(Hn,{tenantEmailDomain:O}):S?e.jsx(jn,{tenantEmailDomain:O}):o?e.jsx(hn,{tenantEmailDomain:O}):e.jsx(y,{}),hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/reimbursements`}),jn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/bills`}),Un=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/treasury`}),Dn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/checking`}),Hn=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/cards`}),Re=({tenantEmailDomain:i})=>e.jsx(c,{to:`/${i}/dashboard`});export{R as FallBackRoute,wn as default};
@@ -0,0 +1,57 @@
1
+ import{j as a}from"./liveblocks-D41N0IlG.js";import{a as p}from"./sentry-Bhr8KU--.js";import{j as _,u as R,h as k,g as h,k as B,l as F,n as X,o as C}from"./core-B86WF2Ww.js";import{bn as xe,eO as j,gG as le,KX as Ee,Jk as Ae,jA as de,lT as we,gI as je,KZ as ve,KY as ke,Nm as Pe,xj as De,BO as Ue,MX as Me,N4 as _e,c1 as ue,cG as Te,cH as Re,J1 as Be,Nn as Fe,J2 as Ve,vL as Ne,No as Oe,E2 as Le,Bu as $e,Bl as pe,Bi as Je,vP as ge,Bo as me,Br as fe,Bx as W,sm as ee,vO as ze,jc as Q,jf as he,Np as Ge,kg as Ke,w2 as Ze,JS as He,JT as qe,ja as Xe,Nq as Qe,jd as Ye,qM as We,Nr as en,Ns as nn,qQ as tn,gi as an,Ja as ae,gp as sn,Jb as on,v$ as cn,Nt as rn,Nu as ln,BL as dn,eS as be,eU as Se,Nv as un,fw as pn,Jl as gn,v_ as se,fB as oe,fA as mn,vZ as fn,fz as hn,fy as bn,Nw as Sn,eX as ye,Nx as yn,Ny as In,w5 as Cn,vY as ie,Nz as xn,fd as En,vV as An,bU as wn,c0 as jn,b$ as vn,bV as kn,bZ as Pn,bY as Dn,bX as Un,b_ as Mn,bW as _n}from"./zeni-epic-state-BLvcbIPk.js";import{y as ne,S as U,z as x,ac as Ie,bC as Tn,c as J,e as Rn,k as V,B as te,bD as Bn,bE as Fn,an as Vn,f as Ce,bF as Nn,bG as On,bH as Ln,a6 as $n,R as Jn,bI as zn,n as Gn,bJ as Kn}from"./index-B7GRpDkc.js";import{n as M}from"./mui-DZd7XaFW.js";import{M as P}from"./MobileAppDrawer-Cgt4TE38.js";import{a as L,g as $,m as Zn}from"./accountMappingHelper-yvOeY36k.js";import{t as Hn,A as qn}from"./AddressScreen--B-G7QO-.js";import T from"./NotFoundScreen-gdNFrdCn.js";import{g as Xn}from"./analyticsHelper-ByPPdEaS.js";import{B as Qn}from"./BusinessVerificationPageScreen-C5SO6Pvr.js";import{C as Yn}from"./CompanyPassportScreen-ImtgWbLz.js";import{q as ce}from"./QBOConnectionScreen-BdH_dfqU.js";import{B as Wn}from"./BillPayApprovalRoutes-BTct1_HT.js";import{R as et}from"./ReimbursementApprovalRoutes-TgmzGWOx.js";import"./recharts-BHLF4b4u.js";import"./analytics-CFOBCmx3.js";import"./plaid-CZm5yErz.js";import"./dnd-DrUSXn8k.js";import"./stripe-DMRn4zHo.js";import"./lottie-BHETr187.js";import"./lexical-COpm991f.js";import"./pdf-BdWka_4Q.js";import"./utils-Mvk27uIx.js";import"./routePaths-PD5Rqyfc.js";import"./empty-CRbjQ82E.js";import"./pdf-lib-DmLnrwkt.js";import"./index-CcACvObI.js";import"./url-CgMNpbBl.js";import"./index-BHE-07hU.js";import"./decodeURIComponentSafe-C-DNZuqb.js";import"./ReimbursementApprovalRuleDetailScreen-DC3PDULr.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]="38a617bb-0bfa-43f4-921a-e6b6f1600b39",e._sentryDebugIdIdentifier="sentry-dbid-38a617bb-0bfa-43f4-921a-e6b6f1600b39")}catch{}})();const nt=M.div`
2
+ display: flex;
3
+ height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${e=>e.theme.colors.grey4};
9
+ `,tt=B(function(e,s){return{accountMappingView:s.accountMappingView,isFiling1099FeatureEnabled:s.isFiling1099FeatureEnabled,isAccruedExpensesFeatureEnabled:s.isAccruedExpensesFeatureEnabled,isAccountingClassesEnabled:de(e),isAccountingClassesUpdateInProgress:e.companyViewState.passportView?.accountingClassesUpdateStatus?.fetchState==="In-Progress",isAccountingProjectsEnabled:Ae(e),meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true"}},function(e,s){const{navigate:o,location:c,isFiling1099FeatureEnabled:i}=s;return{onAccountMappingChange:n=>{const{uncategorizedAccountSection:t,billsAccountSection:r,reimbursementsAccountSection:u,vendorsAccountSection:d,filing1099Section:g}=n,{incomeAccount:f,expenseAccount:m}=t,{billPayAccount:l}=r,{reimbursementsAccount:E}=u,{prepaidExpensesAccount:y,fixedAssetsAccount:w,accruedExpensesAccount:S}=d,{bankAccount:I,expenseCategory1099:N}=g,A=L(s.accountMappingView.incomeAccountList,f.selectedOption),z=L(s.accountMappingView.expenseAccountList,m.selectedOption),G=L(s.accountMappingView.billPayAccountList,l.selectedOption),K=L(s.accountMappingView.reimbursementsAccountList,E.selectedOption),O=$(s.accountMappingView.prepaidExpensesAccountList,y.selectedOptions),b=$(s.accountMappingView.fixedAssetsAccountList,w.selectedOptions),D=$(s.accountMappingView.accruedExpensesAccountList,S.selectedOptions),Z=$(s.accountMappingView.bankAccounts1099FilingAccountList,I.selectedOptions),H=Zn(s.accountMappingView.expenseAccounts1099FilingAccountList,N),q={selectedIncomeAccountId:A?.accountId,selectedExpenseAccountId:z?.accountId,selectedBillPayAccountId:G?.accountId,selectedReimbursementsAccountId:K?.accountId,selectedPrepaidExpensesAccountIds:O.map(v=>v.accountId),selectedFixedAssetsAccountIds:b.map(v=>v.accountId),selectedAccruedExpensesAccountIds:D.map(v=>v.accountId),selectedBankAccounts1099FilingAccountIds:Z.map(v=>v.accountId),selectedExpenseAccounts1099FilingAccountIds:H};e(ke({data:q}))},onBackClick:()=>{Ie(c)===!1?(o("../../dashboard"),e(ve())):e(le())},onSaveClick:()=>{e(je()),i&&J.track(Rn.Event.vendor1099AccountingSettingsSave)},onAccountingClassesToggle:n=>{e(we(s.currentTenant.companyId,n))}}})(Tn),at=()=>{const e=_(),s=R(),o=k(),{useFeatureGate:c}=ne(),{isFeatureEnabled:i}=c(U.isFiling1099FeatureEnabled),{isFeatureEnabled:n}=c(U.isScheduledJEAccruedExpensesFeatureEnabled),t=x.getSignedInUser(),r=xe(t),u=h(y=>j(y)),[d,g]=p.useState(!1),[f,m]=p.useState(!1);p.useEffect(()=>{d===!1&&(o(le()),g(!0))},[d]);const l=h(y=>Ee(y)),E=y=>{m(y)};return a.jsxs(nt,{children:[a.jsx(P,{isAppContentDrawerOpen:f,handleDrawerToggle:E}),a.jsx(tt,{currentTenant:u,navigate:e,accountMappingView:l,isFiling1099FeatureEnabled:i&&r,isAccruedExpensesFeatureEnabled:n,location:s,isSettings:Ie(s),onClickMenuIcon:()=>E(!0)})]})},st=M.div`
10
+ display: flex;
11
+ height: 100%;
12
+ width: 100%;
13
+ flex: 1 1 auto;
14
+ flex-direction: column;
15
+ align-items: center;
16
+ background-color: ${e=>e.theme.colors.grey4};
17
+ `,ot=B(function(e,s){const o=j(e),c=Me(e),i=_e(e),n=s.roleMap.bill_pay_admin;return{isDisabled:(ue(o?.userRole??[])||n)&&"readonly",billpayApprovalView:c,remiApproverView:i,analytics:J}},function(e,s){const{navigate:o,currentTenant:c}=s;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Bn),it=()=>{const e=_(),s=R(),o=k(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(S=>j(S)),f=h(S=>S.billPaySetupApproverViewState.fetchState),m=h(S=>S.remiSetupApproverViewState.fetchState),l=h(S=>Pe(S)),E=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const y=V();p.useEffect(()=>{u||f!=="Not-Started"||(d(!0),o(De(!0)))},[u,f,o]),p.useEffect(()=>{t||m!=="Not-Started"||(r(!0),o(Ue(!0)))},[t,m,o]);const w=S=>{n(S)};return y?.loggedInUserRoleMap!=null?a.jsxs(st,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:w}),a.jsx(ot,{navigate:e,location:s,companyId:E,currentTenant:g,roleMap:y.loggedInUserRoleMap,onClickMenuIcon:()=>{w(!0)}})]}):a.jsx(te,{fetchState:l.fetchState})},ct=M.div`
18
+ display: flex;
19
+ height: 100%;
20
+ width: 100%;
21
+ flex: 1 1 auto;
22
+ flex-direction: column;
23
+ align-items: center;
24
+ background-color: ${e=>e.theme.colors.grey4};
25
+ `,rt=B(function(e,s){const{companyId:o,isZeniAccountEnabled:c,isChargeCardEnabled:i,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:r}=s,u=j(e);return{bankSetupView:Oe(e,o,n,t,c,i,r),connectedAccountProvider:u.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:J}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t,r)=>{e(ee(t,n,r))},onEstablishConnectionClick:(n,t,r)=>{e(W(n,i,t,r))},onUpdatePaymentAccountStatus:(n,t,r,u,d)=>{e(fe(n,t,d,u,r))},onUpdatePaymentAccountLoginStatus:(n,t,r,u)=>{e(me(!1,n,u,r,t))},onEstablishConnectionSuccess:(n,t)=>{e(ge(t,n))},onUpdateAccountClick:(n,t,r,u,d)=>{e(d==="paymentAccount"?pe(n,t,r,u):Je(u,n,t))},onUpdatePrimaryFundingAccount:(n,t,r)=>{e($e(i,t,n,r))},onRemoveConnection:n=>{e(Le(n))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}})(Fn),lt=()=>{const e=_(),s=R(),o=k(),{tenantEmailDomain:c}=F(),i=V(),[n,t]=p.useState(!1),[r,u]=p.useState(!1),d=h(I=>j(I)),g=h(I=>I.settingsViewState.bankConnection.fetchState),f=Te(d,i?.loggedInUserRoleMap),m=Re(d,i?.loggedInUserRoleMap),l=Be(d,i?.loggedInUserRoleMap),E=Fe(d,i?.loggedInUserRoleMap),y=Ve(d,i?.loggedInUserRoleMap),w=d.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");p.useEffect(()=>{r||g==="Completed"||(u(!0),o(Ne(!1)))},[r,o,g]);const S=I=>{t(I)};return f||l||m||y?a.jsxs(ct,{children:[a.jsx(P,{isAppContentDrawerOpen:n,handleDrawerToggle:S}),a.jsx(rt,{navigate:e,location:s,companyId:w,currentTenant:d,roleMap:i.loggedInUserRoleMap,isBillPayEnabled:f,isRemiEnabled:m,isZeniAccountEnabled:l,isChargeCardEnabled:y,isTreasuryEnabled:E,onClickMenuIcon:()=>{S(!0)}})]}):a.jsx(T,{})},dt=M.div`
26
+ display: flex;
27
+ height: 100%;
28
+ width: 100%;
29
+ flex: 1 1 auto;
30
+ flex-direction: column;
31
+ align-items: center;
32
+ background-color: ${e=>e.theme.colors.grey4};
33
+ `,ut=B(function(e,s){const{companyId:o}=s,c=j(e),i=s.roleMap.bill_pay_admin,n=Ge(e,o),{uiState:t}=n,r=(ue(c?.userRole??[])||i)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:Ce.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:r,analytics:J}},function(e,s){const{navigate:o,currentTenant:c,companyId:i}=s;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(W(n,i,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ge("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,r)=>{e(fe(n,t,"billing","billing_setup",r))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(me(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(pe(n,t,"billing","billing_setup"))},onBackClick:()=>{c?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&c.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(he(n))},handleConfirmCardSetupIntent:n=>{e(Ye(n))},updateCardPaymentModalState:n=>{e(Qe({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,r)=>{e(Xe(n,t,r))},handleFetchPaymentSources:()=>{e(Q())},resetCardPaymentViewState:()=>{e(qe())},handleResetCardPaymentErrorStatuses:()=>{e(He())},onBillingAddressSave:n=>{e(Ze(n))},onAddressEditHandler:n=>{if(n!=null){const t=Hn(n);e(Ke({addressType:"subscription_billing_address",addressToCreate:t}))}}}})(Nn),pt=()=>{const e=_(),s=R(),o=k(),{tenantEmailDomain:c}=F(),[i,n]=p.useState(!1),[t,r]=p.useState(!1),[u,d]=p.useState(!1),g=h(I=>j(I)),f=h(I=>I.cardPaymentViewState),m=h(I=>I.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState),l=Vn(f.addCardPaymentSourceStatus.fetchState),E=f.addCardPaymentSourceStatus.fetchState,y=g.companyId??x.getSignedInUserTenant(c)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const w=V();p.useEffect(()=>{y!=null&&o(ze(y,!1))},[y,o]),p.useEffect(()=>{t||(r(!0),o(Q()))},[t,o]),p.useEffect(()=>{u||(he(["card"]),d(!0))},[u]),p.useEffect(()=>{l==="In-Progress"&&E==="Completed"&&o(Q())},[l,E]);const S=I=>{n(I)};return w?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:S}),a.jsx(ut,{navigate:e,location:s,companyId:y,currentTenant:g,roleMap:w.loggedInUserRoleMap,onClickMenuIcon:()=>{S(!0)},googleAPIKey:Ce.googleMapsAPIKey})]}):a.jsx(te,{fetchState:m})},Y="external_integrations",gt=B(function(e){const s=nn(e,Y);return{meetingUrl:"https://meetings.hubspot.com/niharn/zeni-onboarding-overview?embed=true",notifyMeRegisteredSlugs:new Set(s.map(o=>o.additionalInfo).filter(o=>o!=null))}},function(e,s){const{navigate:o,integrationsView:c,signedInUserEmail:i,tenantEmailDomain:n,tenantId:t}=s;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{ce.init("/connection/auth",n),ce.handleClick()},onRefreshClick:()=>{c.integrations.refreshQBO.fetchState!=="In-Progress"&&e(cn())},onSaveChargeBeeCredentials:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="chargebee")?.connectionId;d!=null&&e(sn(t,d,ae("revenue"),on("chargebee"),{api_key:r,site:u}))},onConnectHubSpot:(r,u)=>{const d=c.externalConnections?.revenue?.find(g=>g.connectionName==="hubspot")?.connectionId;if(d!=null){const g=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:r,client_secret:u,connection_id:d,redirect_uri:g,tenant_id:t}));const f="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(r)}&scope=${encodeURIComponent(f)}&redirect_uri=${encodeURIComponent(g)}`}},onDisconnect:(r,u)=>{e(an(t,r,ae(u)))},onNotifyMe:r=>{e(tn(Y,r,i))}}})(On),mt=()=>{const e=_(),s=k(),{tenantEmailDomain:o}=F(),[c,i]=p.useState(!1),n=h(l=>l.tenantState.fetchState),t=h(l=>j(l)),r=t.companyId??x.getSignedInUserTenant(o)?.companyId,u=x.getSignedInUser(),d=V(),g=d?.loggedInUserRole.includes("admin")===!0;if(u==null)throw Error("Can't access Integrations page without signing in...");p.useEffect(()=>{s(We(Y))},[s]);const f=l=>{i(l)},m=h(l=>en(l,r));return d?.loggedInUserRoleMap!=null?a.jsxs(ft,{children:[a.jsx(P,{isAppContentDrawerOpen:c,handleDrawerToggle:f}),a.jsx(gt,{navigate:e,onClickMenuIcon:()=>{f(!0)},isAdmin:g,integrationsView:m,signedInUserEmail:u.userEmail??"",tenantEmailDomain:t.tenantEmailDomain??o??"",tenantId:t.tenantId,saveChargeBeeState:m.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:m.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:m.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:m.externalConnections?.saveOAuthConnectionError?.message,deleteConnectionState:m.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:m.externalConnections?.deleteConnectionError?.message,isLoading:n==="In-Progress"})]}):a.jsx(te,{fetchState:n})},ft=M.div`
34
+ display: flex;
35
+ height: 100%;
36
+ width: 100%;
37
+ flex: 1 1 auto;
38
+ flex-direction: column;
39
+ align-items: center;
40
+ background-color: ${e=>e.theme.colors.grey4};
41
+ `,ht=M.div`
42
+ display: flex;
43
+ height: 100%;
44
+ width: 100%;
45
+ flex: 1 1 auto;
46
+ flex-direction: column;
47
+ align-items: center;
48
+ background-color: ${e=>e.theme.colors.grey4};
49
+ `,bt=()=>{const e=k(),{tenantEmailDomain:s}=F(),[o,c]=p.useState(!1),i=h(l=>j(l)).companyId??x.getSignedInUserTenant(s)?.companyId,n=x.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=h(l=>rn(l,n.userId)),r=h(l=>ln(l,i,"bill_pay","user_reimbursement_account")),{plaidConnectionDetails:u}=r,d=l=>{c(l)},g=p.useCallback(l=>{e(ee("user_reimbursement_account",l))},[]),f=p.useCallback(l=>{e(W(l,i,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},[]);p.useEffect(()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(dn(n.userId))},[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(ht,{children:[a.jsx(P,{isAppContentDrawerOpen:o,handleDrawerToggle:d}),a.jsx(Ln,{plaidConnectionDetails:u,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:g,onEstablishConnectionClick:f,onClickMenuIcon:()=>{d(!0)}})]})},St=M.div`
50
+ display: flex;
51
+ height: 100%;
52
+ width: 100%;
53
+ flex: 1 1 auto;
54
+ flex-direction: column;
55
+ align-items: center;
56
+ background-color: ${e=>e.theme.colors.grey4};
57
+ `,re=({appContent:e})=>{const s=k(),o=_(),c=R(),[i,n]=p.useState(!1),t=h(b=>j(b)),{tenantEmailDomain:r}=t,u=t.companyId??x.getSignedInUserTenant(r)?.companyId;if(x.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:d}=ne(),{isFeatureEnabled:g}=d(U.isDepositAccountsFeatureEnabled),{isFeatureEnabled:f}=d(U.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=d(U.isDebitCardFeatureEnabled),{isFeatureEnabled:l}=d(U.isTreasuryEnabled),E=h(b=>de(b)),y=be(t),w=Se(m,t),S=!w&&E,I=$n(t,f,m),{areTenantIdsInSync:N}=Jn();p.useEffect(()=>{N&&s(un(u,S))},[u,s,S,N]);const A=h(b=>pn(b,S)),z=A.fetchState==="Not-Started"||A.fetchState==="In-Progress"||u==null,G=gn(t),K=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,O=b=>{n(b)};return a.jsxs(St,{children:[a.jsx(P,{isAppContentDrawerOpen:i,handleDrawerToggle:O}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(zn,{myProfileView:A,isAccountingClassesEnabled:E,isReimbursementDisabled:K===!1,isZeniAccountsDisabled:g===!1,isChargeCardDisabled:I===!1,isTreasuryDisabled:l===!1,isLiteRoleDisabled:G===!1,onClickMenuIcon:()=>{O(!0)},isLoading:z,isBankingOnlyTenant:w,isCardsOnlyTenant:y,onAddressClick:b=>{const D=function(H,q){let v=`/${H}/settings/my_profile`;return v=v.concat(`/new/${q}`),v}(r,b),Z=Gn(c.state?.pathnameStackToGoBack,c.pathname);o(D,{state:{pathnameStackToGoBack:Z}})},onGetOtp:b=>{const D={...A.myProfileLocalData,phone:b};s(se({localData:D})),s(bn(b,"MyProfile"))},onResendOtp:b=>{s(hn(b,"MyProfile"))},onCancelClick:()=>{s(fn())},onSaveClick:()=>{s(oe("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},onVerifyOtp:(b,D)=>{s(mn(b,D,"MyProfile"))},onVerifyOtpSuccess:b=>{b!=null&&x.saveZeniOtpToken(b),s(oe("MyProfile",A.myProfileLocalData.phone,A.myProfileLocalData.otpChallenge,A.myProfileLocalData.dateOfBirth,A.addressData?.addressToCreate))},updateMyProfileLocalData:b=>{s(se({localData:b}))}})]})};function yt(){const e=k(),s=h(l=>j(l)).companyId,o=h(l=>Sn(l)),c=h(l=>ye(l)),i=x.getSignedInUser(),[n,t]=p.useState(!1),r=p.useCallback(l=>{t(l)},[]),u=p.useCallback(l=>{e(yn(l))},[]),d=p.useCallback(()=>{i?.userEmail!=null&&e(In({loggedInUserEmail:i.userEmail}))},[i?.userEmail]),g=p.useCallback(()=>{e(Cn())},[]);if(i==null)throw Error("Can't access Notification Settings page without signing in...");const f=p.useCallback(()=>{const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(l,s))},[s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled]),m=p.useCallback(()=>{e(xn())},[]);return p.useEffect(()=>{if(c.fetchState==="Completed"&&o.fetchState!=="In-Progress"&&o.fetchState!=="Completed"){const l=c.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(l,s))}},[o.fetchState,s,c.notificationSettings.monthEndInsightsNotificationSettings.enabled,c.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(P,{isAppContentDrawerOpen:n,handleDrawerToggle:r}),a.jsx(Kn,{notificationSettingsView:o,onFormDataChange:u,onCancel:d,onSave:g,onClickMenuIcon:()=>{r(!0)},signedInUser:i,onRefresh:f,resetUpdateStatus:m})]})}function ea(e){const[s,o]=p.useState(!1),c=h(l=>ye(l)),i=h(l=>j(l)),n=V(),t=x.getSignedInUser(),r=k(),{useFeatureGate:u}=ne(),{isFeatureEnabled:d}=u(U.isDebitCardFeatureEnabled),g=t?.userEmail==null||c.fetchState!=="Completed"||En(c.notificationSettings,t.userEmail,d,i);p.useEffect(()=>{c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&s===!1&&(o(!0),r(An()))},[c.fetchState,s]);const f=Se(d,i),m=be(i);return c.fetchState!=="In-Progress"&&c.fetchState!=="Not-Started"||g!==!0?wn(i)?a.jsxs(X,{children:[jn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"accounting/*",element:a.jsx(at,{})}),vn(n?.loggedInUserRole??[],d,i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"approval_rules/*",element:a.jsx(It,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),kn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"my_bank_connections",element:a.jsx(bt,{})}),Pn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"bank_connections",element:a.jsx(lt,{})}),Dn(i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"business_verification",element:a.jsx(Qn,{productType:f?"zeni_accounts":m?"charge_cards":Xn(i,n?.loggedInUserRoleMap)})}),Un(n?.loggedInUserRole??[],i,n?.loggedInUserRoleMap)&&a.jsx(C,{path:"company_details",element:a.jsx(Yn,{})}),Mn(n?.loggedInUserRole??[],i)&&a.jsx(C,{path:"billing",element:a.jsx(pt,{})}),_n(n?.loggedInUserRole??[],d,i)&&a.jsx(C,{path:"integrations",element:a.jsx(mt,{})}),a.jsx(C,{path:"my_profile/new/:addressType",element:a.jsx(re,{appContent:a.jsx(qn,{isSubPage:!1})})}),a.jsx(C,{path:"my_profile",element:a.jsx(re,{})}),g&&a.jsx(C,{path:"notifications",element:a.jsx(yt,{})}),a.jsx(C,{path:"*",element:a.jsx(T,{})})]}):a.jsx(X,{children:a.jsx(C,{path:"*",element:a.jsx(T,{})})}):null}function It(e){return a.jsxs(X,{children:[a.jsx(C,{path:"/",element:a.jsx(it,{})}),a.jsx(C,{path:"bills/approval-rules/*",element:a.jsx(Wn,{})}),a.jsx(C,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(et,{}):a.jsx(T,{})}),a.jsx(C,{path:"*",element:a.jsx(T,{})})]})}export{ea as default};