@zeniai/web-app-ui 5.1.99-qa → 5.2.0-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.
- package/dist/assets/AddressRoutes-oOQJC3Yo.js +1 -0
- package/dist/assets/{AddressScreen-CBnElFxM.js → AddressScreen-B2g0EGq7.js} +2 -2
- package/dist/assets/AiCfoScreen--Z8a2CnQ.js +22 -0
- package/dist/assets/{BillPayApprovalRoutes-CB55AV0C.js → BillPayApprovalRoutes-DI5OQIWZ.js} +1 -1
- package/dist/assets/{BillPayRoutes-UVA-u63A.js → BillPayRoutes-CXhgkFrh.js} +17 -17
- package/dist/assets/{BusinessVerificationPageScreen-DsowR4fB.js → BusinessVerificationPageScreen-CHlhD1bn.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-BaEolMVN.js → CardsAiCfoScreen-BfeQo7N4.js} +3 -3
- package/dist/assets/{ChargeCardRoutes-D3n7KJn0.js → ChargeCardRoutes-DYWdITos.js} +10 -10
- package/dist/assets/{CompanyPassportScreen-wSnqdrZm.js → CompanyPassportScreen-B0IdpqTW.js} +1 -1
- package/dist/assets/ConnectionAuthScreen-DLk20sBX.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-D31AAVKC.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-DT_Ih6lH.js → CustomerOnboardingRoutes-D44ZNBEA.js} +5 -5
- package/dist/assets/{DashboardRoutes-B4SpN_q5.js → DashboardRoutes-684orl8N.js} +4 -4
- package/dist/assets/{DefaultTenantHome-C-Q9oQmt.js → DefaultTenantHome-3UFjXhiS.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-BtYZfhuG.js +18 -0
- package/dist/assets/DrawerScreen-CSMp2A9F.js +1 -0
- package/dist/assets/EntityDetailRoutes-CRNQJyjq.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-nIGBHuEd.js → ExpenseAutomationRoutes-CB1lyxjv.js} +3 -3
- package/dist/assets/FeaturePreviewScreen-D3z2gcpi.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-gDziUA5z.js +1 -0
- package/dist/assets/{MagicLinkRoutes-BTau9CfB.js → MagicLinkRoutes-BMPUgnVn.js} +5 -5
- package/dist/assets/MagicLinkSignInScreen-_ZejKaCn.js +12 -0
- package/dist/assets/MobileAppDrawer-8wrd6B-7.js +1 -0
- package/dist/assets/NotFoundScreen-Bge2JGwW.js +1 -0
- package/dist/assets/{NotificationRoutes-CkKMsCoc.js → NotificationRoutes--6GU4tbu.js} +1 -1
- package/dist/assets/OAuthConsentScreen-B59fm6Kj.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-CxdNyFxC.js +1 -0
- package/dist/assets/PeopleRoutes-CmOZGcsk.js +22 -0
- package/dist/assets/PerformanceRoutes-Bu3nN2tK.js +1 -0
- package/dist/assets/{Preview-Dh_7Y2V1.js → Preview-CuOg-A8H.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-BOAmyhRI.js → QBOConnectionScreen-8ZlWNPA9.js} +1 -1
- package/dist/assets/ReimbursementApprovalRoutes-CTijKmMu.js +1 -0
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-B0OjRx8o.js → ReimbursementApprovalRuleDetailScreen-DIOgjJyZ.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CnfaWQKq.js → ReimbursementRoutes-DRMiWLSm.js} +8 -8
- package/dist/assets/{ReportsRoutes-ZKjtrrXu.js → ReportsRoutes-DnRmWO_g.js} +1 -1
- package/dist/assets/RewardsRoutes-b9NXQyW4.js +1 -0
- package/dist/assets/ScreenRoutes-CkNF9DLW.js +2 -0
- package/dist/assets/{SettingsRoutes-0RQL-spt.js → SettingsRoutes-D5DPlYhg.js} +8 -8
- package/dist/assets/{SetupPagesScreen-lXVOcLJ8.js → SetupPagesScreen-BIZfrXFn.js} +5 -5
- package/dist/assets/SignInScreen-CHZM3Frk.js +1 -0
- package/dist/assets/SignOutScreen-Cx6F3vmB.js +9 -0
- package/dist/assets/TaskListScreen-BnrFj0CA.js +9 -0
- package/dist/assets/TaskRoutes-BAC-3C1s.js +9 -0
- package/dist/assets/{TransactionDetailRoutes-DFhCPCQa.js → TransactionDetailRoutes-C9ZhFLf5.js} +1 -1
- package/dist/assets/TransactionDetailScreen-BsgXSNNV.js +5 -0
- package/dist/assets/{TransactionListRoutes-kn0wMJaj.js → TransactionListRoutes-BrzIlvyk.js} +1 -1
- package/dist/assets/{TreasuryRoutes-h3ROpRx5.js → TreasuryRoutes-Dyw-ZAPa.js} +6 -6
- package/dist/assets/{VendorsRoutes-x1VmRs4J.js → VendorsRoutes-BWBUUjTt.js} +1 -1
- package/dist/assets/WiseConfirmationScreen-CcZrE5_R.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-BOVvauFK.js → ZeniAccountRoutes-3OROP5vK.js} +12 -12
- package/dist/assets/ZeniAccountStatementScreen-B3_VR-tZ.js +9 -0
- package/dist/assets/{accountMappingHelper-DNCKLg7K.js → accountMappingHelper-SWFIL59M.js} +1 -1
- package/dist/assets/{analytics-1WMvk5Rb.js → analytics-DhULAPA0.js} +1 -1
- package/dist/assets/{analyticsHelper-C8vUB4gm.js → analyticsHelper-CixncN58.js} +1 -1
- package/dist/assets/{core-0WK0Zss8.js → core-CnGMK-sC.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DYdex7Fp.js → decodeURIComponentSafe-uWfgYCNH.js} +1 -1
- package/dist/assets/{dnd-Dwsdp5ty.js → dnd-BqCGp7Ed.js} +1 -1
- package/dist/assets/{empty-o2YkWI97.js → empty-AGnm4bIq.js} +1 -1
- package/dist/assets/{empty-B_vMxB0z.js → empty-CZCaQm4J.js} +1 -1
- package/dist/assets/{emptyVideoElement-Cmrnn243.js → emptyVideoElement-Cqm9YLjS.js} +1 -1
- package/dist/assets/epic-CTjjWhpg.js +2 -0
- package/dist/assets/getLocaleForTenant-C5b46Qyn.js +1 -0
- package/dist/assets/{index-Dy73EgcO.js → index-BWvweS0E.js} +14303 -14311
- package/dist/assets/{index-DptRs9ko.js → index-BuTuhkuP.js} +2 -2
- package/dist/assets/{index-CmH-4r8j.js → index-CUaM5Y1I.js} +1 -1
- package/dist/assets/{index-C3zdsXK_.js → index-D88Jaev3.js} +1 -1
- package/dist/assets/{index-B4Kzctdg.js → index-S4IFBgph.js} +1 -1
- package/dist/assets/{index-CcesBH_n.js → index-XkyLBJ61.js} +1 -1
- package/dist/assets/{index-CqKRE3AP.js → index-b64yysEr.js} +1 -1
- package/dist/assets/{index-CFATCouK.js → index-uYv86E98.js} +1 -1
- package/dist/assets/{lexical-B9WqgH9H.js → lexical-DlqthnSG.js} +1 -1
- package/dist/assets/{liveblocks-tpE-grBU.js → liveblocks-s55OcG-D.js} +1 -1
- package/dist/assets/{lottie-dQMhiLBj.js → lottie-DMKCl4ti.js} +1 -1
- package/dist/assets/{mui-NHWzIwJg.js → mui-CggbPNN2.js} +2 -2
- package/dist/assets/{pathToGoBack-BmJj5cme.js → pathToGoBack-DpxbYxCk.js} +1 -1
- package/dist/assets/{pdf-C4fX1mA3.js → pdf-BD0zxvar.js} +3 -3
- package/dist/assets/{pdf-lib-CxgB1_73.js → pdf-lib-BzRjr6sI.js} +1 -1
- package/dist/assets/{plaid-59NT4aqa.js → plaid-d_bwfWrk.js} +1 -1
- package/dist/assets/{pusher-CY-7JGv2.js → pusher-Cfk4rd_d.js} +1 -1
- package/dist/assets/{react-D8u5JcH6.js → react-BKWnIOym.js} +1 -1
- package/dist/assets/{react-C2Lbn6h8.js → react-BdjYstH9.js} +1 -1
- package/dist/assets/{react-DhqMtE92.js → react-C8X5xuWi.js} +1 -1
- package/dist/assets/{react-SLQy3m4e.js → react-CSLZes-L.js} +1 -1
- package/dist/assets/{react-OZ0ubAW7.js → react-D5Ky_KQN.js} +1 -1
- package/dist/assets/{react-C3I7c7kB.js → react-onoaKP_J.js} +1 -1
- package/dist/assets/{recharts-CUzwcISX.js → recharts-CmLekiCG.js} +1 -1
- package/dist/assets/routePaths-D87yNyzK.js +1 -0
- package/dist/assets/{sentry-D58SEIt0.js → sentry-qwy54zvC.js} +1 -1
- package/dist/assets/{url-BRZfE6CD.js → url-BKJ8Udjp.js} +1 -1
- package/dist/assets/{url-wdUk7Rbg.js → url-CF9Fx3Jk.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-COKjoYH2.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-c_VzJZE9.js +1 -0
- package/dist/assets/useCashManagementBanner-OkHozYlV.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-DGhBtw5K.js → useChargeCardPusherEvents-C2sCX5OQ.js} +1 -1
- package/dist/assets/{useDeviceId-SayLljl1.js → useDeviceId-DPOieVuC.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-CMBVShl-.js +1 -0
- package/dist/assets/{useInitialThreadRequest-B7WOjZ27.js → useInitialThreadRequest-EuACK97s.js} +1 -1
- package/dist/assets/{utils-CHGPa257.js → utils-5Fz6z6US.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-BsJ58rSa.js → withTransactionSidePanel-BJ1dqQdE.js} +2 -2
- package/dist/assets/{zeni-epic-state-Bx_bp9Xr.js → zeni-epic-state-NrbJoBOX.js} +4 -4
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-ChIEG7ZZ.js +0 -1
- package/dist/assets/AiCfoScreen-DXLxFBnQ.js +0 -22
- package/dist/assets/ConnectionAuthScreen-RH-ZQnmS.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-Bro8vP9Q.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DmspT9Qv.js +0 -18
- package/dist/assets/DrawerScreen-CTBdvd2J.js +0 -1
- package/dist/assets/EntityDetailRoutes-DPOfKd1l.js +0 -1
- package/dist/assets/FeaturePreviewScreen-CS0na0Uv.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-CDdCifUI.js +0 -1
- package/dist/assets/MagicLinkSignInScreen-BQxK3HJS.js +0 -12
- package/dist/assets/MobileAppDrawer-By5kqJZy.js +0 -1
- package/dist/assets/NotFoundScreen-BUpSeNgf.js +0 -1
- package/dist/assets/OAuthConsentScreen-BzkRmkhL.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-DB98rpg8.js +0 -1
- package/dist/assets/PeopleRoutes-BPQhjQKR.js +0 -22
- package/dist/assets/PerformanceRoutes-Cu8GwbPn.js +0 -1
- package/dist/assets/ReferralListScreen-Bg4MIsqb.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-CLqW8bjU.js +0 -1
- package/dist/assets/RewardsRoutes-Dmsl5Hhz.js +0 -1
- package/dist/assets/ScreenRoutes-DtVjvGeB.js +0 -2
- package/dist/assets/SignInScreen-Caakz2DY.js +0 -1
- package/dist/assets/SignOutScreen-CtzEkEl4.js +0 -9
- package/dist/assets/TaskListScreen-BtTYiD21.js +0 -9
- package/dist/assets/TaskRoutes-X8P3xHwH.js +0 -9
- package/dist/assets/TransactionDetailScreen-CRWTcneH.js +0 -5
- package/dist/assets/WiseConfirmationScreen-CIMiBhET.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-DZHjDSg5.js +0 -9
- package/dist/assets/epic-BqLIdimv.js +0 -2
- package/dist/assets/getLocaleForTenant-CqQ308VG.js +0 -1
- package/dist/assets/routePaths-YBRbNv0i.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-B3JxpD0o.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Dx1w_2sk.js +0 -1
- package/dist/assets/useCashManagementBanner-MgmXXc9G.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-CG-YyoOP.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as t}from"./sentry-
|
|
1
|
+
import{a as h,b as t}from"./sentry-qwy54zvC.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})}),[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as Ol}from"./liveblocks-
|
|
1
|
+
import{j as Ol}from"./liveblocks-s55OcG-D.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-qwy54zvC.js";import{L as dt,bY as Tc,eV as Ac,LZ as Rc,Mr as kl,c6 as Tl,f_ as Al,f$ as Rl}from"./zeni-epic-state-NrbJoBOX.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-5Fz6z6US.js";import{r as un}from"./empty-AGnm4bIq.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-BzRjr6sI.js";import{r as Gl}from"./index-b64yysEr.js";import{r as zl}from"./index-CUaM5Y1I.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-CnGMK-sC.js";import{u as Kl,z as Pc,L as Wl,O as Jl,R as Xl,j as Ql,d as tf}from"./index-BWvweS0E.js";import"./mui-CggbPNN2.js";import{d as Pe}from"./decodeURIComponentSafe-uWfgYCNH.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]="3a7fee45-b5a7-4e54-89f8-6a85bddcd424",t._sentryDebugIdIdentifier="sentry-dbid-3a7fee45-b5a7-4e54-89f8-6a85bddcd424")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return(function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g})(d)})(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=(function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return(function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")})(this,g),S=b.call(this,(function(w,_,M){return typeof e=="string"?e:e(w,_,M)})(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d})(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map((function(p){return String(p)})),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",(function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",(function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c})(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=(function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1})(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))}),TypeError),i("ERR_INVALID_ARG_VALUE",(function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)}),TypeError),i("ERR_INVALID_RETURN_VALUE",(function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")}),TypeError),i("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map((function(d){return'"'.concat(d,'"')})),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")}),TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter((function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable}))),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach((function(x){m(k,x,j[x])})):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach((function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))}))}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&(function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}})(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=(function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)})(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach((function(x){j[x]=k[x]})),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
|
|
2
2
|
`),I=_(E).split(`
|
|
3
3
|
`),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
|
|
4
4
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-s55OcG-D.js";import _ from"./NotFoundScreen-Bge2JGwW.js";import{a as p}from"./sentry-qwy54zvC.js";import{h as A,g as E,u as C,j as u,N as D,n as V,o as O,p as b}from"./core-CnGMK-sC.js";import{eV as j,Qh as g,Qx as S,FG as k,EP as U,FF as d,Fw as B,QK as N,FI as W}from"./zeni-epic-state-NrbJoBOX.js";import{z as F,a9 as L,bZ as Q,ag as T,bC as K,b_ as z}from"./index-BWvweS0E.js";import"./mui-CggbPNN2.js";import{u as G,R as x}from"./ReimbursementApprovalRuleDetailScreen-DIOgjJyZ.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]="72a75454-a32a-44cb-9cdf-96fbb29ff265",e._sentryDebugIdIdentifier="sentry-dbid-72a75454-a32a-44cb-9cdf-96fbb29ff265")}catch{}})();const y="reimbursement-approval-rule-update",P=V((function(e){return{approvalView:g(e),remiSetupApproverViewUpdateData:S(e).remiSetupApproverViewUpdateData}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(N(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}}))(L(Q)),Z=({isLoading:e})=>{const o=A(),s=E(),n=C(),[t,i]=p.useState(!1),[m,h]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>j(a))),c=u((a=>g(a))),v=u((a=>S(a).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&n(k())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!1)))}),[t,f,e,n]),F.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(h(!0),n(d())),o("./new"))}),[m,c,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(a,$,R)=>{a.endsWith(y)&&R.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(P,{currentTenant:l,location:s,navigate:o,...w})},I="reimbursement-approval-rule-update",q=V((function(e){const o=g(e),s=S(e).remiSetupApproverViewUpdateData,n={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(n[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:n,departmentNamesById:t}}),(function(e,o){const{navigate:s,location:n}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(I)&&e(N(!1))},onBackClick:()=>{T(n)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(W(t,!0))}}}))(L(z)),H=()=>{const e=u((n=>j(n))),{isApprovalRulesV3Enabled:o,isLoading:s}=K(e?.tenantId);return o?r.jsx(J,{isLoading:s}):r.jsx(Z,{isLoading:s})},J=({isLoading:e})=>{const o=A(),s=E(),n=C(),[t,i]=p.useState(!1),[m,h]=p.useState(!1),f=u((a=>a.remiSetupApproverViewState.fetchState)),l=u((a=>j(a))),c=u((a=>g(a)));G();const v=u((a=>S(a).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&n(k())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),n(U(!0,!1,!1,!0)))}),[t,f,e,n]),F.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(h(!0),n(d())),o("./new"))}),[m,c,n]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${I}`]:[],eventCallback:(a,$,R)=>{a.endsWith(I)&&R.onApprovalRulesEventReceived(a)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(q,{currentTenant:l,location:s,navigate:o,isLoading:e,...w})};function oe(){return r.jsxs(O,{children:[r.jsx(b,{path:"/",element:r.jsx(H,{})}),r.jsx(b,{path:"/new",element:r.jsx(x,{})}),r.jsx(b,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(b,{path:"*",element:r.jsx(_,{})})]})}export{oe as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as h}from"./liveblocks-
|
|
1
|
+
import{j as h}from"./liveblocks-s55OcG-D.js";import{a as m}from"./sentry-qwy54zvC.js";import{u as T,j as g,h as _,g as O,i as F,n as k}from"./core-CnGMK-sC.js";import{k$ as q,Qx as w,Qh as x,Fz as V,FL as B,FG as A,FH as E,Qy as j,eV as z,FF as G}from"./zeni-epic-state-NrbJoBOX.js";import{z as P,y as N,B as $,bP as H,ag as L,bC as K,bQ as W}from"./index-BWvweS0E.js";import"./mui-CggbPNN2.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]="c55716a9-89b6-4e19-9251-4670279cee2b",e._sentryDebugIdIdentifier="sentry-dbid-c55716a9-89b6-4e19-9251-4670279cee2b")}catch{}})();function J(){const e=T(),s=m.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));m.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(q({})))}),[p,t,e])}const M=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=L(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const b=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((f=>({type:"user",subType:void 0,userId:f.userId,idType:"user",isImplicitActor:!1}))),R=u.actors.selectedNonUsers.map((f=>{const y=(S=f.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:f.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=I.concat(R);b.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),b},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(H);function X(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),o=P.getSignedInUser(),l=N(),r=g((n=>w(n))),i=g((n=>x(n))),[a,d]=m.useState(!1);if(m.useEffect((()=>{a||(d(!0),s(V(!0)))})),m.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const Y=k((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:x(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=L(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const f=[];return c.forEach((y=>{const S=y.actorKind?.selectedOption,C=y.selectedRole?.selectedOption;let D=[];S==="role"&&C!=null?D=[{type:"attribute",subType:C,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((Q=>({type:"user",subType:void 0,userId:Q.userId,idType:"user",isImplicitActor:!1}))));const U=y.action??"require_approval";f.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})})),f},n=a.amountCriteria,v=a.vendorCriteria,b=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const R=b?.selection.selectedOptions??[];if(R.length>0&&(u.department={type:"department",operator:b?.operator.selectedOption??"is",departmentIds:R}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(G(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(W);function ne(){const e=g((t=>z(t))),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?h.jsx(Z,{}):h.jsx(X,{})}function Z(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=F(),o=P.getSignedInUser(),l=N(),r=g((n=>w(n))),i=g((n=>x(n))),[a,d]=m.useState(!1);if(J(),m.useEffect((()=>{a||(d(!0),s(V(!0)))})),m.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?h.jsx($,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):h.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,J as u};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-tpE-grBU.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as K,l as mt,o as ct,p as C}from"./core-0WK0Zss8.js";import{eX as H,QQ as ue,c6 as pe,EM as Fe,kL as dt,EZ as oe,EY as re,QR as ut,bn as be,gp as Ue,QS as pt,Nd as bt,kA as Le,Ne as Ae,Nf as gt,jv as ht,Q8 as ft,jK as St,EA as It,ue as Rt,jC as yt,Fk as Pe,QT as $e,QU as At,QV as kt,QW as vt,QX as Ct,QY as Et,F4 as ke,jQ as wt,Qh as xt,E_ as Bt,EK as Tt,QZ as jt,EJ as Dt,Q_ as Ft,ES as ve,F8 as Ut,F7 as Lt,F3 as Pt,Q$ as Me,Kj as $t,bq as Mt,EV as _t,FC as Nt,R0 as Ot,R1 as Gt,Fg as Qt,Fd as Ce,PD as zt,EH as Zt,R2 as _e,G2 as Ee,Ga as Ht,R3 as Vt,R4 as Q,R5 as Wt,R6 as Ne,R7 as Kt,R8 as Oe,R9 as Ge,Fs as le,bu as qt,bK as ge,cH as he,fE as Qe,fC as ze,Ra as Jt,fz as Xt,PQ as Yt,Rb as en,Rc as Ze,PU as tn,QC as nn,Rd as an,QP as sn,G7 as we,G6 as on,Re as rn,Rf as ln,Rg as mn,Rh as cn,Ri as dn,Qn as un,FZ as pn,G1 as bn,bs as gn,bJ as hn,cB as fn,cp as Sn,bt as In,M1 as Rn,cR as yn,cU as An,cT as kn,cA as vn}from"./zeni-epic-state-Bx_bp9Xr.js";import{Q as He,m as Ve,C as ee,G as E,z as $,c1 as We,D as te,d as k,aM as xe,o as D,au as X,I as Cn,a as Ke,c2 as En,r as z,a0 as qe,c3 as wn,T as ne,c4 as xn,_ as Bn,E as Tn,B as fe,f as Je,a9 as jn,bp as Dn,a4 as Fn,y as Xe,c5 as Un,i as Ln}from"./index-Dy73EgcO.js";import{n as N,S as Pn}from"./mui-NHWzIwJg.js";import me from"./NotFoundScreen-BUpSeNgf.js";import{S as Be}from"./SetupPagesScreen-lXVOcLJ8.js";import{F as Ye}from"./FeaturePreviewScreen-CS0na0Uv.js";import{a as f}from"./sentry-D58SEIt0.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-Dx1w_2sk.js";import{u as et}from"./useInitialThreadRequest-B7WOjZ27.js";import{D as $n}from"./DrawerScreen-CTBdvd2J.js";import{M as tt}from"./MobileAppDrawer-By5kqJZy.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CLqW8bjU.js";import{FallBackRoute as _n}from"./ScreenRoutes-DtVjvGeB.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.js";import"./analyticsHelper-C8vUB4gm.js";import"./routePaths-YBRbNv0i.js";import"./BusinessVerificationPageScreen-DsowR4fB.js";import"./ReimbursementApprovalRuleDetailScreen-B0OjRx8o.js";import"./getLocaleForTenant-CqQ308VG.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]="d2b20ad4-8dc1-42ac-8df2-2d3889fa8b65",e._sentryDebugIdIdentifier="sentry-dbid-d2b20ad4-8dc1-42ac-8df2-2d3889fa8b65")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=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:U}}}=Ke.getLocalizedStrings(),On=K((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=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:y,isUserAdmin:pe(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:m,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:b.bankAccountCreationState,bankAccounts:b.bankAccounts,analytics:k,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:h,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:Le(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ve(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ve(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Ft({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Dt(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ke(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ke("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({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($e()),e(At());const i=nt(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(k.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("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(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[F,B]=f.useState(!1),v=$.getSignedInUser(),I=w((p=>H(p))),g=w((p=>ue(p,r))),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect((()=>{(A&&!F||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(Fe(!1,b,y,r)))}));const M=w((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(v==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Gn,{windowSize:c,children:[s.jsx(te,{analytics:k,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Qn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:D.sp3,paddingBottom:"15px",paddingLeft:D.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:v?.userId??"",sessionId:v?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,v?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:D.sp5,paddingRight:D.sp3,paddingBottom:D.sp5,paddingLeft:D.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{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=N.div`
|
|
1
|
+
import{j as s}from"./liveblocks-s55OcG-D.js";import{h as W,u as de,g as Z,i as Y,j as w,N as _,n as K,l as mt,o as ct,p as C}from"./core-CnGMK-sC.js";import{eV as H,QL as ue,c6 as pe,EK as De,kK as dt,EX as oe,EW as re,QM as ut,bn as be,gp as Ue,QN as pt,Nb as bt,kz as Le,Nc as Ae,Nd as gt,ju as ht,Q3 as ft,jJ as St,Ey as It,uc as Rt,jB as yt,Fi as Pe,QO as $e,QP as At,QQ as vt,QR as kt,QS as Ct,QT as Et,F2 as ve,jP as wt,Qc as xt,EY as Bt,EI as Tt,QU as jt,EH as Ft,QV as Dt,EQ as ke,F6 as Ut,F5 as Lt,F1 as Pt,QW as Me,Kh as $t,bq as Mt,ET as _t,FA as Nt,QX as Ot,QY as Qt,Fe as Gt,Fb as Ce,Py as zt,EF as Zt,QZ as _e,G0 as Ee,G8 as Ht,Q_ as Vt,Q$ as G,R0 as Wt,R1 as Ne,R2 as Kt,R3 as Oe,R4 as Qe,Fq as le,bu as qt,bK as ge,cH as he,fC as Ge,fA as ze,R5 as Jt,fx as Xt,PL as Yt,R6 as en,R7 as Ze,PP as tn,Qx as nn,R8 as an,QK as sn,G5 as we,G4 as on,R9 as rn,Ra as ln,Rb as mn,Rc as cn,Rd as dn,Qi as un,FX as pn,F$ as bn,bs as gn,bJ as hn,cB as fn,cp as Sn,bt as In,L$ as Rn,cR as yn,cU as An,cT as vn,cA as kn}from"./zeni-epic-state-NrbJoBOX.js";import{Q as He,m as Ve,C as ee,G as E,z as $,b$ as We,x as te,d as v,aM as xe,o as F,au as X,I as Cn,a as Ke,c0 as En,v as z,a0 as qe,c1 as wn,T as ne,c2 as xn,_ as Bn,F as Tn,B as fe,f as Je,a9 as jn,bn as Fn,a4 as Dn,y as Xe,c3 as Un,i as Ln}from"./index-BWvweS0E.js";import{n as N,S as Pn}from"./mui-CggbPNN2.js";import me from"./NotFoundScreen-Bge2JGwW.js";import{S as Be}from"./SetupPagesScreen-BIZfrXFn.js";import{F as Ye}from"./FeaturePreviewScreen-D3z2gcpi.js";import{a as f}from"./sentry-qwy54zvC.js";import{u as Se}from"./useAskAiCfoHostNavButtonProps-c_VzJZE9.js";import{u as et}from"./useInitialThreadRequest-EuACK97s.js";import{D as $n}from"./DrawerScreen-CSMp2A9F.js";import{M as tt}from"./MobileAppDrawer-8wrd6B-7.js";import{R as Mn}from"./ReimbursementApprovalRoutes-CTijKmMu.js";import{FallBackRoute as _n}from"./ScreenRoutes-CkNF9DLW.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.js";import"./analyticsHelper-CixncN58.js";import"./routePaths-D87yNyzK.js";import"./BusinessVerificationPageScreen-CHlhD1bn.js";import"./ReimbursementApprovalRuleDetailScreen-DIOgjJyZ.js";import"./getLocaleForTenant-C5b46Qyn.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]="b3640aa5-02d0-44a9-97e0-afd1843e2475",e._sentryDebugIdIdentifier="sentry-dbid-b3640aa5-02d0-44a9-97e0-afd1843e2475")}catch{}})();const nt=e=>`/${e}/reimbursements`,Nn=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:U}}}=Ke.getLocalizedStrings(),On=K((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),d=$.getSignedInUser(),c=be(d),m=r.plaidConnectionDetails,o=Ue(e.companyState,n),a=e.tenantState.currentTenantId,i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:a??""},l=ue(e,t.reimbursementId),b=pt(e,d?.userId??"");let y=`${d?.firstName} ${d?.lastName}`,h=!0;t.reimbursementId!=null&&(y=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,h=d?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,u=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:y,isUserAdmin:pe(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:Le(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:d,navigate:c,themeState:m}=t,{tenantEmailDomain:o}=r,a=$.getSignedInUser();return{onReceiptsUpload:(i,l,b)=>{i!=null&&e(re(i,l,b,n,a?.userId))},onExistingMerchantChange:(i,l)=>{e(ke(!1,l,n,i,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Pt(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Lt())},clearRemiSaveStatus:()=>{e(Ut("Not-Started",n))},onDuplicateLineClick:(i,l)=>window.open(`/${o}/reimbursement/${i}#L${l}`),onNewMerchantChange:(i,l)=>{e(ke(!1,l,n,void 0,i))},removeFileFromLine:i=>{e(Dt({lineId:i,reimbursementId:n}))},onAmountChanged:(i,l)=>{e(Ft(l,i,n))},updateReimbursementType:(i,l,b)=>{e(jt({reimbursementId:b,lineId:l,reimbursementType:i}))},onHomeCurrencyConversionUpdate:(i,l,b)=>{e(Tt({reimbursementId:b,lineId:l,amountPayload:{amount:i.amount,currency_code:i.currencyCode,currency_symbol:i.currencySymbol}}))},onReimbursementDetailsChanged:i=>{e(Bt({remiDetailLocalData:i,reimbursementId:n}))},saveRemiDetails:i=>{e(ve(i,!1,n))},onUserBankDetailsUpdated:i=>{const{bankAccountSection:l}=i;e(xt({data:l}))},onFetchBankName:i=>{e(wt(i))},submitRemiDetails:()=>{e(ve("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:i=>{e(Et({reimbursementId:i}))},updateInvoiceUploadFetchState:i=>{e(oe({reimbursementId:n,fetchState:i}))},clearTentativeNameForLine:i=>{e(Ct({reimbursementId:n,lineId:i}))},removeDuplicateReimbursementForLine:i=>{e(kt({lineId:i}))},onZeniLogoClick:()=>{m.toggle()},clearAddRemiAutoFields:i=>{e(vt({reimbursementId:n,lineId:i}))},redirectToReimbursementListScreen:()=>{e($e()),e(At());const i=nt(o),l=z(d.state?.pathnameStackToGoBack,d.pathname);c(i,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(v.trackReimbursementDeleteReimbursement(n),e(Pe(n)))},onSaveBankAccount:()=>{a?.userId&&e(yt(a?.userId,n))},onFetchLinkTokenClick:i=>{e(Rt("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(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(En);function Te(){const e=W(),t=de(),n=Z(),{reimbursementId:r}=Y(),d=He(),c=Ve(),[m,o]=f.useState(r==null),[a,i]=f.useState(1),{useFeatureGate:l}=ee(),{isFeatureEnabled:b}=l(E.isLimitedCategoryForReimbursement),{isFeatureEnabled:y}=l(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:h}=l(E.isReimbursementCommentingEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:u}=Se({mobileExploreReferrer:"Reimbursement Details"}),x=Z().pathname,j=x.includes("edit"),A=x.includes("reimbursement/new"),[D,B]=f.useState(!1),k=$.getSignedInUser(),I=w((p=>H(p))),g=w((p=>ue(p,r))),L=et(I?.companyId,{clearParams:g.fetchState==="Completed"}),P=pe(I?.userRole??[]);f.useEffect((()=>{(A&&!D||j&&g.fetchState!="Completed"&&g.fetchState!="In-Progress")&&(B(!0),t(De(!1,b,y,r)))}));const M=w((p=>dt(p.accountState,p.accountListState,"reimbursementAccountList")));if(k==null)throw Error("Can't access address page without signing in...");const R={pathname:`../${r}`,search:n.search};return g.isDeleted===!0||g.billStage=="paid"||g.billStage=="scheduled"||g.fetchState=="Not-Started"||P&&g.billStatus==="rejected"||P===!1&&g.billStage==="pending_approval"&&g.billStatus!=="rejected"?s.jsx(_,{to:R}):g.deleteStatus.fetchState==="In-Progress"||g.fetchState!=="Completed"?s.jsx(We,{isNewReimbursement:r==null}):s.jsxs(Qn,{windowSize:c,children:[s.jsx(te,{analytics:v,onLoad:p=>(V=>{r!=null&&g.deleteStatus.fetchState!=="Completed"&&V.trackReimbursementEditReimbursement(r)})(p)}),m&&c!=="small"?s.jsx(Gn,{}):null,m&&c!=="small"?s.jsx(zn,{children:s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:F.sp3,paddingBottom:"15px",paddingLeft:F.sp5},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})}):null,m&&c==="small"?s.jsxs(Zn,{children:[s.jsx(Hn,{onClick:()=>o(!1),children:s.jsx(Nn,{})}),s.jsx(xe,{showAutofill:m,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:k?.userId??"",sessionId:k?.zeniSessionId??"",tenantId:I?.tenantId??""},onSkipAutofill:()=>o(!1),onInvoiceUpload:p=>{p!=null&&t(re(p,a,!0,r,k?.userId))},updateInvoiceUploadFetchState:p=>{t(oe({reimbursementId:r,fetchState:p}))},allowMultiFiles:m,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:F.sp5,paddingRight:F.sp3,paddingBottom:F.sp5,paddingLeft:F.sp3},dropFilePlaceholder:{upload:U.dropReceipt.upload,single:U.dropReceipt.single,or:U.dropReceipt.or,multiple:U.dropReceipt.multiple,receipts:U.dropReceipt.receipts}})]}):null,s.jsx(Vn,{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 Qn=N.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
|
-
`,
|
|
7
|
+
`,Gn=N.div`
|
|
8
8
|
position: fixed;
|
|
9
9
|
top: 0;
|
|
10
10
|
left: 0;
|
|
@@ -38,22 +38,22 @@ import{j as s}from"./liveblocks-tpE-grBU.js";import{h as W,u as de,g as Z,i as Y
|
|
|
38
38
|
background: none;
|
|
39
39
|
border: none;
|
|
40
40
|
cursor: pointer;
|
|
41
|
-
padding: ${
|
|
41
|
+
padding: ${F.sp2} ${F.sp3};
|
|
42
42
|
line-height: 1;
|
|
43
43
|
color: ${e=>e.theme.colors.hero};
|
|
44
44
|
&:hover {
|
|
45
45
|
color: ${e=>e.theme.colors.primary};
|
|
46
46
|
}
|
|
47
47
|
svg {
|
|
48
|
-
width: ${
|
|
49
|
-
height: ${
|
|
48
|
+
width: ${F.sp4};
|
|
49
|
+
height: ${F.sp4};
|
|
50
50
|
}
|
|
51
51
|
`,Vn=N.div`
|
|
52
52
|
display: flex;
|
|
53
53
|
flex-direction: column;
|
|
54
54
|
width: 100%;
|
|
55
55
|
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
-
`,Wn=K((function(e,t){const n=Me(e,t.reimbursementId),r=$.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,
|
|
56
|
+
`,Wn=K((function(e,t){const n=Me(e,t.reimbursementId),r=$.getSignedInUser(),d=be(r),c=e.tenantState.currentTenantId,m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},o=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=Ot(n.remiActivities,Qt(t.currentTenant),r));const i=pe(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${X.communicationAgentMicroServiceBaseUrl}`,authParams:m,signedInUser:r,createdBy:o,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:i,showApproveRejectBtns:a,isZeniUser:d,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:Le(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($e());const a=nt(o),i=z(d.state?.pathnameStackToGoBack,d.pathname);c(a,{state:{pathnameStackToGoBack:i}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(Ce(n,a.type,"")):e(Ce(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=z(d.state?.pathnameStackToGoBack,d.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{v.trackReimbursementDeleteReimbursement(n),e(Pe(n))},cancelAndDeleteReport:a=>{a===!0?v.trackReimbursementCancelAndDeleteReimbursement(n):v.trackReimbursementCancelReimbursement(n),e(Gt(n,a))},handleZeniLogoClick:()=>{m.toggle()}}}))(wn);function Kn(){const e=W(),t=de(),n=Z(),r=n.hash.substring(1),d=He(),{reimbursementId:c}=Y(),m=$.getSignedInUser(),o=w((R=>H(R))),a=w((R=>Me(R,c??""))),i=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=et(o?.companyId,{clearParams:a.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:b,onAskAiCfoClick:y}=Se({mobileExploreReferrer:"Reimbursement Details"});qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:h}=ee(),{isFeatureEnabled:T}=h(E.isLimitedCategoryForReimbursement),[u,x]=f.useState(!1),[j,A]=f.useState(!1),[D,B]=f.useState(!1),{isFeatureEnabled:k}=h(E.isReimbursementCommentingEnabled),{isFeatureEnabled:I}=h(E.isShowDeletedReimbursementsFeatureEnabled),g=w((R=>ue(R,c??""))),L=$t(o),P=Mt(o.userRole),M=a.fetchState;if(f.useEffect((()=>{u||c==null?u==1&&M==="Error"&&e("page-not-found",{replace:!0}):(x(!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?B(!1):B(a.remiActivities[0]?.isRealTimeApprovalEnabled&&(P||a.allApprovers.find((R=>R.user.userId===m?.userId))!=null||a.remiDetails?.lastUpdatedBy===m?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,P,o.isZeni,L,m]),f.useEffect((()=>{j||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||g.fetchState=="Completed"||g.fetchState=="In-Progress"||(A(!0),t(De(!1,T,I,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Nt(!1,!0,!0,a.lastUpdatedByUserId)))}),[j,a,c,t]),m==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(_,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&g.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(We,{}):s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:v,onLoad:R=>(p=>{c!=null&&p.trackReimbursementReimbursementDetails(c)})(R)}),s.jsx(Wn,{initialOpenThreadRequest:l??void 0,scrollId:r,isReimbursementCommentingEnabled:k,isShowDeletedReimbursementEnabled:I,location:n,navigate:e,isRealTimeApprovalEnabled:D,currentTenant:o,reimbursementId:c??"",themeState:d,isAiCfoAccessEnabled:b,onAskAiCfoClick:y})]})}const qn=K((function(e,t){return{remisReviewView:_e(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(G())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Ht());break;case"approve":e(Ee("approved",r??""));break;case"reject":e(Ee("rejected",r??""))}}}}))(xn);function Jn(){const e=W(),t=w((c=>c.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:n}=w((c=>_e(c))),r=ne(),d=r?.loggedInUserRole?.includes("admin")===!0;return f.useEffect((()=>{t!=="Completed"&&n.length!==0||e("./")}),[t,n.length]),s.jsx(qn,{navigate:e,analytics:v,isAdmin:d})}const Q=tn(),at="bulk-operation-update",ce="reimbursement-approval-rule-update",{spendManagement:Xn,common:je}=Ke.getLocalizedStrings(),Fe=Xn.reimbursement.bulkActions,Yn=N.div`
|
|
57
57
|
display: flex;
|
|
58
58
|
min-height: 100%;
|
|
59
59
|
width: 100%;
|
|
@@ -61,8 +61,8 @@ import{j as s}from"./liveblocks-tpE-grBU.js";import{h as W,u as de,g as Z,i as Y
|
|
|
61
61
|
flex-direction: column;
|
|
62
62
|
align-items: center;
|
|
63
63
|
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
-
`,ea=K((function(e,t){const n=
|
|
64
|
+
`,ea=K((function(e,t){const n=Qe(e,Q,t.isBulkActionEnabled);let r=n.allSubTabs;const d=$.getSignedInUser(),c=be(d),m=e.tenantState.currentTenantId,o=H(e),a=o?.companyName??"",i={userId:d?.userId??"",sessionId:d?.zeniSessionId??"",tenantId:m??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((h=>h!=="deleted")));const b=n.fetchState,y=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:Q,spendManagementEndPoint:`${Dn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:y.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:d,period:c}=t,{tenantEmailDomain:m}=r;return{updateTabToState:o=>{e(G()),e(Ne(o))},onSubtabChange:o=>{e(G()),e(Oe(o))},onTransactionClick:(o,a)=>{const i=aa(m,o,a),l=z(d.state?.pathnameStackToGoBack,d.pathname);n(i,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const o=na(m),a=z(d.state?.pathnameStackToGoBack,d.pathname);n(o,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;v?.trackReimbursementNewReimbursement();const a=`/${o}/reimbursement/new`,i=z(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:i}})},onColumnSortConfigChanged:(o,a)=>{e(dn({uiState:{sortKey:o,sortOrder:a},period:t.period}))},onSearchTextChanged:o=>{e(cn(o))},onFiltersChange:o=>{e(mn({filters:o})),o.categories.every((a=>a.field!=null&&a.values?.length!==0))&&v.trackSpendManagmentFilterChange("reimbursement",o.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:o=>{o==="In-Progress"&&v.trackSpendManagementDownloadClick("reimbursement"),e(ln({uiState:{downloadState:o}}))},onReloadTransactions:()=>{e(le(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(we("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(we("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:o=>{o.endsWith(ce)&&e(sn(!1))},onEventReceived:o=>{o===at&&e(an())}}}))(jn(Fn));function ta(){const e=W(),t=de(),n=Z(),r=n.state,d=Ve(),[c,m]=f.useState(null),o=mt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;f.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const S=Wt(r.tab.toString());S!=null?t(Ne(S)):console.log("Warning:Not a valid remiListTab");const O=Kt(r.subTab.toString());O!=null?t(Oe(O)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(G())}}),[]);const{useFeatureGate:a}=ee(),{isFeatureEnabled:i}=a(E.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(E.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:b}=a(E.isBillPayCommentingEnabled),{isFeatureEnabled:y}=a(E.isReimbursementCommentingEnabled),{isFeatureEnabled:h}=a(E.isReimbursementBulkActionEnabled),T=$.getSignedInUser(),u=w((S=>H(S))),[x,j]=f.useState(!1),[A,D]=f.useState(!1),B=ne(),k=B?.loggedInUserRole?.includes("admin")===!0,I=w((S=>Qe(S,Q,h))),{areTenantIdsInSync:g}=Bn(),L=I.fetchState,{isAiCfoAccessEnabled:P,onAskAiCfoClick:M}=Se({mobileExploreReferrer:"Reimbursement List"});if(qe({isDataReady:L==="Completed"}),f.useEffect((()=>{!A&&g&&(D(!0),t(le(Q,!0,l,!1,!0)))}),[A,Q,t,g]),T==null)throw Error("Can't access address page without signing in...");const R=!!u?.userRole&&qt(u),p=ge(B?.loggedInUserRoleMap),V=he(B?.loggedInUserRoleMap),ae=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,q=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,se=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,ie=w((S=>Ue(S.companyState,u.companyId))),st=ie?.company.featuresActivationInfo.connectedAccountProvider,Ie=S=>{j(S)},{isFeatureEnabled:it}=a(E.isDebitCardFeatureEnabled),ot=Ge(it,u),rt=ze(u),{remisProcessed:J,remisProcessing:Re}=w((S=>Jt(S)));f.useEffect((()=>{J===Re&&c!=null&&(t(Xt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:J>1?Fe.reports:Fe.report},{variableName:"_has_",variableValue:J>1?je.texts.have:je.texts.has},{variableName:"_action_",variableValue:Yt(c)}]})),t(en()),setTimeout((()=>{t(le(Q,!0,l,!1,!0,!0))}),3e3),m(null))}),[J,Re]);const lt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${at}`,`private-encrypted-${u.companyId}.${ce}`]:[],eventCallback:(S,O,ye)=>{S.endsWith(ce)?ye.onReimbursementApprovalRulesEventReceived?.(S):O.entity_type==="reimbursement"&&(m(O.operation_type),ye.onEventReceived(S))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?ot===!0||rt===!0?s.jsx(Ye,{}):q&&(!R||p)||V&&ae?s.jsxs(s.Fragment,{children:[L==="Completed"?s.jsx(te,{analytics:v,onLoad:S=>(O=>O.trackPageLoaded(Je.Event.reimbursementHome))(S)}):null,s.jsx(tt,{isAppContentDrawerOpen:x,handleDrawerToggle:Ie}),s.jsxs(Yn,{windowSize:d,children:[s.jsx($n,{isOpen:o,drawerLeftMargin:new Tn(0,0,300,600),onClose:()=>{e("./"),t(G())},children:s.jsx(sa,{onClick:S=>S.stopPropagation(),children:s.jsx(Jn,{})})}),s.jsx(ea,{isShowDeletedBillsEnabled:i,isShowDeletedReimbursementEnabled:l,isBillPayCommentingEnabled:b,isReimbursementCommentingEnabled:y,location:n,navigate:e,currentTenant:u,period:Q,isAdmin:k,isEmployee:R,entity:"reimbursement",onClickMenuIcon:()=>{Ie(!0)},createdByUserList:I.createdByUserList,createdByUserListFetchState:I.createdByUserListFetchState,isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:st,isBulkActionEnabled:h,bulkSubmissionLimit:I.remiBulkSubmissionLimit,bulkSubmissionFetchState:I.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:P,onAskAiCfoClick:M,...lt})]})]}):se&&p?s.jsx(_,{to:"../setup"}):B!=null&&Ze(u,B.loggedInUserRoleMap)?s.jsx(_,{to:"../promo"}):s.jsx(fe,{fetchState:"In-Progress"}):s.jsx(me,{})}const na=e=>`/${e}/reimbursements/setup`,aa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},sa=N(Pn)`
|
|
65
65
|
display: flex;
|
|
66
66
|
min-height: 100%;
|
|
67
67
|
flex-direction: column;
|
|
68
|
-
`,ia=K((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:
|
|
68
|
+
`,ia=K((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:un(e,n),analytics:v,meetingUrl:"https://meetings.hubspot.com/niharn/demo-reimbursements?embed=true",videoUrl:"https://player.vimeo.com/video/814821498?h=e7fd11e13e&badge=0&autopause=0&player_id=0&app_id=122963"}}),(function(e,t){const{companyId:n,navigate:r}=t;return{onSetupButtonClick:()=>{e(bn(n))},onCreateNewRemiButtonClick:()=>{e(pn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Un),oa=()=>{const e=W(),t=Z(),{tenantEmailDomain:n}=Y(),r=Xe(),[d,c]=f.useState(!1),m=w((A=>H(A))),o=$.getSignedInUserTenant(n)?.companyId??m.companyId,a=$.getSignedInUser(),i=m.userRoleId,l=!!m.userRole?.includes("reimbursements_user"),b=ne(),y=ge(b?.loggedInUserRoleMap),h=he(b?.loggedInUserRoleMap),T=!!m.userReimbursementInfo?.isReimbursementTOSAccepted,u=!!m.companyReimbursementInfo?.info?.isReimbursementEnabled,x=!!m.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,j=A=>{c(A)};if(a==null)throw Error("Can't access reimbursement promo page without signing in...");return u&&h&&T?s.jsx(_,{to:"../../../reimbursements"}):x&&y?s.jsx(_,{to:"../../reimbursements/setup"}):m.companyReimbursementInfo&&!x||m.userReimbursementInfo&&h&&T===!1?s.jsxs(s.Fragment,{children:[s.jsx(te,{analytics:v,onLoad:A=>(D=>D.trackPageLoaded(Je.Event.reimbursementPromoPage))(A)}),s.jsx(tt,{isAppContentDrawerOpen:d,handleDrawerToggle:j}),s.jsx(ia,{companyId:o,navigate:e,location:t,userReimbursementInfo:m.userReimbursementInfo,userRoleId:i,isEmployee:l,onClickMenuIcon:()=>{j(!0)}})]}):s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Pa(){const e=w((ie=>H(ie))),t=ne(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Xe(),d=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:m}=ee(),{isFeatureEnabled:o}=m(E.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=m(E.isDebitCardFeatureEnabled),i=Ge(a,e),l=ze(e),b=e?.userRole!=null&&gn(e?.userRole),y=(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=ge(t?.loggedInUserRoleMap),x=T&&u,j=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!b,A=j&&Sn(t?.loggedInUserRoleMap),D=Ln(e,o,a)&&!b,B=D&&In(t?.loggedInUserRoleMap),k=Rn(t?.loggedInUserRoleMap),I=yn(t?.loggedInUserRoleMap),g=An(t?.loggedInUserRoleMap),L=j&&I,P=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!b&&g,M=vn(t?.loggedInUserRoleMap),R=kn(t?.loggedInUserRoleMap),p=he(t?.loggedInUserRoleMap),V=D&&M,{tenantEmailDomain:ae}=Y(),q=Z(),se=n===!0&&(u||p&&c);return s.jsxs(ct,{children:[q.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"verification",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:k,productType:"reimbursement",type:"verification"})}),s.jsx(C,{path:"setup",element:s.jsx(Be,{isBillPayAdminLevelAccess:y,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:x,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:B,isUserHasOnlyCardAccess:k,productType:"reimbursement",type:"setup"})}),s.jsx(C,{path:"promo",element:s.jsx(oa,{})}),s.jsx(C,{path:"approval-rules/*",element:x?s.jsx(Mn,{}):s.jsx(_n,{showZeniAccountRoute:L,isUserHasBillPayAccess:R,isUserHasReimbursementAccess:p,showTreasuryRoute:P,isTenantBankingOnly:i,showChargeCardRoute:V,tenantEmailDomain:ae??""})}),se&&s.jsx(C,{path:"*",element:s.jsx(ta,{})}),(i===!0||l===!0)&&s.jsx(C,{path:"/*",element:s.jsx(Ye,{})}),t!=null&&Ze(e,t?.loggedInUserRoleMap)&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../promo"})}),d&&u&&s.jsx(C,{path:"*",element:s.jsx(_,{to:"../setup"})})]}):q.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(C,{path:"new",element:s.jsx(Te,{})}),s.jsx(C,{path:":reimbursementId",element:s.jsx(Kn,{})}),s.jsx(C,{path:":reimbursementId/edit",element:s.jsx(Te,{})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]}):s.jsx(C,{path:"*",element:s.jsx(fe,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${F.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(C,{path:"*",element:s.jsx(me,{})})]})}export{Pa as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as p}from"./liveblocks-tpE-grBU.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-0WK0Zss8.js";import{eX as L,fT as w,Mu as Te,kA as K,qU as W,rJ as A,ko as Re,js as Me,vh as Q,rO as Oe,bs as Ae,Mv as Fe,bn as ke,wq as De,Mw as Ee,Mx as je,v9 as Pe,My as Y,Mz as Le,MA as ve,MB as Be,MC as Ue,MD as I,ME as F,MF as k,MG as N,MH as D,MI as E,dK as Ve,w6 as xe,vW as $,vX as q,wc as ze,v$ as X,wi as Ge,MJ as He,MK as Ye,ML as Ne,MM as $e,MN as qe,fE as Xe,fC as Ze}from"./zeni-epic-state-Bx_bp9Xr.js";import{W as Je,X as Ke,Y as We,Z as Qe,m as ea,C as ee,G as j,z as ae,_ as aa,T as sa,c as ta,$ as oa,a0 as na,D as ra,d as P,f as ia,a1 as la,r as se,a2 as ca,a3 as da,a4 as pa}from"./index-Dy73EgcO.js";import"./mui-NHWzIwJg.js";import fa from"./NotFoundScreen-BUpSeNgf.js";import{F as ma}from"./FeaturePreviewScreen-CS0na0Uv.js";import{a as _}from"./sentry-D58SEIt0.js";import{u as ua}from"./useInitialThreadRequest-B7WOjZ27.js";import{t as Z,a as J,b as _a}from"./routePaths-YBRbNv0i.js";import{M as ha}from"./MobileAppDrawer-By5kqJZy.js";import"./recharts-CUzwcISX.js";import"./analytics-1WMvk5Rb.js";import"./plaid-59NT4aqa.js";import"./dnd-Dwsdp5ty.js";import"./stripe-cKAAJElX.js";import"./lottie-dQMhiLBj.js";import"./lexical-B9WqgH9H.js";import"./pdf-C4fX1mA3.js";import"./utils-CHGPa257.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]="219dd663-dacb-4816-a4ed-befe69d5d395",e._sentryDebugIdIdentifier="sentry-dbid-219dd663-dacb-4816-a4ed-befe69d5d395")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(E({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e($e()),e(qe())},Ca=Ie((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=w(e),r=Fe(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:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:K(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(A(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(X({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(X(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ve(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return J(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?J(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?Z(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(E({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(k({scrollPosition:s}));break;case"cash_flow":e(F({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(E({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(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({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(Ue({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(ve({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(Le({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(Q())},onUpdateDisplayOrder:a=>{e(je(a))},onUpdateReportFormat:a=>{ya(e),e(Ee(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Qe(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(j.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[v,te]=_.useState(!1),{isFeatureEnabled:B}=l(j.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>L(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),U=d((n=>K(n))),M=d((n=>W(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),O=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(C(!0),s(A(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!v&&g==="Completed"&&h&&(s(A(c.userId,!1,!0,!1)),te(!0))}),[i,v,g,h]),_.useEffect((()=>{if(i&&O.fetchState==="Not-Started"&&b.timeframe!=="free_range"&&b.timeframe!=="week"&&h)switch(R){case"profit_and_loss":case"profit_and_loss_by_classes":s(Oe(b.timeframe));break;case"profit_and_loss_by_projects":M&&s(Q());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,O,h,U,M]);const V=sa(),de=V?.loggedInUserRole!=null&&Ae(V?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Je(he??"")==="reports",be=Ke(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);We({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:U,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:O,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d((s=>L(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(j.isDebitCardFeatureEnabled),u=Xe(f,e),a=Ze(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
1
|
+
import{j as p}from"./liveblocks-s55OcG-D.js";import{g as G,h as Ce,u as ge,i as we,j as d,n as Ie,o as Se,p as H}from"./core-CnGMK-sC.js";import{eV as v,fR as w,Ms as Te,kz as Q,qT as W,rI as O,kn as Re,jr as Me,vf as X,rN as Ae,bs as Oe,Mt as Fe,bn as ke,wo as De,Mu as je,Mv as Ee,v7 as Pe,Mw as Y,Mx as ve,My as Le,Mz as Be,MA as Ve,MB as I,MC as F,MD as k,ME as N,MF as D,MG as j,dH as Ue,w4 as xe,vU as $,vV as q,wa as ze,vZ as Z,wg as Ge,MH as He,MI as Ye,MJ as Ne,MK as $e,ML as qe,fC as Ze,fA as Je}from"./zeni-epic-state-NrbJoBOX.js";import{V as Ke,W as Qe,X as We,Z as Xe,m as ea,C as ee,G as E,z as ae,_ as aa,T as sa,c as ta,$ as oa,a0 as na,x as ra,d as P,f as ia,a1 as la,v as se,a2 as ca,a3 as da,a4 as pa}from"./index-BWvweS0E.js";import"./mui-CggbPNN2.js";import fa from"./NotFoundScreen-Bge2JGwW.js";import{F as ma}from"./FeaturePreviewScreen-D3z2gcpi.js";import{a as _}from"./sentry-qwy54zvC.js";import{u as ua}from"./useInitialThreadRequest-EuACK97s.js";import{t as J,a as K,b as _a}from"./routePaths-D87yNyzK.js";import{M as ha}from"./MobileAppDrawer-8wrd6B-7.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.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]="0eee6d51-5e85-4cea-abd2-6add07138779",e._sentryDebugIdIdentifier="sentry-dbid-0eee6d51-5e85-4cea-abd2-6add07138779")}catch{}})();const ba=["profit_loss","balance_sheet","cash_flow"],y=e=>{e(j({resetLeftScroll:!0})),e(D({resetLeftScroll:!0})),e(k({resetLeftScroll:!0})),e(F({resetLeftScroll:!0}))},ya=e=>{e(Ye()),e(Ne()),e($e()),e(qe())},Ca=Ie((function(e){const o=ae.getSignedInUser(),f=e.tenantState.currentTenantId,u=v(e),a=u?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:f??""},t=w(e),r=Fe(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:ke(o),showAccountGroups:r===!0,isAccountingClassesEnabled:Q(e),isAccountingProjectsEnabled:W(e),currentTenantCompanyName:a,statementEndPoint:`${pa}/statement`,authParams:s,isZeniCOAUsed:r}}),(function(e,o){const{navigate:f,handleDrawerToggle:u}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(O(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(He(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(Ge(a)),s){const{isCompareModeOn:r,filter:l}=o,{additionalBalances:m,balancesRange:c}=l;let i=[...m];a==="year"&&(i=i.filter((C=>C!=="this_period_vs_same_period_last_year"&&C!=="this_period_vs_same_period_last_year_percent"&&C!=="same_period_last_year"))),e($(o.firstMonthOfFY,r,c.numberOfPeriods<1?1:c.numberOfPeriods,i)),m.length>0&&e(q(o.firstMonthOfFY,i.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",c.numberOfPeriods<1?1:c.numberOfPeriods,i))}t!==!0&&setTimeout((()=>y(e)),50)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(I(a)),(a==="balance_sheet"||a==="cash_flow")&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Z({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(Y({classViewLayout:"vertical"})),y(e)},onCOABalancesRangeChanged:(a,s)=>{e(Z(a,s)),y(e)},onThisPeriodChanged:(a,s,t)=>{e(ze(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&y(e)},onAdditionalBalanceSelectionChanged:(a,s,t,r)=>{e($(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(q(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),r!==!0&&o.isCompareModeOn===a||setTimeout((()=>y(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,r)=>{e(xe({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:r}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let r,l;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(r=s.balanceTimeFrame,l=Ue(s)):s.balanceTimeFrame==="year"?(r="quarter",l={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),l!=null&&r!=null){const m=a.accountName===""?a.accountDescription:a.accountName,c=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return J(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return K(o.tenantEmailDomain,a.accountId,a.accountType,s.id,m,r,l)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?_a(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,m,r,l):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?K(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],m,r,l):a.accountType!=null?J(o.tenantEmailDomain,a.accountId,a.accountType,m,r,l):void 0})();if(c!=null){const i=se(o.location.state?.pathnameStackToGoBack,o.location.pathname);f(c,{state:{pathnameStackToGoBack:i,referrer:S(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(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(k({scrollPosition:s}));break;case"cash_flow":e(F({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(k({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(F({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{f("../../")},onUpdateAccountViewMode:a=>{e(Be({viewMode:a})),e(Ve({viewMode:a})),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",S(o.selectedReportID)),e(I("profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",S(o.selectedReportID)),e(I("profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",S(o.selectedReportID)),e(I("profit_and_loss"))),y(e)},onUpdateClassesToFilterOut:a=>{e(Le({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{e(ve({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(Y({classViewLayout:a}))},onOpenAccountViewMode:()=>{o.isAccountingClassesEnabled&&e(Pe()),o.isAccountingProjectsEnabled&&e(X())},onUpdateDisplayOrder:a=>{e(Ee(a))},onUpdateReportFormat:a=>{ya(e),e(je(a))},onClickMenuIcon:()=>{u(!0)},onResyncReports:()=>{e(De("profit_and_loss_by_classes"))}}}))(ca);function ga(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Xe(),f=ea(),u=da(f),a=Ce(),s=ge(),t=G(),{tenantEmailDomain:r}=we(),{useFeatureGate:l}=ee(),{isFeatureEnabled:m}=l(E.isReportsHorizontalClassLayoutSwitchEnabled),c=ae.getSignedInUser(),[i,C]=_.useState(!1),[L,te]=_.useState(!1),{isFeatureEnabled:B}=l(E.isReportsCommentingEnabled);if(c==null)throw Error("Can't access reports page without signing in...");const T=d((n=>v(n))),oe=T.masterTOSInfo?.isMasterTOSAccepted??!1,ne=T.company?.companyInfo.firstMonthOfFY??1,re=ua(B?T?.companyId:void 0),g=d((n=>w(n).fetchState)),ie=d((n=>Te(n))),{areTenantIdsInSync:h}=aa(),R=d((n=>n.financeStatementState.selectedReportId)),V=d((n=>Q(n))),M=d((n=>W(n))),le=d((n=>w(n).isCompareModeOn)),b=d((n=>w(n).filter)),A=d((n=>w(n).selectedReportAndTimeframeFetchState)),ce=d((n=>n.profitAndLossClassesViewState.uiState.classViewLayout));_.useEffect((()=>{!i&&h&&(C(!0),s(O(c.userId,!0,!0,!1)))}),[i,c,s,h]),_.useEffect((()=>{i&&!L&&g==="Completed"&&h&&(s(O(c.userId,!1,!0,!1)),te(!0))}),[i,L,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":M&&s(X());break;case"balance_sheet":s(Me(b.timeframe));break;case"cash_flow":s(Re(b.timeframe))}}),[i,R,A,h,V,M]);const U=sa(),de=U?.loggedInUserRole!=null&&Oe(U?.loggedInUserRole)!==!0,[pe,fe]=_.useState(!1),x=n=>{fe(n)},me=ta(),ue=oa();return(function(n){const{isDataReady:_e}=n,{pathname:he}=G(),z=Ke(he??"")==="reports",be=Qe(_e),ye=_.useMemo((()=>z?ba:void 0),[z]);We({canFetchSuggestedQuestions:be,pageContexts:ye})})({isDataReady:g==="Completed"}),na({isDataReady:g==="Completed"}),p.jsxs(p.Fragment,{children:[g==="Completed"?p.jsx(ra,{analytics:P,onLoad:n=>n.trackPageLoaded(ia.Event.reports)}):null,p.jsx(ha,{isAppContentDrawerOpen:pe,handleDrawerToggle:x}),p.jsx(Ca,{firstMonthOfFY:ne,tenantEmailDomain:r,location:t,navigate:a,windowSize:f,classViewLayout:ce,selectedReportID:R,analytics:P,filter:b,isAccountingClassesEnabled:V,isAccountingProjectsEnabled:M,isCompareModeOn:le,hasTransactionAccess:de,signedInUser:c,selectedReportAndTimeframeFetchState:A,handleDrawerToggle:x,reportsResyncFetchState:ie.reportsResyncFetchState,isAiCfoAccessEnabled:ue&&me&&!e,onAskAiCfoClick:()=>{if(oe)if(u){const n=se(t.state?.pathnameStackToGoBack,t.pathname);a(`/${r}/ai-cfo/explore`,{state:{pathnameStackToGoBack:n,referrer:"Reports"}})}else o(!0);else la({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:m,isReportsCommentingEnabled:B,initialOpenThreadRequest:re})]})}const S=e=>{switch(e){case"profit_and_loss":return"Profit & Loss";case"balance_sheet":return"Balance Sheet";case"cash_flow":return"Cash Flow";default:return"Reports"}};function za(){const e=d((s=>v(s))),{useFeatureGate:o}=ee(),{isFeatureEnabled:f}=o(E.isDebitCardFeatureEnabled),u=Ze(f,e),a=Je(e);return u===!0||a===!0?p.jsx(ma,{}):p.jsxs(Se,{children:[p.jsx(H,{path:"/",element:p.jsx(ga,{})}),p.jsx(H,{path:"*",element:p.jsx(fa,{})})]})}export{za as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-s55OcG-D.js";import{z as b,x as S,d as u,f as C,d7 as E,C as I,G as k}from"./index-BWvweS0E.js";import"./mui-CggbPNN2.js";import g from"./NotFoundScreen-Bge2JGwW.js";import{a as c}from"./sentry-qwy54zvC.js";import{u as D,j as h,h as F,g as L,n as T,o as U,p as d,N as y}from"./core-CnGMK-sC.js";import{eV as V,TD as j,TE as p,vL as _,fI as P,TF as G,vJ as z}from"./zeni-epic-state-NrbJoBOX.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.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]="5020a069-44b3-4991-b4d2-3f283e63b5d1",e._sentryDebugIdIdentifier="sentry-dbid-5020a069-44b3-4991-b4d2-3f283e63b5d1")}catch{}})();const J=T((function(e,t){const n=j(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=b.getSignedInUser();return{onDismissClick:()=>{e(p()),n("/")},onSendClick:()=>{if(i!=null){const s=[],r=[];t.inviteFormCompayData.forEach((m=>{s.push(m.companyName),r.push(m.emailIds[0])})),u.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(G({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&u.trackInviteEmailClicked("cancel")}}}))(E),R=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=h((o=>V(o))),m=F(),w=L(),f=b.getSignedInUser();if(f==null)throw Error("Can't access invite referral screen without signing in...");const l=h((o=>j(o))),x=f?.firstName!=null?f.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(_()),s(!0))}),[]),c.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(P(!0)))}),[l.fetchState,e]);const v=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(S,{analytics:u,onLoad:o=>(N=>N.trackPageLoaded(C.Event.inviteEmailViewed))(o)}):null,a.jsx(J,{navigate:m,location:w,currentTenant:r,companyName:v,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(k.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(y,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(R,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/DashboardRoutes-684orl8N.js","assets/sentry-qwy54zvC.js","assets/core-CnGMK-sC.js","assets/zeni-epic-state-NrbJoBOX.js","assets/index-BWvweS0E.js","assets/mui-CggbPNN2.js","assets/analytics-DhULAPA0.js","assets/utils-5Fz6z6US.js","assets/withTransactionSidePanel-BJ1dqQdE.js","assets/useAskAiCfoHostNavButtonProps-c_VzJZE9.js","assets/TransactionDetailScreen-BsgXSNNV.js","assets/decodeURIComponentSafe-uWfgYCNH.js","assets/routePaths-D87yNyzK.js","assets/NotFoundScreen-Bge2JGwW.js","assets/useInitialThreadRequest-EuACK97s.js","assets/analyticsHelper-CixncN58.js","assets/CompanyPassportScreen-B0IdpqTW.js","assets/MobileAppDrawer-8wrd6B-7.js","assets/useAiCfoDashboardSuggestedQuestionsChips-COKjoYH2.js","assets/FeaturePreviewScreen-D3z2gcpi.js","assets/index-Czu7h9lW.css","assets/BillPayRoutes-CXhgkFrh.js","assets/AddressScreen-B2g0EGq7.js","assets/DomesticWireDetailScreen-BtYZfhuG.js","assets/DrawerScreen-CSMp2A9F.js","assets/SetupPagesScreen-BIZfrXFn.js","assets/BusinessVerificationPageScreen-CHlhD1bn.js","assets/BillPayApprovalRoutes-DI5OQIWZ.js","assets/ReimbursementApprovalRuleDetailScreen-DIOgjJyZ.js","assets/getLocaleForTenant-C5b46Qyn.js","assets/ReimbursementRoutes-DRMiWLSm.js","assets/ReimbursementApprovalRoutes-CTijKmMu.js","assets/TransactionListRoutes-BrzIlvyk.js","assets/ZeniAccountStatementScreen-B3_VR-tZ.js","assets/SettingsRoutes-D5DPlYhg.js","assets/accountMappingHelper-SWFIL59M.js","assets/useEmailConnectResultRefresh-CMBVShl-.js","assets/QBOConnectionScreen-8ZlWNPA9.js","assets/empty-AGnm4bIq.js","assets/index-b64yysEr.js","assets/url-CF9Fx3Jk.js","assets/index-CUaM5Y1I.js","assets/ReportsRoutes-DnRmWO_g.js","assets/ChargeCardRoutes-DYWdITos.js","assets/useChargeCardPusherEvents-C2sCX5OQ.js","assets/PeopleRoutes-CmOZGcsk.js","assets/ExpenseAutomationRoutes-CB1lyxjv.js","assets/TreasuryRoutes-Dyw-ZAPa.js","assets/useCashManagementBanner-OkHozYlV.js","assets/VendorsRoutes-BWBUUjTt.js","assets/pathToGoBack-DpxbYxCk.js","assets/ZeniAccountRoutes-3OROP5vK.js","assets/AddressRoutes-oOQJC3Yo.js","assets/PandLWithForecastRoutes-CxdNyFxC.js","assets/CustomerOnboardingRoutes-D44ZNBEA.js","assets/TransactionDetailRoutes-C9ZhFLf5.js","assets/EntityDetailRoutes-CRNQJyjq.js","assets/NotificationRoutes--6GU4tbu.js","assets/PerformanceRoutes-Bu3nN2tK.js","assets/RewardsRoutes-b9NXQyW4.js","assets/TaskRoutes-BAC-3C1s.js","assets/TaskListScreen-BnrFj0CA.js","assets/AiCfoScreen--Z8a2CnQ.js","assets/CardsAiCfoScreen-BfeQo7N4.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as t,bn as ls,eV as us,fC as ds,fA as cs,gk as ms,fp as _s,cV as Ee,cB as hs,fS as ps,ct as Es,bE as Rs,bo as xs,fW as gs,v as Is,L_ as Ts,bs as js,L$ as As,bK as fs,bJ as ys,bt as Ds,cp as bs,M0 as Cs,M1 as vs,cR as Us,cU as ws,cT as Os,cA as Ps,cH as Fs,ob as Re,fy as xe,gu as Ls,f_ as ge,gr as Ie,gs as Te,f$ as ks}from"./zeni-epic-state-NrbJoBOX.js";import{j as e}from"./liveblocks-s55OcG-D.js";import{a as O}from"./sentry-qwy54zvC.js";import{u as Hs,h as Bs,i as Vs,g as Ss,j as G,l as je,N as u,o as Ns,p as a}from"./core-CnGMK-sC.js";import{y as Ms,u as Zs,z as y,C as Gs,c as $s,E as zs,G as $,i as Ws,J as Ys,T as qs,L as F,a as Ae,t as _,P as Js,d as X,l}from"./index-BWvweS0E.js";import"./mui-CggbPNN2.js";import{f as fe}from"./analyticsHelper-CixncN58.js";import{t as Ks}from"./getLocaleForTenant-C5b46Qyn.js";import"./recharts-CmLekiCG.js";import"./analytics-DhULAPA0.js";import"./plaid-d_bwfWrk.js";import"./dnd-BqCGp7Ed.js";import"./stripe-cKAAJElX.js";import"./lottie-DMKCl4ti.js";import"./lexical-DlqthnSG.js";import"./pdf-BD0zxvar.js";import"./utils-5Fz6z6US.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},j=new o.Error().stack;j&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[j]="aff9985c-a7f1-4d31-afb4-168a072d52b1",o._sentryDebugIdIdentifier="sentry-dbid-aff9985c-a7f1-4d31-afb4-168a072d52b1")}catch{}})();const Qs={dashboard:()=>t((()=>import("./DashboardRoutes-684orl8N.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:()=>t((()=>import("./BillPayRoutes-CXhgkFrh.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])),reimbursement:()=>t((()=>import("./ReimbursementRoutes-DRMiWLSm.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])),transactions:()=>t((()=>import("./TransactionListRoutes-BrzIlvyk.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])),settings:()=>t((()=>import("./SettingsRoutes-D5DPlYhg.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])),reports:()=>t((()=>import("./ReportsRoutes-DnRmWO_g.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])),chargeCards:()=>t((()=>import("./ChargeCardRoutes-DYWdITos.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])),people:()=>t((()=>import("./PeopleRoutes-CmOZGcsk.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])),expenseAutomation:()=>t((()=>import("./ExpenseAutomationRoutes-CB1lyxjv.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])),treasury:()=>t((()=>import("./TreasuryRoutes-Dyw-ZAPa.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])),vendors:()=>t((()=>import("./VendorsRoutes-BWBUUjTt.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])),zeniAccounts:()=>t((()=>import("./ZeniAccountRoutes-3OROP5vK.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20]))},Xs=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ee=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},et=l((()=>t((()=>import("./ReportsRoutes-DnRmWO_g.js")),__vite__mapDeps([42,1,2,3,4,5,6,7,13,19,14,12,17,20])))),st=l((()=>t((()=>import("./AddressRoutes-oOQJC3Yo.js")),__vite__mapDeps([52,1,2,3,22,4,5,6,7,13,20])))),tt=l((()=>t((()=>import("./PeopleRoutes-CmOZGcsk.js")),__vite__mapDeps([45,1,2,3,4,5,6,7,13,9,17,20])))),nt=l((()=>t((()=>import("./PandLWithForecastRoutes-CxdNyFxC.js")),__vite__mapDeps([53,1,2,3,4,5,6,7,13,19,9,14,12,17,20])))),at=l((()=>t((()=>import("./CustomerOnboardingRoutes-D44ZNBEA.js")),__vite__mapDeps([54,1,2,3,22,4,5,6,7,13,37,38,39,40,41,11,36,44,20])))),ot=l((()=>t((()=>import("./VendorsRoutes-BWBUUjTt.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,22,13,19,12,50,9,17,24,35,20])))),rt=l((()=>t((()=>import("./TransactionDetailRoutes-C9ZhFLf5.js")),__vite__mapDeps([55,1,2,3,13,4,5,6,7,10,9,11,12,20])))),ye=l((()=>t((()=>import("./EntityDetailRoutes-CRNQJyjq.js")),__vite__mapDeps([56,1,2,3,4,5,6,7,11,8,9,10,12,20])))),it=l((()=>t((()=>import("./DashboardRoutes-684orl8N.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((()=>t((()=>import("./BillPayRoutes-CXhgkFrh.js")),__vite__mapDeps([21,1,2,3,4,5,6,7,22,13,23,9,14,24,17,19,25,15,12,26,27,28,29,20])))),lt=l((()=>t((()=>import("./SettingsRoutes-D5DPlYhg.js")),__vite__mapDeps([34,1,2,3,4,5,6,7,17,35,22,13,15,26,12,16,36,37,38,39,40,41,11,27,28,31,20])))),be=l((()=>t((()=>import("./ReimbursementRoutes-DRMiWLSm.js")),__vite__mapDeps([30,1,2,3,4,5,6,7,13,25,17,15,12,26,19,9,14,24,31,28,29,20])))),ut=l((()=>t((()=>import("./ZeniAccountRoutes-3OROP5vK.js")),__vite__mapDeps([51,1,2,3,4,5,6,7,48,13,25,17,15,12,26,19,23,22,9,33,20])))),dt=l((()=>t((()=>import("./TreasuryRoutes-Dyw-ZAPa.js")),__vite__mapDeps([47,1,2,3,4,5,6,7,13,25,17,15,12,26,9,14,48,19,20])))),ct=l((()=>t((()=>import("./TransactionListRoutes-BrzIlvyk.js")),__vite__mapDeps([32,1,2,3,4,5,6,7,8,9,10,11,12,33,20])))),mt=l((()=>t((()=>import("./ChargeCardRoutes-DYWdITos.js")),__vite__mapDeps([43,1,2,3,4,5,6,7,9,17,25,13,15,12,26,14,44,22,20])))),_t=l((()=>t((()=>import("./NotificationRoutes--6GU4tbu.js")),__vite__mapDeps([57,1,2,3,13,4,5,6,7,9,20])))),ht=l((()=>t((()=>import("./PerformanceRoutes-Bu3nN2tK.js")),__vite__mapDeps([58,1,2,3,13,4,5,6,7,9,17,20])))),pt=l((()=>t((()=>import("./ExpenseAutomationRoutes-CB1lyxjv.js")),__vite__mapDeps([46,1,2,3,13,4,5,6,7,9,10,11,12,8,35,24,20])))),Et=l((()=>t((()=>import("./RewardsRoutes-b9NXQyW4.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,13,20])))),Rt=l((()=>t((()=>import("./TaskRoutes-BAC-3C1s.js")),__vite__mapDeps([60,1,2,3,13,4,5,6,7,14,17,61,9,20])))),xt=l((()=>t((()=>import("./AiCfoScreen--Z8a2CnQ.js")),__vite__mapDeps([62,1,2,3,4,5,6,7,18,50,20])))),Ce=l((()=>t((()=>import("./CardsAiCfoScreen-BfeQo7N4.js")),__vite__mapDeps([63,1,2,3,4,5,6,7,20])))),b=l((()=>t((()=>import("./NotFoundScreen-Bge2JGwW.js")),__vite__mapDeps([13,1,2,3,4,5,6,7,20])))),gt=l((()=>t((()=>import("./TaskListScreen-BnrFj0CA.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,9,17,20]))));function St({setTenantEmailDomain:o}){const j=Hs(),B=Bs(),{tenantEmailDomain:i}=Vs(),L=Ms().mode,{setLoading:U,clearAllLoading:C,clearLoading:k}=Zs(),v=y.getSignedInUserTenant(i)?.tenantId,I=y.getSignedInUser(),se=ls(I),z=Ss(),[V,Pe]=O.useState(!1),r=G((n=>us(n))),{useFeatureGate:N}=Gs(),M=$s(),te=zs(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ke}=N($.isChargeCardFeatureEnabled),{isFeatureEnabled:ne}=N($.isDebitCardFeatureEnabled),A=G((n=>n.tenantState.fetchState)),T=G((n=>n.tenantState.activeTenantFetchState.fetchState)),h=T==="Completed"||A==="Completed"?ds(ne,r):void 0,J=T==="Completed"||A==="Completed"?cs(r):void 0,He=Ws(r,ke,ne),{isCardsHidden:Be}=Ys(r?.tenantId),Ve=!He||!!Be,{isFeatureEnabled:Se}=N($.isSettingsFeatureEnabled),{isFeatureEnabled:K}=N($.isAiCfoFileUploadEnabled),W=G((n=>ms(n)));if(i!=null){const n=y.getSignedInUserTenant(i);I!=null&&n!=null&&fe(I,r,L)}const Z={tenantId:v,userId:I?.userId,sessionId:I?.zeniSessionId},ae=_s(),p=qs(),Ne=r.company==null||p?.loggedInUserRoleMap!=null&&Ee(p.loggedInUserRole),Me=hs(p?.loggedInUserRoleMap),oe=O.useRef(!0),re=je("/:tenantEmailDomain/onboarding/*")!==null,Q=je("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),Ze=G((n=>Z.tenantId!=null?ps(n,Z.tenantId):void 0));O.useEffect((()=>{U(F.TENANT_FETCHING),o(i)}),[i]),O.useEffect((()=>{if(Q!=null&&v!=null){const n=Q.params.selectedPeriod;if(n!=null){const f=n.split("-");if(f.length===2){const d=Es(Number(f[0])),s=Number(f[1]),c=Rs(`01-${d<10?`0${d}`:d}-${s}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),S=xs();c.isAfter(S,"month")===!1?j(gs(v,{month:d,year:s})):B("./month_end_close_checks/review")}}}}),[Q,v]),O.useEffect((()=>{V||(Pe(!0),U(F.TENANT_FETCHING)),oe.current?oe.current=!1:!Is(ae,Z)&&y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s){if(xe(f?.userId,f?.zeniSessionId,n.tenantId),d(Ls(!0)),d(ge(n.tenantId)),n.tenantId!=null&&_.clearTenant(n.tenantId),n.tenantId!=null){const c=y.getSignedInUserTenantWithId(n.tenantId);s&&Ae.updateAppLocaleID(Ks(s)),c?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(c?.tenantEmailDomain)}n.userId!=null?X.identify(n.userId,{tenant_id:n.tenantId}):X.resetUserIdentity()})(Z,I,j,Ze))}),[Z,ae,I,j,y]),O.useEffect((()=>{y.isSignedIn()&&(U(F.TENANT_FETCHING),(function(n,f,d,s,c,S,H){if(d==null&&s==null)return void console.warn("There is no current tenant selected!!");const Y=s!=null&&c?.zeniSessionId!=null,os=d==null||d.tenantId!==s,rs=d!=null&&d.excludedResources==null,is=d!=null&&d.externalConnections==null;if(Y&&os){H(ge(s));const q=y.getSignedInUserTenantWithId(s);q?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(q?.tenantEmailDomain),xe(c?.userId,c?.zeniSessionId,s),_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(c.userId,s)))}else Y&&rs&&_.shouldFetchExcludedResources(s)&&(_.markExcludedResourcesFetchStarted(s),H(Ie(c.userId,s))),Y&&is&&_.shouldFetchConnections(s)&&(_.markConnectionsFetchStarted(s),H(Te(c.userId,s)));if(Y){X.identify(c.userId,{tenant_id:s});const q=s==null||s!=null&&(f==="Completed"||f==="Error");n==="Completed"||f!=="Not-Started"&&f!=="Error"||s==null||!_.shouldFetchActiveTenant(s)||(_.markActiveTenantFetchStarted(s),S(F.TENANT_FETCHING),H(ks(c.userId,s,c.zeniSessionId))),q&&(n==="Not-Started"||n==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),H(Re(c.userId,c.zeniSessionId)))}})(A,T,r,v,I,U,j))}),[v,T]),O.useEffect((()=>{y.isSignedIn()&&A==="Completed"&&W.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(Ts(W.tenantsBaseInOrder)),I!=null&&fe(I,r,L,void 0,W.tenantsBaseInOrder))}),[W,A,r,I]),O.useEffect((()=>{T==="In-Progress"&&U(F.TENANT_FETCHING),T!=="Completed"&&T!=="Error"||(T==="Completed"&&v!=null?(C(),_.markActiveTenantFetchCompleted(v)):T==="Error"&&v!=null&&(_.markActiveTenantFetchFailed(v),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),A!=="Completed"&&A!=="Error"||(A==="Completed"?_.markAllTenantsFetchCompleted():A==="Error"&&_.markAllTenantsFetchFailed())}),[T,A,v,V]);const ie=O.useRef(!1);O.useEffect((()=>{!ie.current&&T==="Completed"&&V&&(ie.current=!0,(function(n=Xs,f=3e3){setTimeout((()=>{const d=s=>{if(s>=n.length)return;const c=n[s],S=Qs[c];S!=null?S().then((()=>ee((()=>d(s+1))))).catch((()=>ee((()=>d(s+1))))):d(s+1)};ee((()=>d(0)))}),f)})())}),[T,V]);const w=r?.userRole!=null&&js(r?.userRole),{isFeatureEnabled:Ge}=N($.isReferralFeatureEnabled),$e=r?.userRole!=null&&r.userRole.includes("charge_card_user"),ze=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),P=r?.userRole!=null&&Ee(r.userRole),le=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!w,ue=!Ve&&!w,We=As(p?.loggedInUserRoleMap),Ye=r.externalConnections?.accounting[0]?.isValid,de=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!w,me=ce&&fs(p?.loggedInUserRoleMap),_e=Fe&&!w,qe=Le&&!w,Je=le&&ys(p?.loggedInUserRoleMap),Ke=ue&&Ds(p?.loggedInUserRoleMap),Qe=_e&&bs(p?.loggedInUserRoleMap),Xe=Cs(p?.loggedInUserRoleMap),es=vs(p?.loggedInUserRoleMap),ss=Us(p?.loggedInUserRoleMap),ts=ws(p?.loggedInUserRoleMap),ns=Os(p?.loggedInUserRoleMap),E=Ps(p?.loggedInUserRoleMap),R=Fs(p?.loggedInUserRoleMap),he=le&&E,pe=ce&&R,x=_e&&ss,g=qe&&ts,m=ue&&ns,as=r.excludedResources?.resources?.find((n=>n.resource==="/invites"))!=null||Me===!0||We===!0||Xe===!0||es===!0;return y.isSignedIn()?v==null?A==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}):(I!=null&&A!=="In-Progress"&&j(Re(I.userId,I.zeniSessionId)),null):T!=="In-Progress"&&T!=="Not-Started"||A==="Completed"?(de===!0||se&&!re)&&Ye===!1&&h===!1&&J===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!V||de!==!1||re||se?V&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(p.loggedInUserRoleMap).length>0?e.jsx(Ns,{children:e.jsxs(a,{element:e.jsx(Js,{}),children:[e.jsx(a,{path:"/",element:e.jsx(It,{isDashboardAccess:P,showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(a,{path:"dashboard/*",element:P?e.jsx(it,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reports/*",element:P?e.jsx(et,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"people/*",element:as||P?e.jsx(tt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"forecast/*",element:P?e.jsx(nt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"onboarding/*",element:e.jsx(at,{})}),e.jsx(a,{path:"transaction/*",element:P&&w===!1||$e||ze?e.jsx(rt,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"transactions/*",element:P&&w===!1?e.jsx(ct,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"customer/*",element:P&&w===!1?e.jsx(ye,{entityType:"customer"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:g,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"vendor/*",element:P&&w===!1?e.jsx(ye,{entityType:"vendor"}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"tasks",element:e.jsx(gt,{})}),e.jsx(a,{path:"tasks/*",element:e.jsx(Rt,{})}),e.jsx(a,{path:"address/*",element:Je||me||Qe||Ke?e.jsx(st,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"checking/*",element:x?e.jsx(ut,{}):e.jsx(b,{})}),e.jsx(a,{path:"treasury/*",element:g?e.jsx(dt,{}):e.jsx(b,{})}),e.jsx(a,{path:"performance",element:te===!0?e.jsx(ht,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"month_end_close_checks/review/*",element:te===!0&&w===!1?e.jsx(pt,{}):e.jsx(Oe,{tenantEmailDomain:i})}),e.jsx(a,{path:"notifications/*",element:e.jsx(_t,{})}),e.jsx(a,{path:"vendors/*",element:Ne?e.jsx(ot,{}):e.jsx(b,{})}),e.jsx(a,{path:"bill/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"bills/*",element:he?e.jsx(De,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursement/*",element:pe?e.jsx(be,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"reimbursements/*",element:pe?e.jsx(be,{}):e.jsx(D,{showZeniAccountRoute:x,isUserHasBillPayAccess:E,isUserHasReimbursementAccess:R,showTreasuryRoute:g,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(a,{path:"settings/*",element:Se?e.jsx(lt,{hasAdminLevelAccess:me}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Ce,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"cards/*",element:m?e.jsx(mt,{}):e.jsx(b,{})}),e.jsx(a,{path:"rewards/*",element:Ge?e.jsx(Et,{}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(b,{})}),e.jsx(a,{path:"/ai-cfo/:session_id",element:M?e.jsx(xt,{isFileUploadEnabled:K}):e.jsx(b,{})}),e.jsx(a,{path:"*",element:e.jsx(b,{})})]})}):null:(o(void 0),e.jsx(u,{to:"onboarding",replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...z.state,message:"...",origin:z.pathname}}))}const It=({isDashboardAccess:o,showZeniAccountRoute:j,isUserHasBillPayAccess:B,isUserHasReimbursementAccess:i,showTreasuryRoute:L,isTenantBankingOnly:U,isTenantCardsOnly:C,showChargeCardRoute:k})=>{if(U===!0){if(j)return e.jsx(u,{to:"checking"});if(L)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return C===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):j?e.jsx(u,{to:"checking"}):L?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):B?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},D=({showZeniAccountRoute:o,isUserHasBillPayAccess:j,isUserHasReimbursementAccess:B,showTreasuryRoute:i,isTenantBankingOnly:L,showChargeCardRoute:U,tenantEmailDomain:C})=>{if(L===!0){if(o)return e.jsx(Ue,{tenantEmailDomain:C});if(i)return e.jsx(ve,{tenantEmailDomain:C});if(U)return e.jsx(we,{tenantEmailDomain:C})}return o?e.jsx(Ue,{tenantEmailDomain:C}):i?e.jsx(ve,{tenantEmailDomain:C}):U?e.jsx(we,{tenantEmailDomain:C}):j?e.jsx(jt,{tenantEmailDomain:C}):B?e.jsx(Tt,{tenantEmailDomain:C}):e.jsx(b,{})},Tt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),jt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),ve=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),we=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),Oe=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`});export{D as FallBackRoute,St as default};
|