@zeniai/web-app-ui 5.4.14-dev → 5.4.15-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/{AccountMappingScreen-BZk8jrAP.js → AccountMappingScreen-BjOLn722.js} +2 -2
- package/dist/assets/ActualMatchingMatchDetailScreen-DxeGt00n.js +1 -0
- package/dist/assets/AddressRoutes-wf3jLMp6.js +1 -0
- package/dist/assets/AddressScreen-6MrKOfvb.js +9 -0
- package/dist/assets/AiCfoScreen-D2IsGTI7.js +22 -0
- package/dist/assets/{AppDrawer-BnkAekbe.js → AppDrawer-51tmFCqo.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-2Q-AgKCr.js → BillPayApprovalRoutes-CqcByft0.js} +1 -1
- package/dist/assets/BillPayRoutes-DjTR6LDc.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-C8E7IOrb.js +9 -0
- package/dist/assets/CardsAiCfoScreen-CyjNAzbg.js +14 -0
- package/dist/assets/ChargeCardRoutes-D1jDUnLE.js +71 -0
- package/dist/assets/CompanyPassportScreen-CCrHjEm4.js +1 -0
- package/dist/assets/ConnectionAuthScreen-u25O8YEL.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-DP56g3tx.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-CdWk604C.js +30 -0
- package/dist/assets/{DashboardRoutes-VCRBM_Lo.js → DashboardRoutes-CxVvIZyr.js} +4 -4
- package/dist/assets/{DefaultTenantHome-Bnjp4uin.js → DefaultTenantHome-B1dhRA7X.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-HGMMXsdl.js +18 -0
- package/dist/assets/DrawerScreen-DpM9V-h3.js +1 -0
- package/dist/assets/EntityDetailRoutes-CiWU9eOR.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-C-dPVJak.js → ExpenseAutomationRoutes-BykEoKxY.js} +6 -6
- package/dist/assets/FeaturePreviewScreen-5jpbyDlq.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-B-Qgi5tZ.js +1 -0
- package/dist/assets/{InboxNotificationsProvider-CPjcPE2w.js → InboxNotificationsProvider-CJ59FBLr.js} +1 -1
- package/dist/assets/InvoicingRoutes-DVzjxAr7.js +3 -0
- package/dist/assets/MagicLinkRoutes-BulcIao_.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-B3s3dqD3.js +12 -0
- package/dist/assets/MobileAppDrawer-Diz4hNBc.js +1 -0
- package/dist/assets/NotFoundScreen-l_eBhBHD.js +1 -0
- package/dist/assets/NotificationRoutes-P-tvBMkz.js +1 -0
- package/dist/assets/OAuthConsentScreen-CH9Lv95g.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-D7LURgK7.js +1 -0
- package/dist/assets/{PaymentLinkScreen-B77tcNGP.js → PaymentLinkScreen-BWyxCLTs.js} +5 -5
- package/dist/assets/PeopleRoutes-rbgPpJey.js +22 -0
- package/dist/assets/PerformanceRoutes-CoOModp8.js +1 -0
- package/dist/assets/{Preview-DyDyLMFa.js → Preview-0DfltTWd.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DdhMvyre.js → QBOConnectionScreen-Det19rnQ.js} +2 -2
- package/dist/assets/ReimbursementApprovalRoutes-D5ZwAxEx.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-BQTsJiep.js +1 -0
- package/dist/assets/ReimbursementRoutes-B_5omRv6.js +68 -0
- package/dist/assets/ReportsRoutes-CRvQbciE.js +1 -0
- package/dist/assets/RewardsRoutes-5nWEeQ99.js +1 -0
- package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-ehyhu56d.js +33 -0
- package/dist/assets/ScreenRoutes-Cg0QxFx2.js +2 -0
- package/dist/assets/SettingsRoutes-foH5ZJ3w.js +49 -0
- package/dist/assets/{SetupPagesScreen-CfUfKDWM.js → SetupPagesScreen-CAejgxls.js} +5 -5
- package/dist/assets/SignInScreen-BLMRggvG.js +1 -0
- package/dist/assets/SignOutScreen-6HU69Hwf.js +9 -0
- package/dist/assets/TaskListScreen-BuEk-5wI.js +9 -0
- package/dist/assets/TaskRoutes-C7UfLoX_.js +9 -0
- package/dist/assets/TransactionDetailRoutes-CKuWykLU.js +1 -0
- package/dist/assets/TransactionDetailScreen-D1z9X11O.js +5 -0
- package/dist/assets/TransactionListRoutes-DZvkZnS3.js +1 -0
- package/dist/assets/TreasuryRoutes-Bm4PZ59U.js +37 -0
- package/dist/assets/{VendorsRoutes-DWNg-EPe.js → VendorsRoutes-ThVY1BXz.js} +20 -20
- package/dist/assets/WiseConfirmationScreen-CnXwL3Zk.js +12 -0
- package/dist/assets/{ZeniAccountRoutes-BI00gqox.js → ZeniAccountRoutes-gVqLclSg.js} +11 -11
- package/dist/assets/ZeniAccountStatementScreen-n4s_O46n.js +9 -0
- package/dist/assets/{accountMappingHelper-DPBaxZAX.js → accountMappingHelper-C2thHMMO.js} +1 -1
- package/dist/assets/{analytics-D_VVN36A.js → analytics-WkSvCk9z.js} +4 -4
- package/dist/assets/analyticsHelper-PDBXl7Se.js +1 -0
- package/dist/assets/{core-Cc1CwF93.js → core-DtTeGJWB.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-BhSMetwg.js → decodeURIComponentSafe-Dnku9ZdA.js} +1 -1
- package/dist/assets/{dnd-AdUHoEcy.js → dnd-DR4eaoV-.js} +1 -1
- package/dist/assets/{empty-PD8ivveW.js → empty-BNegk5KG.js} +1 -1
- package/dist/assets/{empty-DhAh77JM.js → empty-DmZnYBE2.js} +1 -1
- package/dist/assets/{emptyVideoElement-BKPO_tn0.js → emptyVideoElement-CGit-XA8.js} +1 -1
- package/dist/assets/{epic-BJGEeb_3.js → epic-C0vaCxPe.js} +1 -1
- package/dist/assets/expenseAutomationHelper-CNcHl26i.js +1 -0
- package/dist/assets/getLocaleForTenant-Bqc2BhMq.js +1 -0
- package/dist/assets/{index-Bp8ijVbG.js → index-BRw-S0Do.js} +1 -1
- package/dist/assets/{index-zmOdoQIt.js → index-B_U4bcDF.js} +14753 -14753
- package/dist/assets/{index-BJg1S6MG.js → index-BoDMWS6Z.js} +2 -2
- package/dist/assets/index-CnQ2Hwrv.js +1 -0
- package/dist/assets/{index-Cxx08j41.js → index-D79Yg4Pa.js} +1 -1
- package/dist/assets/{index-cHP9lO1h.js → index-DQOY5nqW.js} +1 -1
- package/dist/assets/{index-BJ8vYoNR.js → index-X62DPOrd.js} +1 -1
- package/dist/assets/{index-zhmkax0y.js → index-gtxCOQrD.js} +1 -1
- package/dist/assets/{lexical-BRekJTpF.js → lexical-DF0K2978.js} +1 -1
- package/dist/assets/{liveblocks-CM1vcHN_.js → liveblocks-DXlRhlw7.js} +15 -15
- package/dist/assets/{lottie-BXg_FLck.js → lottie-DOEy9FLJ.js} +1 -1
- package/dist/assets/{mui-ehyt9jca.js → mui-UvvMpioS.js} +2 -2
- package/dist/assets/{pathToGoBack-jAeSfAQ9.js → pathToGoBack-CTzkpPUW.js} +1 -1
- package/dist/assets/{pdf-lib-kwPPw7gn.js → pdf-lib-C8URdnXW.js} +1 -1
- package/dist/assets/{pdf-CHwZP-Er.js → pdf-rdPHFveP.js} +4 -4
- package/dist/assets/{plaid-WRjvFkFp.js → plaid-CIpr1Lyg.js} +1 -1
- package/dist/assets/{pusher-C0WLqP6E.js → pusher-DfQYB_JN.js} +1 -1
- package/dist/assets/{react-miDI-z35.js → react-BS0hNTf7.js} +1 -1
- package/dist/assets/{react-CvCXtyEQ.js → react-BTgc9osR.js} +1 -1
- package/dist/assets/{react-CQgMB5FX.js → react-By3kCyTX.js} +1 -1
- package/dist/assets/{react-ZP71p6P6.js → react-CQQuAOkD.js} +1 -1
- package/dist/assets/{react-L2WtUuXe.js → react-DEp3ukzS.js} +1 -1
- package/dist/assets/{react-Bw2LIZU7.js → react-H6WPphNY.js} +1 -1
- package/dist/assets/{recharts-tLFME7sM.js → recharts-VBeTlX07.js} +1 -1
- package/dist/assets/{reportTimeframe-DX5pHUc_.js → reportTimeframe-CAbHy0y8.js} +1 -1
- package/dist/assets/routePaths-DsLddvmS.js +1 -0
- package/dist/assets/{sentry-Bh68thgn.js → sentry-CtZyo70D.js} +2 -2
- package/dist/assets/stripSplatSuffix-DUYOfZtR.js +1 -0
- package/dist/assets/{url-DqRIAQ9M.js → url-DDEUDnJw.js} +4 -4
- package/dist/assets/{url-BTt3PKLo.js → url-ZY4Nz4s5.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-cU8XyJV-.js +1 -0
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-Du9fPfH0.js +1 -0
- package/dist/assets/useAskAiCfoHostNavButtonProps-Rl6Dxu4t.js +1 -0
- package/dist/assets/useChargeCardPusherEvents-CREE1zcc.js +1 -0
- package/dist/assets/{useDeviceId-B4dK-Ywm.js → useDeviceId-CUrjU4ja.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-DfCz3FA3.js +1 -0
- package/dist/assets/useEnsureVendorListLoaded-CoE84-0L.js +1 -0
- package/dist/assets/useInitialThreadRequest-B9aUCLGn.js +1 -0
- package/dist/assets/useTaskManagerAccess-jB_YQM25.js +1 -0
- package/dist/assets/useTaskManagerPusherEvents-UGiOcEas.js +1 -0
- package/dist/assets/{utils-CjDqL2uk.js → utils-Bmb8VI_4.js} +2 -2
- package/dist/assets/withTransactionSidePanel-DCK_khop.js +25 -0
- package/dist/assets/{zeni-epic-state-DFhlE0W3.js → zeni-epic-state-DZFeYKWz.js} +7 -7
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/ActualMatchingMatchDetailScreen-DdqC6TYo.js +0 -1
- package/dist/assets/AddressRoutes-DZnn8xs0.js +0 -1
- package/dist/assets/AddressScreen-DpzckL13.js +0 -9
- package/dist/assets/AiCfoScreen-BuC0DF7-.js +0 -22
- package/dist/assets/BillPayRoutes-CV19o_tt.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-NPjj2cPM.js +0 -9
- package/dist/assets/CardsAiCfoScreen-CadRu1yE.js +0 -14
- package/dist/assets/ChargeCardRoutes-BRNnHx29.js +0 -71
- package/dist/assets/CompanyPassportScreen-d_xThxF-.js +0 -1
- package/dist/assets/ConnectionAuthScreen-B-GQ_uXR.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-Dv-djr6z.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-KQwdDIjg.js +0 -30
- package/dist/assets/DomesticWireDetailScreen-FhF-Oy51.js +0 -18
- package/dist/assets/DrawerScreen-DOVfIfbY.js +0 -1
- package/dist/assets/EntityDetailRoutes-BKu8bIme.js +0 -1
- package/dist/assets/FallBackRoute-BsefzYi4.js +0 -2
- package/dist/assets/FeaturePreviewScreen-CEvvSUOY.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-BRLjqcM8.js +0 -1
- package/dist/assets/InvoicingRoutes-Cn0ho2Ac.js +0 -3
- package/dist/assets/MagicLinkRoutes-DETheAv8.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-hwNEJu9D.js +0 -12
- package/dist/assets/MobileAppDrawer-YElMwyTk.js +0 -1
- package/dist/assets/NotFoundScreen-DD1ftXbM.js +0 -1
- package/dist/assets/NotificationRoutes-j31qfFA3.js +0 -1
- package/dist/assets/OAuthConsentScreen-CQV1J_Nj.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CUitXoy8.js +0 -1
- package/dist/assets/PeopleRoutes-BbZuMgKW.js +0 -22
- package/dist/assets/PerformanceRoutes-D6iGCdx1.js +0 -1
- package/dist/assets/ReimbursementApprovalRoutes-lGHZV1sd.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-CtdOG2XT.js +0 -1
- package/dist/assets/ReimbursementRoutes-DjGiFO3h.js +0 -68
- package/dist/assets/ReportsRoutes-DNhWXb3T.js +0 -1
- package/dist/assets/RewardsRoutes-C0czxWPN.js +0 -1
- package/dist/assets/ScheduleDetailsPrepaidExpensesScreen-CkM33AZC.js +0 -33
- package/dist/assets/ScreenRoutes-DYGYxgwA.js +0 -2
- package/dist/assets/SettingsRoutes-DRSU5I7g.js +0 -49
- package/dist/assets/SignInScreen-DDQ1e38Q.js +0 -1
- package/dist/assets/SignOutScreen-CmYRhks4.js +0 -9
- package/dist/assets/TaskListScreen-D8jqZbNF.js +0 -9
- package/dist/assets/TaskRoutes-Cu7kReic.js +0 -9
- package/dist/assets/TransactionDetailRoutes-B7AzD4hg.js +0 -1
- package/dist/assets/TransactionDetailScreen-CpvJY1a3.js +0 -5
- package/dist/assets/TransactionListRoutes-BejbKDzL.js +0 -1
- package/dist/assets/TreasuryRoutes-DTax48Tc.js +0 -37
- package/dist/assets/WiseConfirmationScreen-C4KbEpAc.js +0 -12
- package/dist/assets/ZeniAccountStatementScreen-BUg2sDXI.js +0 -9
- package/dist/assets/analyticsHelper-DcUdLdtd.js +0 -1
- package/dist/assets/expenseAutomationHelper-CCv2kRkH.js +0 -1
- package/dist/assets/getLocaleForTenant-CSUvt8Gt.js +0 -1
- package/dist/assets/index-foi_vl2g.js +0 -1
- package/dist/assets/routePaths-RxstHRDw.js +0 -1
- package/dist/assets/stripSplatSuffix-B0jus2nC.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-Dr6cKA7B.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CC8PIy8S.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-Bl76c5H-.js +0 -1
- package/dist/assets/useChargeCardPusherEvents-C6oeFa4_.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-nv6tTKw5.js +0 -1
- package/dist/assets/useEnsureVendorListLoaded-zh5PaZPv.js +0 -1
- package/dist/assets/useInitialThreadRequest-DqCJRXyQ.js +0 -1
- package/dist/assets/useTaskManagerAccess-DhT542co.js +0 -1
- package/dist/assets/useTaskManagerPusherEvents-B9F1i19u.js +0 -1
- package/dist/assets/withTransactionSidePanel-BaaDGWl5.js +0 -25
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as _l}from"./liveblocks-
|
|
1
|
+
import{j as _l}from"./liveblocks-DXlRhlw7.js";import{p as te,d as jc,c as an,g as Sl,a as Ol}from"./sentry-CtZyo70D.js";import{L as ge,c1 as xc,fI as kc,UK as Tc,VB as jl,ca as xl}from"./zeni-epic-state-DZFeYKWz.js";import{a as pe,b as kl,c as Tl,d as Al,e as un,f as Rl,g as Pl,h as Il,i as Ve,j as Ac,k as ot,l as xt,m as Ll,o as ct,p as Nl}from"./utils-Bmb8VI_4.js";import{r as cn}from"./empty-DmZnYBE2.js";import{r as $l,a as Ml,b as Cl,c as Dl}from"./pdf-lib-C8URdnXW.js";import{a as Ye,r as Fl}from"./index-X62DPOrd.js";import{r as Ul}from"./index-CnQ2Hwrv.js";import{h as Bl,g as ql,u as Gl,j as _n,l as zl}from"./core-DtTeGJWB.js";import{u as Zl,z as Rc,L as Hl,ai as Vl,aj as Yl,W as Wl,E as Kl}from"./index-B_U4bcDF.js";import"./mui-UvvMpioS.js";import{d as It}from"./decodeURIComponentSafe-Dnku9ZdA.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]="d145d988-d5f0-4c0c-af29-b51c5b17cc84",e._sentryDebugIdIdentifier="sentry-dbid-d145d988-d5f0-4c0c-af29-b51c5b17cc84")}catch{}})();var Sn,On={exports:{}},jn,xn,kn,Tn,An,Rn,Pn,In,Ln,Lt,Nn,$n,Mn,Cn,Dn,Fn,Un,Bn,qn,Gn,zn,Nt,Zn,Hn,Vn,Yn,Wn,Kn,Jn,$t,Xn,Qn,eo,to,ro,no,oo,Mt={exports:{}},Ct={exports:{}},Dt={};function Pc(){if(jn)return Dt;function e(r){return e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},e(r)}function o(r,t){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(i,l){return i.__proto__=l,i},o(r,t)}function h(r){var t=(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 i,l=n(r);if(t){var u=n(this).constructor;i=Reflect.construct(l,arguments,u)}else i=l.apply(this,arguments);return(function(f,b){if(b&&(e(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m})(f)})(this,i)}}function n(r){return n=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},n(r)}jn=1;var c,p,y={};function g(r,t,i){i||(i=Error);var l=(function(u){(function(a,d){if(typeof d!="function"&&d!==null)throw new TypeError("Super expression must either be null or a function");a.prototype=Object.create(d&&d.prototype,{constructor:{value:a,writable:!0,configurable:!0}}),Object.defineProperty(a,"prototype",{writable:!1}),d&&o(a,d)})(m,u);var f,b=h(m);function m(a,d,v){var _;return(function(w,S){if(!(w instanceof S))throw new TypeError("Cannot call a class as a function")})(this,m),_=b.call(this,(function(w,S,N){return typeof t=="string"?t:t(w,S,N)})(a,d,v)),_.code=r,_}return f=m,Object.defineProperty(f,"prototype",{writable:!1}),f})(i);y[r]=l}function s(r,t){if(Array.isArray(r)){var i=r.length;return r=r.map((function(l){return String(l)})),i>2?"one of ".concat(t," ").concat(r.slice(0,i-1).join(", "),", or ")+r[i-1]:i===2?"one of ".concat(t," ").concat(r[0]," or ").concat(r[1]):"of ".concat(t," ").concat(r[0])}return"of ".concat(t," ").concat(String(r))}return g("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),g("ERR_INVALID_ARG_TYPE",(function(r,t,i){var l,u,f;if(c===void 0&&(c=it()),c(typeof r=="string","'name' must be a string"),typeof t=="string"&&(u="not ",t.substr(0,u.length)===u)?(l="must not be",t=t.replace(/^not /,"")):l="must be",(function(m,a,d){return(d===void 0||d>m.length)&&(d=m.length),m.substring(d-a.length,d)===a})(r," argument"))f="The ".concat(r," ").concat(l," ").concat(s(t,"type"));else{var b=(function(m,a,d){return typeof d!="number"&&(d=0),!(d+a.length>m.length)&&m.indexOf(a,d)!==-1})(r,".")?"property":"argument";f='The "'.concat(r,'" ').concat(b," ").concat(l," ").concat(s(t,"type"))}return f+=". Received type ".concat(e(i))}),TypeError),g("ERR_INVALID_ARG_VALUE",(function(r,t){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";p===void 0&&(p=pe());var l=p.inspect(t);return l.length>128&&(l="".concat(l.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(i,". Received ").concat(l)}),TypeError),g("ERR_INVALID_RETURN_VALUE",(function(r,t,i){var l;return l=i&&i.constructor&&i.constructor.name?"instance of ".concat(i.constructor.name):"type ".concat(e(i)),"Expected ".concat(r,' to be returned from the "').concat(t,'"')+" function but got ".concat(l,".")}),TypeError),g("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,t=new Array(r),i=0;i<r;i++)t[i]=arguments[i];c===void 0&&(c=it()),c(t.length>0,"At least one arg needs to be specified");var l="The ",u=t.length;switch(t=t.map((function(f){return'"'.concat(f,'"')})),u){case 1:l+="".concat(t[0]," argument");break;case 2:l+="".concat(t[0]," and ").concat(t[1]," arguments");break;default:l+=t.slice(0,u-1).join(", "),l+=", and ".concat(t[u-1]," arguments")}return"".concat(l," must be specified")}),TypeError),Dt.codes=y,Dt}function Jl(){if(kn)return xn;function e(j,E){var O=Object.keys(j);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(j);E&&(P=P.filter((function(x){return Object.getOwnPropertyDescriptor(j,x).enumerable}))),O.push.apply(O,P)}return O}function o(j){for(var E=1;E<arguments.length;E++){var O=arguments[E]!=null?arguments[E]:{};E%2?e(Object(O),!0).forEach((function(P){h(j,P,O[P])})):Object.getOwnPropertyDescriptors?Object.defineProperties(j,Object.getOwnPropertyDescriptors(O)):e(Object(O)).forEach((function(P){Object.defineProperty(j,P,Object.getOwnPropertyDescriptor(O,P))}))}return j}function h(j,E,O){return(E=c(E))in j?Object.defineProperty(j,E,{value:O,enumerable:!0,configurable:!0,writable:!0}):j[E]=O,j}function n(j,E,O){return E&&(function(P,x){for(var U=0;U<x.length;U++){var L=x[U];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(P,c(L.key),L)}})(j.prototype,E),Object.defineProperty(j,"prototype",{writable:!1}),j}function c(j){var E=(function(O,P){if(l(O)!=="object"||O===null)return O;var x=O[Symbol.toPrimitive];if(x!==void 0){var U=x.call(O,P);if(l(U)!=="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(O)})(j,"string");return l(E)==="symbol"?E:String(E)}function p(j,E){if(E&&(l(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return y(j)}function y(j){if(j===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return j}function g(j){var E=typeof Map=="function"?new Map:void 0;return g=function(O){if(O===null||(P=O,Function.toString.call(P).indexOf("[native code]")===-1))return O;var P;if(typeof O!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(O))return E.get(O);E.set(O,x)}function x(){return s(O,arguments,i(this).constructor)}return x.prototype=Object.create(O.prototype,{constructor:{value:x,enumerable:!1,writable:!0,configurable:!0}}),t(x,O)},g(j)}function s(j,E,O){return s=r()?Reflect.construct.bind():function(P,x,U){var L=[null];L.push.apply(L,x);var A=new(Function.bind.apply(P,L));return U&&t(A,U.prototype),A},s.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 t(j,E){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,P){return O.__proto__=P,O},t(j,E)}function i(j){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},i(j)}function l(j){return l=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},l(j)}kn=1;var u=pe().inspect,f=Pc().codes.ERR_INVALID_ARG_TYPE;function b(j,E,O){return(O===void 0||O>j.length)&&(O=j.length),j.substring(O-E.length,O)===E}var m="",a="",d="",v="",_={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(j){var E=Object.keys(j),O=Object.create(Object.getPrototypeOf(j));return E.forEach((function(P){O[P]=j[P]})),Object.defineProperty(O,"message",{value:j.message}),O}function S(j){return u(j,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function N(j,E,O){var P="",x="",U=0,L="",A=!1,z=S(j),R=z.split(`
|
|
2
2
|
`),I=S(E).split(`
|
|
3
3
|
`),k=0,C="";if(O==="strictEqual"&&l(j)==="object"&&l(E)==="object"&&j!==null&&E!==null&&(O="strictEqualObject"),R.length===1&&I.length===1&&R[0]!==I[0]){var H=R[0].length+I[0].length;if(H<=10){if(!(l(j)==="object"&&j!==null||l(E)==="object"&&E!==null||j===0&&E===0))return"".concat(_[O],`
|
|
4
4
|
|
|
@@ -97,4 +97,4 @@ Found: ${h.toString().split(`
|
|
|
97
97
|
`+ge.from(z,"hex").toString("base64").match(/.{1,64}/g).join(`
|
|
98
98
|
`)+`
|
|
99
99
|
-----END RSA PUBLIC KEY-----
|
|
100
|
-
`}})()(a,d)},m.prototype.getTokenRequest=function(a){const d=new u({token:this.token});return new Promise((v=>{v(this.loadResponse(a))})).then((v=>{if(d.processResponse(v),!d.valid())throw new Error("Response has an Error");return d})).catch((v=>{throw v.authResponse||(v=this.createError(v,d)),v}))},m.prototype.validateToken=function(){if(!this.token.refreshToken())throw new Error("The Refresh token is missing");if(!this.token.isRefreshTokenValid())throw new Error("The Refresh token is invalid, please Authorize again.")},m.prototype.loadResponse=function(a){return g.get(a).then((d=>d))},m.prototype.loadResponseFromJWKsURI=function(a){return g.get(a).then((d=>d))},m.prototype.createError=function(a,d){return d&&d.body!==""?(a.authResponse=d,a.originalMessage=a.message,a.error="","error"in d.getJson()?a.error=d.getJson().error:d.response.statusText?a.error=d.response.statusText:a.message&&(a.error=a.message),a.error_description="","error_description"in d.getJson()?a.error_description=d.getJson().error_description:d.response.statusText&&(a.error_description=d.response.statusText),a.intuit_tid=d.headers().intuit_tid,a):(a.error=d&&d.response.statusText||a.message||"",a.authResponse=d||"",a.intuit_tid=d&&d.headers()&&d.headers().intuit_tid||"",a.originalMessage=a.message||"",a.error_description=d&&d.response.statusText||"",a)},m.prototype.isAccessTokenValid=function(){return this.token.isAccessTokenValid()},m.prototype.getToken=function(){return this.token},m.prototype.setToken=function(a){return this.token=new b(a),this.token},m.prototype.authHeader=function(){const a=`${this.clientId}:${this.clientSecret}`;return typeof btoa=="function"?btoa(a):ge.from(a).toString("base64")},m.prototype.log=function(a,d,v){this.logging&&this.logger.log(a,d+v)},Sc=m})();const rt=Sl(dp),El=(()=>{let e,o,h=!1;return{isInitiated:h,init:(n,c)=>{o=new rt({clientId:
|
|
100
|
+
`}})()(a,d)},m.prototype.getTokenRequest=function(a){const d=new u({token:this.token});return new Promise((v=>{v(this.loadResponse(a))})).then((v=>{if(d.processResponse(v),!d.valid())throw new Error("Response has an Error");return d})).catch((v=>{throw v.authResponse||(v=this.createError(v,d)),v}))},m.prototype.validateToken=function(){if(!this.token.refreshToken())throw new Error("The Refresh token is missing");if(!this.token.isRefreshTokenValid())throw new Error("The Refresh token is invalid, please Authorize again.")},m.prototype.loadResponse=function(a){return g.get(a).then((d=>d))},m.prototype.loadResponseFromJWKsURI=function(a){return g.get(a).then((d=>d))},m.prototype.createError=function(a,d){return d&&d.body!==""?(a.authResponse=d,a.originalMessage=a.message,a.error="","error"in d.getJson()?a.error=d.getJson().error:d.response.statusText?a.error=d.response.statusText:a.message&&(a.error=a.message),a.error_description="","error_description"in d.getJson()?a.error_description=d.getJson().error_description:d.response.statusText&&(a.error_description=d.response.statusText),a.intuit_tid=d.headers().intuit_tid,a):(a.error=d&&d.response.statusText||a.message||"",a.authResponse=d||"",a.intuit_tid=d&&d.headers()&&d.headers().intuit_tid||"",a.originalMessage=a.message||"",a.error_description=d&&d.response.statusText||"",a)},m.prototype.isAccessTokenValid=function(){return this.token.isAccessTokenValid()},m.prototype.getToken=function(){return this.token},m.prototype.setToken=function(a){return this.token=new b(a),this.token},m.prototype.authHeader=function(){const a=`${this.clientId}:${this.clientSecret}`;return typeof btoa=="function"?btoa(a):ge.from(a).toString("base64")},m.prototype.log=function(a,d,v){this.logging&&this.logger.log(a,d+v)},Sc=m})();const rt=Sl(dp),El=(()=>{let e,o,h=!1;return{isInitiated:h,init:(n,c)=>{o=new rt({clientId:Wl.quickbooksKey,clientSecret:"",environment:Yl,redirectUri:window.location.origin+n}),e=o.authorizeUri({state:c,scope:[rt.scopes.Accounting,rt.scopes.OpenId,rt.scopes.Email,rt.scopes.Profile,"project-management.project"]}),h=!0},handleClick:()=>{window.open(e,"_self","noopener")}}})(),mp=zl((function(e){const o=kc(e),h=o?.companyName??"",n=Tc(e).tenantsInOrder.length>1,c=xl(o?.userRole??[]),p=o.externalConnections?.saveConnectionState;return{companyName:h,isGoBackAllowed:n,isAdmin:c,saveConnectionState:p}}),(function(e,o){const{tenantsInOrder:h,navigate:n,currentTenant:c}=o;return{handleOnConnectClick:()=>{El.handleClick()},handleGoBack:()=>{const p=h[0].tenantEmailDomain!==c.tenantEmailDomain?h[0]:h[1];Kl({dispatch:e,navigate:n,pathToNavigate:`/${p.tenantEmailDomain}`,selectedTenant:p,signedInUser:Rc.getSignedInUser()})}}}))(Vl);function yp(e){const o=xc(e,!0).query,h=o.code,n=o.realmId,c=o.state;return{code:h!=null?It(h):"",realmId:n!=null?It(n):"",state:c!=null?It(c):""}}function Rp(){const e=Bl(),o=ql(),h=Gl(),{code:n,realmId:c,state:p}=yp(o.search),{setLoading:y,clearAllLoading:g}=Zl(),s=_n((b=>kc(b))),r=_n((b=>Tc(b).tenantsInOrder)),t=s.externalConnections?.accounting[0],i=t?.connectionType,l=t?.connectionName,u=t?.connectionId??"",f=Rc.getSignedInUser()?.userId??"";return Ol.useEffect((()=>{gp(n,c,p,u,f)===!0&&s.externalConnections?.saveConnectionState!=="In-Progress"?(y(Hl.CONNECTION_AUTH),h(jl(s.tenantId,{connection_type:i??"accounting",connection_name:l??"quickbooks_online",authorization_code:n,realm_id:c,connection_id:u,user_id:f},xc(window.location.origin+"/connection/auth"),s.companyId)),e(o.pathname)):(g(),El.init("/connection/auth",s.tenantEmailDomain))}),[n,c,p,u,f,s.tenantId,s.companyId,s.externalConnections?.saveConnectionState,o.pathname]),_l.jsx(mp,{navigate:e,tenantsInOrder:r,currentTenant:s})}const gp=(e,o,h,n,c)=>e!=""&&o!=""&&h!=""&&n!=null&&n!=""&&c!=null&&c!="";export{Rp as Q,yp as g,gp as h,El as q};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-DXlRhlw7.js";import q from"./NotFoundScreen-l_eBhBHD.js";import{a as p}from"./sentry-CtZyo70D.js";import{h as C,g as D,u as k,j as u,N as V,l as O,n as z,o as g}from"./core-DtTeGJWB.js";import{fI as E,_9 as h,_r as w,Oi as U,Oe as L,Oh as f,O7 as N,_Q as B,Ob as K,Ok as Q}from"./zeni-epic-state-DZFeYKWz.js";import{z as _,w as T,cb as F,q as $,bU as G,cc as H}from"./index-B_U4bcDF.js";import"./mui-UvvMpioS.js";import{u as J}from"./useEnsureVendorListLoaded-CoE84-0L.js";import{R as x}from"./ReimbursementApprovalRuleDetailScreen-BQTsJiep.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]="11e1750f-0127-4724-9b7a-7df2120a105d",e._sentryDebugIdIdentifier="sentry-dbid-11e1750f-0127-4724-9b7a-7df2120a105d")}catch{}})();const j="reimbursement-approval-rule-update",M=O((function(e){return{approvalView:h(e),remiSetupApproverViewUpdateData:w(e).remiSetupApproverViewUpdateData}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!1))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))}}}))(T(F)),P=({isLoading:e})=>{const s=C(),n=D(),a=k(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),S=u((o=>o.remiSetupApproverViewState.fetchState)),c=u((o=>E(o))),d=u((o=>h(o))),b=u((o=>w(o).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{b?.updateStatus.fetchState==="Completed"&&a(U())}),[b]),p.useEffect((()=>{t||S!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!1)))}),[t,S,e,a]),_.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{d.allApprovalRules.length===0&&d.fetchState==="Completed"&&(v||(R(!0),a(f())),s("./new"))}),[v,d,a]);const m={events:c.companyId!=null?[`private-encrypted-${c.companyId}.${j}`]:[],eventCallback:(o,y,I)=>{o.endsWith(j)&&I.onApprovalRulesEventReceived(o)}};return c?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(V,{to:"../../promo"}):r.jsx(M,{currentTenant:c,location:n,navigate:s,...m})},A="reimbursement-approval-rule-update",X=O((function(e){const s=h(e),n=w(e).remiSetupApproverViewUpdateData,a={};for(const l of Object.values(e.vendorState.vendorByID))l?.id!=null&&(a[l.id]=l.name);const t={};for(const l of Object.values(e.classState.classesByKey))l?.classId!=null&&(t[l.classId]=l.className);return{approvalView:s,remiSetupApproverViewUpdateData:n,vendorNamesById:a,departmentNamesById:t}}),(function(e,s){const{navigate:n,location:a}=s;return{onApprovalRulesEventReceived:t=>{t.endsWith(A)&&e(B(!1))},onBackClick:()=>{$(a)?n("../../"):n("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(N(t,!0))},onEditRuleClick:t=>{t!=null?(e(f(t)),n(`./${t}/edit`)):(e(f()),n("./new"))},onReorderRules:t=>{e(Q(t,!0))}}}))(T(H)),Y=()=>{const e=u((a=>E(a))),{isApprovalRulesV3Enabled:s,isLoading:n}=G(e?.tenantId);return s?r.jsx(Z,{isLoading:n}):r.jsx(P,{isLoading:n})},Z=({isLoading:e})=>{const s=C(),n=D(),a=k(),[t,l]=p.useState(!1),[v,R]=p.useState(!1),[S,c]=p.useState(!1),d=u((i=>i.remiSetupApproverViewState.fetchState)),b=u((i=>i.remiSetupApproverViewState.approverListState.fetchStatus.fetchState)),m=u((i=>E(i))),o=u((i=>h(i)));J();const y=u((i=>w(i).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{y?.updateStatus.fetchState==="Completed"&&a(U())}),[y]),p.useEffect((()=>{t||d!=="Not-Started"||e||(l(!0),a(L(!0,!1,!1,!0)))}),[t,d,e,a]),p.useEffect((()=>{v||b!=="Not-Started"||e||(R(!0),a(K(!1,!0)))}),[v,b,e,a]),_.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{o.allApprovalRules.length===0&&o.fetchState==="Completed"&&(S||(c(!0),a(f())),s("./new"))}),[S,o,a]);const I={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${A}`]:[],eventCallback:(i,ee,W)=>{i.endsWith(A)&&W.onApprovalRulesEventReceived(i)}};return m?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(V,{to:"../../promo"}):r.jsx(X,{currentTenant:m,location:n,navigate:s,isLoading:e,...I})};function ue(){return r.jsxs(z,{children:[r.jsx(g,{path:"/",element:r.jsx(Y,{})}),r.jsx(g,{path:"/new",element:r.jsx(x,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(x,{})}),r.jsx(g,{path:"*",element:r.jsx(q,{})})]})}export{ue as R};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as g}from"./liveblocks-DXlRhlw7.js";import{a as y}from"./sentry-CtZyo70D.js";import{h as T,u as x,g as C,i as V,j as R,l as k}from"./core-DtTeGJWB.js";import{_r as _,_9 as O,Oa as j,On as B,Oi as A,Oj as E,_s as F,fI as K,Oh as L}from"./zeni-epic-state-DZFeYKWz.js";import{z as N,a5 as P,c2 as W,q,bU as G,c3 as H}from"./index-B_U4bcDF.js";import{u as $}from"./mui-UvvMpioS.js";import{u as J}from"./useEnsureVendorListLoaded-CoE84-0L.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="58dafbb9-265f-4956-94e8-b91ec87f4129",e._sentryDebugIdIdentifier="sentry-dbid-58dafbb9-265f-4956-94e8-b91ec87f4129")}catch{}})();const M=k((function(e,p){const t=_(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=o==="approval_create"&&t.allApprovalRules.length!==0;let i=t.allApprovalRules.length===0;return p.approvalRuleId&&(i=t.allApprovalRules.findIndex((r=>r.approvalRuleId===p.approvalRuleId))===0),{localData:t,hideUpperBoundField:s,isLowerBoundDisabled:i,approvalUpdateActionType:o}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=q(p.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const I=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),b=u.actors.selectedNonUsers.map((m=>{const f=(S=m.value,F(S)==null);var S;return{type:f?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!f}})),c=I.concat(b);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:i,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(W);function Q(){const e=T(),p=x(),t=C(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=$(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(y.useEffect((()=>{a||(d(!0),p(j(!0)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(M,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t})}function se(e){return F(e)==null}const X=k((function(e,p){const t=_(e),o=t.remiSetupApproverViewUpdateData?.type??"approval_create",s=[],i={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(s.push(r.id),i[r.id]=r.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:s,vendorNamesById:i,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:O(e).allApprovalRules}}),(function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:s,approvalRuleId:i}=p,r=o.remiSetupApproverViewUpdateData?.type,l=q(p.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((f=>{const S=f.actorKind?.selectedOption,z=f.selectedRole?.selectedNonUsers??[];let D=[];S==="role"?D=z.map((w=>({type:"attribute",subType:w.value,userId:void 0,idType:void 0,isImplicitActor:!1}))):S==="specific_person"&&(D=(f.persons?.selectedUsers??[]).map((w=>({type:"user",subType:void 0,userId:w.userId,idType:"user",isImplicitActor:!1}))));const U=f.action??"require_approval";m.push({action:U,actors:D,operator:D.length>1?U==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const I=v?.selection.selectedOptions??[];I.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:I});const b=h?.selection.selectedOptions??[];if(b.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:b}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:i,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||l?t("../"):s.allApprovalRules.length===0&&s.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(L(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(H);function ne(){const e=R((t=>K(t))),{isApprovalRulesV3Enabled:p}=G(e?.tenantId);return p?g.jsx(Y,{}):g.jsx(Q,{})}function Y(){const e=T(),p=x(),t=C(),{approvalRuleId:o}=V(),s=N.getSignedInUser(),i=$(),r=R((n=>_(n))),l=R((n=>O(n))),[a,d]=y.useState(!1);if(J(),y.useEffect((()=>{a||(d(!0),p(j(!1)))})),y.useEffect((()=>{l.fetchState==="Not-Started"&&e(o!=null?"../../":"../")}),[l,o]),s==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?g.jsx(P,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:i.colors.grey5}}):g.jsx(X,{navigate:e,approvalUpdateDataView:r,approvalRuleId:o,approverViewData:l,location:t},o??"new")}export{ne as R,se as i};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-DXlRhlw7.js";import{u as ae,j as v,h as K,g as Q,i as ie,N,l as ee,q as lt,n as mt,o as x}from"./core-DtTeGJWB.js";import{fI as H,Oe as ct,$W as ge,ca as he,Nk as Fe,me as dt,Nz as ce,Ny as de,$X as ut,bn as fe,gZ as Le,$Y as pt,XG as bt,m3 as $e,XH as Ae,XI as gt,kR as ht,ZX as ft,l4 as St,N8 as It,CE as yt,kY as Rt,NV as Ne,$Z as Pe,$_ as Ce,$$ as kt,a00 as vt,a01 as At,NF as we,la as Ct,_4 as wt,Nx as Et,Ni as xt,a02 as Bt,Nh as Tt,a03 as Dt,Np as Ee,NJ as jt,NI as Ut,NE as Ft,a04 as _e,T3 as Lt,bo as $t,Ns as Nt,Ob as Pt,a05 as _t,a06 as Mt,NR as Ot,NO as xe,Zr as zt,Nf as Zt,a07 as Me,OE as Be,OM as Gt,a08 as Vt,a09 as X,a0a as Ht,a0b as Oe,a0c as Wt,a0d as ze,a0e as Ze,O1 as ue,bv as qt,bM as Se,cO as Ie,e1 as Ge,e0 as Ve,a0f as Xt,gk as Jt,ZE as Qt,a0g as Yt,a0h as He,ZI as Kt,_r as en,a0i as tn,_Q as nn,OJ as Te,OI as an,a0j as sn,a0k as on,a0l as rn,a0m as ln,a0n as mn,_a as cn,Oz as dn,OD as un,bq as pn,bL as bn,cI as gn,cw as hn,bu as fn,V3 as Sn,dc as In,df as yn,de as Rn,cH as kn}from"./zeni-epic-state-DZFeYKWz.js";import{bU as vn,c as We,$ as qe,p as oe,d as F,z as L,cT as Xe,a6 as re,k as E,aQ as De,H as j,ac as se,ad as An,G as Je,cU as Cn,l as J,aq as Qe,cV as wn,V as le,cW as En,ao as xn,a9 as Bn,a5 as ye,O as Ye,w as Tn,bC as Dn,at as jn,ag as Un,cX as Fn,h as Ln}from"./index-B_U4bcDF.js";import{n as P,S as $n,u as Ke}from"./mui-UvvMpioS.js";import pe from"./NotFoundScreen-l_eBhBHD.js";import{S as je}from"./SetupPagesScreen-CAejgxls.js";import{F as et}from"./FeaturePreviewScreen-5jpbyDlq.js";import{a as g}from"./sentry-CtZyo70D.js";import{u as Re}from"./useAskAiCfoHostNavButtonProps-Rl6Dxu4t.js";import{u as tt}from"./useInitialThreadRequest-B9aUCLGn.js";import{D as Nn}from"./DrawerScreen-DpM9V-h3.js";import{M as nt}from"./MobileAppDrawer-Diz4hNBc.js";import{F as Pn}from"./ScreenRoutes-Cg0QxFx2.js";import{R as _n}from"./ReimbursementApprovalRoutes-D5ZwAxEx.js";import"./recharts-VBeTlX07.js";import"./analytics-WkSvCk9z.js";import"./plaid-CIpr1Lyg.js";import"./dnd-DR4eaoV-.js";import"./stripe-cKAAJElX.js";import"./lottie-DOEy9FLJ.js";import"./lexical-DF0K2978.js";import"./pdf-rdPHFveP.js";import"./utils-Bmb8VI_4.js";import"./BusinessVerificationPageScreen-C8E7IOrb.js";import"./routePaths-DsLddvmS.js";import"./analyticsHelper-PDBXl7Se.js";import"./InboxNotificationsProvider-CJ59FBLr.js";import"./useTaskManagerAccess-jB_YQM25.js";import"./getLocaleForTenant-Bqc2BhMq.js";import"./useEnsureVendorListLoaded-CoE84-0L.js";import"./ReimbursementApprovalRuleDetailScreen-BQTsJiep.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]="dd610dde-6d4c-469c-a03f-b8b402489b4e",e._sentryDebugIdIdentifier="sentry-dbid-dd610dde-6d4c-469c-a03f-b8b402489b4e")}catch{}})();const at=e=>`/${e}/reimbursements`,Mn=e=>g.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},g.createElement("path",{d:"M12.5 3.5L3.5 12.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),g.createElement("path",{d:"M12.5 12.5L3.5 3.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})),{common:q,spendManagement:{reimbursement:{reimbursementDetail:ne}}}=Je.getLocalizedStrings(),On=ee((function(e,t){const n=t.currentTenant?.companyId,r=ut(e.plaidAccountViewState,"user_reimbursement_account"),m=L.getSignedInUser(),c=fe(m),d=r.plaidConnectionDetails,i=Le(e.companyState,n),a=e.tenantState.currentTenantId,o={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:a??""},l=ge(e,t.reimbursementId),p=pt(e,m?.userId??"");let I=`${m?.firstName} ${m?.lastName}`,u=!0;t.reimbursementId!=null&&(I=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`,u=m?.userId===l.createdBy?.userId);const T=e.entityAutoCompleteState?.autoCompleteText?.common,y=bt(e,"common");return{remiDetails:l,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,reimbursementId:t.reimbursementId,customerSearchAutoCompleteData:{autoCompleteText:T,entityAutoCompleteView:y},authParams:o,defaultCurrency:{currencySymbol:i?.company.companyLocaleInfo.currencySymbol??"$",currencyCode:i?.company.companyLocaleInfo.currencyCode??"USD"},companyMileageConfigInfo:i?.company.configInfo.mileageRateConfig,createdBy:I,isUserAdmin:he(t.currentTenant?.userRole??[]),isZeniUser:c,plaidConnectionDetails:d,bankNameByRouting:l.bankNameByRouting,bankAccountCreationState:p.bankAccountCreationState,bankAccounts:p.bankAccounts,analytics:E,bankAccountToCreate:l.bankAccountToCreate,fetchBankNameByRoutingStatus:l.fetchBankNameByRoutingStatus,isSignedInUserReimbursementCreator:u,disableInternalOverlay:t.disableInternalOverlay,showSkipAutoFill:t.showSkipAutoFill,setShowSkipAutoFill:t.setShowSkipAutoFill,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:m,navigate:c,themeState:d}=t,{tenantEmailDomain:i}=r,a=L.getSignedInUser();return{onReceiptsUpload:(o,l,p)=>{o!=null&&e(de(o,l,p,n,a?.userId))},onExistingMerchantChange:(o,l)=>{e(Ee(!1,l,n,o,void 0))},fetchDuplicateReimbursement:()=>{a?.userId!=null&&e(Ft(a.userId,!0,n))},clearDuplicateReimbursementDetail:()=>{e(Ut())},clearRemiSaveStatus:()=>{e(jt("Not-Started",n))},onDuplicateLineClick:(o,l)=>window.open(`/${i}/reimbursement/${o}#L${l}`),onNewMerchantChange:(o,l)=>{e(Ee(!1,l,n,void 0,o))},removeFileFromLine:o=>{e(Dt({lineId:o,reimbursementId:n}))},onAmountChanged:(o,l)=>{e(Tt(l,o,n))},updateReimbursementType:(o,l,p)=>{e(Bt({reimbursementId:p,lineId:l,reimbursementType:o}))},onHomeCurrencyConversionUpdate:(o,l,p)=>{e(xt({reimbursementId:p,lineId:l,amountPayload:{amount:o.amount,currency_code:o.currencyCode,currency_symbol:o.currencySymbol}}))},onReimbursementDetailsChanged:o=>{e(Et({remiDetailLocalData:o,reimbursementId:n}))},saveRemiDetails:o=>{e(we(o,!1,n))},onUserBankDetailsUpdated:o=>{const{bankAccountSection:l}=o;e(wt({data:l}))},onFetchBankName:o=>{e(Ct(o))},submitRemiDetails:()=>{e(we("pending_approval",!0,n))},discardReimbursementDetailsFromLocalStore:o=>{e(Ce({reimbursementId:o}))},updateInvoiceUploadFetchState:o=>{e(ce({reimbursementId:n,fetchState:o}))},clearTentativeNameForLine:o=>{e(At({reimbursementId:n,lineId:o}))},removeDuplicateReimbursementForLine:o=>{e(vt({lineId:o}))},onZeniLogoClick:()=>{d.toggle()},clearAddRemiAutoFields:o=>{e(kt({reimbursementId:n,lineId:o}))},redirectToReimbursementListScreen:()=>{e(Pe()),e(Ce({}));const o=at(i),l=J(m.state?.pathnameStackToGoBack,m.pathname);c(o,{state:{pathnameStackToGoBack:l}})},redirectToReimbursementDetailScreen:()=>{t.navigate("../")},deleteReimbursement:()=>{n!=null&&(E.trackReimbursementDeleteReimbursement(n),e(Ne(n)))},onSaveBankAccount:()=>{a?.userId&&e(Rt(a?.userId,n))},onFetchLinkTokenClick:o=>{e(yt("user_reimbursement_account",o))},onEstablishConnectionClick:o=>{e(It(o,r.companyId,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))},deleteBankAccount:o=>{e(St(o,a?.userId??""))},onBackClickFromBankAccountPage:()=>{e(ht({fetchState:"Not-Started"})),e(ft())},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,l)=>{o.trim().length>=2?e(gt({searchString:o,entityType:l,searchOrigin:"common"})):e(Ae("common"))},onCancelAutoComplete:()=>{e(Ae("common"))}}}}))(Cn);function Ue(){const e=K(),t=ae(),n=Q(),{reimbursementId:r}=ie(),m=We(),c=qe(),d=g.useRef(!1),[i,a]=g.useState(r==null),[o,l]=g.useState(1),{useFeatureGate:p}=oe(),{isFeatureEnabled:I}=p(F.isLimitedCategoryForReimbursement),{isFeatureEnabled:u}=p(F.isShowDeletedReimbursementsFeatureEnabled),{isAiCfoAccessEnabled:T,onAskAiCfoClick:y}=Re({mobileExploreReferrer:"Reimbursement Details"}),B=Q().pathname,D=B.includes("edit"),A=B.includes("reimbursement/new"),[C,R]=g.useState(!1),S=L.getSignedInUser(),w=v((b=>H(b))),h=v((b=>ge(b,r))),$=tt(w?.companyId,{clearParams:h.fetchState==="Completed"}),U=he(w?.userRole??[]);(function(){const b=ae(),M=v((Y=>H(Y))),O=M?.tenantId,{isApprovalRulesV3Enabled:z,isLoading:W}=vn(O),Z=v((Y=>Y.remiSetupApproverViewState.fetchState));g.useEffect((()=>{O==null||W||Z==="Not-Started"&&b(ct(!0,!1,!1,z))}),[O,W,z,Z,b])})(),g.useEffect((()=>{(A&&!C||D&&!C&&h.fetchState!="Completed"&&h.fetchState!="In-Progress")&&(R(!0),t(Fe(!1,I,u,r)))}));const k=v((b=>dt(b.accountState,b.accountListState,"reimbursementAccountList")));if(S==null)throw Error("Can't access address page without signing in...");const _={pathname:`../${r}`,search:n.search};return h.fetchState==="Completed"&&(d.current=!0),h.isDeleted===!0||h.billStage=="paid"||h.billStage=="scheduled"||d.current===!1&&h.fetchState==="Not-Started"||U&&h.billStatus==="rejected"||U===!1&&h.billStage==="pending_approval"&&h.billStatus!=="rejected"?s.jsx(N,{to:_}):d.current!==!1||h.deleteStatus.fetchState!=="In-Progress"&&h.fetchState==="Completed"?s.jsxs(zn,{windowSize:c,children:[s.jsx(re,{analytics:E,onLoad:b=>(M=>{r!=null&&h.deleteStatus.fetchState!=="Completed"&&M.trackReimbursementEditReimbursement(r)})(b)}),i&&c!=="small"?s.jsx(Zn,{}):null,i&&c!=="small"?s.jsx(Gn,{children:s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:"78px",paddingRight:j.sp3,paddingBottom:"15px",paddingLeft:j.sp5},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})}):null,i&&c==="small"?s.jsxs(Vn,{children:[s.jsx(Hn,{onClick:()=>a(!1),children:s.jsx(Mn,{})}),s.jsx(De,{showAutofill:i,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:{userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:w?.tenantId??""},onSkipAutofill:()=>a(!1),onInvoiceUpload:b=>{b!=null&&t(de(b,o,!0,r,S?.userId))},updateInvoiceUploadFetchState:b=>{t(ce({reimbursementId:r,fetchState:b}))},allowMultiFiles:i,showInfoText:!1,type:"reimbursement",style:{width:"100%",paddingTop:j.sp5,paddingRight:j.sp3,paddingBottom:j.sp5,paddingLeft:j.sp3},dropFilePlaceholder:{upload:q.upload,single:ne.dropReceipt.single,or:q.texts.or,multiple:ne.dropReceipt.multiple,receipts:q.texts.receipts2}})]}):null,s.jsx(Wn,{windowSize:c,children:s.jsx(On,{initialOpenThreadRequest:$??void 0,location:n,navigate:e,currentTenant:w,reimbursementId:r,themeState:m,uncategorizedAccounts:k,disableInternalOverlay:!0,showSkipAutoFill:i,setShowSkipAutoFill:a,onCurrentLineIdForUploadChange:l,isAiCfoAccessEnabled:T,onAskAiCfoClick:y})})]}):s.jsx(Xe,{isNewReimbursement:r==null})}const zn=P.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
position: relative;
|
|
4
|
+
height: 100vh;
|
|
5
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
6
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
7
|
+
`,Zn=P.div`
|
|
8
|
+
position: fixed;
|
|
9
|
+
top: 0;
|
|
10
|
+
left: 0;
|
|
11
|
+
right: 0;
|
|
12
|
+
bottom: 0;
|
|
13
|
+
background-color: ${An.overlayBackgroundBlack};
|
|
14
|
+
z-index: 5;
|
|
15
|
+
`,Gn=P.div`
|
|
16
|
+
position: absolute;
|
|
17
|
+
top: 0;
|
|
18
|
+
left: 0;
|
|
19
|
+
width: 42%;
|
|
20
|
+
height: 100%;
|
|
21
|
+
z-index: 6;
|
|
22
|
+
display: flex;
|
|
23
|
+
background-color: transparent;
|
|
24
|
+
overflow: hidden;
|
|
25
|
+
`,Vn=P.div`
|
|
26
|
+
position: fixed;
|
|
27
|
+
top: 0;
|
|
28
|
+
left: 0;
|
|
29
|
+
right: 0;
|
|
30
|
+
bottom: 0;
|
|
31
|
+
z-index: 11;
|
|
32
|
+
display: flex;
|
|
33
|
+
flex-direction: column;
|
|
34
|
+
overflow-y: auto;
|
|
35
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
36
|
+
`,Hn=P.button`
|
|
37
|
+
align-self: flex-end;
|
|
38
|
+
background: none;
|
|
39
|
+
border: none;
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
padding: ${j.sp2} ${j.sp3};
|
|
42
|
+
line-height: 1;
|
|
43
|
+
color: ${e=>e.theme.colors.hero};
|
|
44
|
+
&:hover {
|
|
45
|
+
color: ${e=>e.theme.colors.primary};
|
|
46
|
+
}
|
|
47
|
+
svg {
|
|
48
|
+
width: ${j.sp4};
|
|
49
|
+
height: ${j.sp4};
|
|
50
|
+
}
|
|
51
|
+
`,Wn=P.div`
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
width: 100%;
|
|
55
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
56
|
+
`,qn=ee((function(e,t){const n=_e(e,t.reimbursementId),r=L.getSignedInUser(),m=fe(r),c=e.tenantState.currentTenantId,d={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:c??""},i=`${n.createdBy?.firstName??"Zeni"} ${n.createdBy?.lastName??""}`;let a=!1;n?.remiActivities.length>0&&(a=_t(n.remiActivities,Mt(t.currentTenant),r));const o=he(t.currentTenant?.userRole??[]),l=r?.userId===n.createdBy?.userId;return{remiDetails:n,uploadInvoiceEndPoint:`${se.communicationAgentMicroServiceBaseUrl}`,authParams:d,signedInUser:r,createdBy:i,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,isAdmin:o,showApproveRejectBtns:a,isZeniUser:m,isSignedInUserReimbursementCreator:l,isAccountingClassesEnabled:$e(e)}}),(function(e,t){const{reimbursementId:n,currentTenant:r,location:m,navigate:c,themeState:d}=t,{tenantEmailDomain:i}=r;return{onDuplicateLineClick:(a,o)=>window.open(`/${i}/reimbursement/${a}#L${o}`),redirectToReimbursementListScreen:()=>{e(Pe());const a=at(i),o=J(m.state?.pathnameStackToGoBack,m.pathname);c(a,{state:{pathnameStackToGoBack:o}})},onSaveRealTimeApprovals:a=>{e(Zt(n,"reimbursement",a))},updateEditRealTimeApproverClicked:a=>{e(zt({isEdit:a,entityId:n,entityType:"reimbursement"}))},approveOrRejectRemi:a=>{a.type==="approved"?e(xe(n,a.type,"")):e(xe(n,a.type,a.description??""))},redirectToEditableReimbursementScreen:()=>{const a=J(m.state?.pathnameStackToGoBack,m.pathname);c("./edit",{state:{pathnameStackToGoBack:a}})},deleteReimbursement:()=>{E.trackReimbursementDeleteReimbursement(n),e(Ne(n))},cancelAndDeleteReport:a=>{a===!0?E.trackReimbursementCancelAndDeleteReimbursement(n):E.trackReimbursementCancelReimbursement(n),e(Ot(n,a))},handleZeniLogoClick:()=>{d.toggle()}}}))(wn);function Xn(){const e=K(),t=ae(),n=Q(),r=n.hash.substring(1),m=We(),{reimbursementId:c}=ie(),d=L.getSignedInUser(),i=v((k=>H(k))),a=v((k=>_e(k,c??""))),o=a.remiDetails?.reimbursementInfo.stage.code==="draft",l=tt(i?.companyId,{clearParams:a.fetchState==="Completed"&&!o}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:I}=Re({mobileExploreReferrer:"Reimbursement Details"});Qe({isDataReady:a.fetchState==="Completed"});const{useFeatureGate:u}=oe(),{isFeatureEnabled:T}=u(F.isLimitedCategoryForReimbursement),[y,B]=g.useState(!1),[D,A]=g.useState(!1),[C,R]=g.useState(!1),{isFeatureEnabled:S}=u(F.isShowDeletedReimbursementsFeatureEnabled),w=v((k=>ge(k,c??""))),h=Lt(i),$=$t(i.userRole),U=a.fetchState;if(g.useEffect((()=>{y||c==null?y==1&&U==="Error"&&e("page-not-found",{replace:!0}):(B(!0),t(Nt(c,!1,S)))}),[y,c,t,U]),g.useEffect((()=>{S&&a.remiDetails?.isDeleted===!0||i.isZeni===!0&&d?.userEmailDomain==="zeni.ai"&&h===!1?R(!1):R(a.remiActivities[0]?.isRealTimeApprovalEnabled&&($||a.allApprovers.find((k=>k.user.userId===d?.userId))!=null||a.remiDetails?.lastUpdatedBy===d?.userId))}),[a.remiActivities[0]?.isRealTimeApprovalEnabled,a.allApprovers,a.remiDetails?.lastUpdatedBy,$,i.isZeni,h,d]),g.useEffect((()=>{D||a.fetchState!="Completed"||a.remiDetails?.reimbursementInfo.stage.code=="paid"||a.remiDetails?.reimbursementInfo.stage.code=="scheduled"||w.fetchState=="Completed"||w.fetchState=="In-Progress"||(A(!0),t(Fe(!1,T,S,c)),a.remiActivities[0]?.isRealTimeApprovalEnabled===!0&&t(Pt(!1,!0,!0,a.lastUpdatedByUserId)))}),[D,a,c,t]),d==null)throw Error("Can't access address page without signing in...");return a.remiDetails?.reimbursementInfo.stage.code=="draft"&&w.fetchState=="Completed"&&a.remiDetails.isDeleted===!1?s.jsx(N,{to:`./edit${n.search}`}):a.deleteStatus.fetchState==="In-Progress"||a.cancelAndDeleteStatus.fetchState==="In-Progress"||a.remiDetails?.reimbursementInfo.stage.code=="draft"&&w.fetchState!="Completed"||a.fetchState!="Completed"?s.jsx(Xe,{}):s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:E,onLoad:k=>(_=>{c!=null&&_.trackReimbursementReimbursementDetails(c)})(k)}),s.jsx(qn,{initialOpenThreadRequest:l??void 0,scrollId:r,isShowDeletedReimbursementEnabled:S,location:n,navigate:e,isRealTimeApprovalEnabled:C,currentTenant:i,reimbursementId:c??"",themeState:m,isAiCfoAccessEnabled:p,onAskAiCfoClick:I})]})}const Jn=ee((function(e,t){return{remisReviewView:Me(e),analytics:t.analytics}}),(function(e,t){return{onCloseOverlay:()=>{t.navigate(`/${t.tenantEmailDomain}/reimbursements`),e(X())},onCloseReviewItem:n=>{e(Vt(n))},onProceedForBulkActionClick:(n,r)=>{switch(n){case"send_for_approval":e(Gt());break;case"approve":e(Be("approved",r??""));break;case"reject":e(Be("rejected",r??""))}}}}))(En);function Qn({tenantEmailDomain:e}){const t=K(),n=v((d=>d.remisBulkActionViewState.bulkSubmissionFetchState.fetchState)),{remisForReview:r}=v((d=>Me(d))),m=le(),c=m?.loggedInUserRole?.includes("admin")===!0;return g.useEffect((()=>{n!=="Completed"&&r.length!==0||t(`/${e}/reimbursements`)}),[n,r.length,e]),s.jsx(Jn,{navigate:t,analytics:E,isAdmin:c,tenantEmailDomain:e})}const V=Kt(),st="bulk-operation-update",be="reimbursement-approval-rule-update",{spendManagement:Yn,common:me}=Je.getLocalizedStrings(),Kn=Yn.reimbursement.bulkActions,ea=P.div`
|
|
57
|
+
display: flex;
|
|
58
|
+
min-height: 100%;
|
|
59
|
+
width: 100%;
|
|
60
|
+
flex: 1 1 auto;
|
|
61
|
+
flex-direction: column;
|
|
62
|
+
align-items: center;
|
|
63
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
64
|
+
`,ta=ee((function(e,t){const n=Ze(e,V,t.isBulkActionEnabled);let r=n.allSubTabs;const m=L.getSignedInUser(),c=fe(m),d=e.tenantState.currentTenantId,i=H(e),a=i?.companyName??"",o={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:d??""},l=e.remiListState.downloadUIState.downloadState;t.isShowDeletedReimbursementEnabled===!1&&(r=r.filter((u=>u!=="deleted")));const p=n.fetchState,I=en(e);return{transactionList:t.isShowDeletedReimbursementEnabled?n.reimbursements:n.reimbursements.filter((u=>u.isDeleted===!1)),isAdmin:t.isAdmin,isZeniUser:c,allSubTabs:r,isEmployee:t.isEmployee,currentTab:n.currentTab,currentSubTab:n.currentSubTab,approvalCount:n.approvalCount,fetchState:p,botEmail:n.reimbursementBotEmail,analytics:E,uiState:n.uiState,searchText:n.searchText,filters:n.filters,downloadParams:{authParams:o,companyName:a,timePeriod:V,spendManagementEndPoint:`${jn}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:l,isBulkActionAllowed:n.remiListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:n.remiListBulkActionInfo?.remisSelectedForBulkAction,allowedBulkActions:n.remiListBulkActionInfo?.allowedBulkActions,remiApprovalRulesAffectedEntityIds:I.affectedEntityIds}}),(function(e,t){const{navigate:n,currentTenant:r,location:m,period:c}=t,{tenantEmailDomain:d}=r;return{updateTabToState:i=>{e(X()),e(Oe(i))},onSubtabChange:i=>{e(X()),e(ze(i))},onTransactionClick:(i,a)=>{const o=sa(d,i,a),l=J(m.state?.pathnameStackToGoBack,m.pathname);n(o,{state:{pathnameStackToGoBack:l}})},onClickSetupIcon:()=>{const i=aa(d),a=J(m.state?.pathnameStackToGoBack,m.pathname);n(i,{state:{pathnameStackToGoBack:a}})},onAddTransactionClick:()=>{const{tenantEmailDomain:i}=t.currentTenant;E?.trackReimbursementNewReimbursement();const a=`/${i}/reimbursement/new`,o=J(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(a,{state:{pathnameStackToGoBack:o}})},onColumnSortConfigChanged:(i,a)=>{e(mn({uiState:{sortKey:i,sortOrder:a},period:t.period}))},onSearchTextChanged:i=>{e(ln(i))},onFiltersChange:i=>{e(rn({filters:i})),i.categories.every((a=>a.field!=null&&a.values?.length!==0))&&E.trackSpendManagmentFilterChange("reimbursement",i.categories.map((a=>`${a.field}-${JSON.stringify(a.values)}`)))},updateDownloadStateHandler:i=>{i==="In-Progress"&&E.trackSpendManagementDownloadClick("reimbursement"),e(on({uiState:{downloadState:i}}))},onReloadTransactions:()=>{e(ue(c,!0,t.isShowDeletedReimbursementEnabled,!1,!0))},onBackClick:()=>{n("../",{relative:"path"})},onNavigateToSettings:()=>{n("../reimbursements/setup")},updateBulkActionList:i=>{e(sn(i))},removeAllTransactionsFromBulkActionList:()=>{e(X())},onProceedForBulkActionClick:(i,a)=>{switch(i){case"delete":case"cancel":e(an(i,a??""));break;case"send_for_approval":e(Te("send_for_approval")),t.navigate("./bulk-review");break;case"review":e(Te("approve")),t.navigate("./bulk-review")}},onReimbursementApprovalRulesEventReceived:i=>{i.endsWith(be)&&e(nn(!1))},onEventReceived:i=>{i===st&&e(tn())}}}))(Tn(Dn));function na(){const e=K(),t=ae(),n=Q(),r=n.state,m=qe(),[c,d]=g.useState(null),i=lt("/:tenantEmailDomain/reimbursements/bulk-review")!=null;g.useEffect((()=>{if(r?.tab!=null&&r?.subTab!=null){const f=Ht(r.tab.toString());f!=null?t(Oe(f)):console.log("Warning:Not a valid remiListTab");const G=Wt(r.subTab.toString());G!=null?t(ze(G)):console.log("Warning:Not a valid remiListSubTab")}return()=>{t(X())}}),[]);const{useFeatureGate:a}=oe(),{isFeatureEnabled:o}=a(F.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:l}=a(F.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:p}=a(F.isReimbursementBulkActionEnabled),I=L.getSignedInUser(),u=v((f=>H(f))),[T,y]=g.useState(!1),[B,D]=g.useState(!1),A=le(),C=A?.loggedInUserRole?.includes("admin")===!0,R=v((f=>Ze(f,V,p))),{areTenantIdsInSync:S}=xn(),w=R.fetchState,{isAiCfoAccessEnabled:h,onAskAiCfoClick:$}=Re({mobileExploreReferrer:"Reimbursement List"});if(Qe({isDataReady:w==="Completed"}),g.useEffect((()=>{!B&&S&&(D(!0),t(ue(V,!0,l,!1,!0)))}),[B,V,t,S]),I==null)throw Error("Can't access address page without signing in...");const U=!!u?.userRole&&qt(u),k=Se(A?.loggedInUserRoleMap),_=Ie(A?.loggedInUserRoleMap),b=!!u.userReimbursementInfo?.isReimbursementTOSAccepted,M=!!u.companyReimbursementInfo?.info?.isReimbursementEnabled,O=!!u.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,z=v((f=>Le(f.companyState,u.companyId))),W=z?.company.featuresActivationInfo.connectedAccountProvider,Z=f=>{y(f)},{isFeatureEnabled:Y}=a(F.isDebitCardFeatureEnabled),it=Ge(Y,u),ot=Ve(u),{remisProcessed:te,remisProcessing:ke}=v((f=>Xt(f)));g.useEffect((()=>{te===ke&&c!=null&&(t(Jt({messageSection:"reimbursement_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_report_",variableValue:te>1?me.texts.reports2:Kn.report},{variableName:"_has_",variableValue:te>1?me.texts.have:me.texts.has},{variableName:"_action_",variableValue:Qt(c)}]})),t(Yt()),setTimeout((()=>{t(ue(V,!0,l,!1,!0,!0))}),3e3),d(null))}),[te,ke]);const rt={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${st}`,`private-encrypted-${u.companyId}.${be}`]:[],eventCallback:(f,G,ve)=>{f.endsWith(be)?ve.onReimbursementApprovalRulesEventReceived?.(f):G.entity_type==="reimbursement"&&(d(G.operation_type),ve.onEventReceived(f))}};return n.pathname.endsWith("/reimbursements/")||n.pathname.endsWith("/reimbursements")||n.pathname.endsWith("/reimbursements/bulk-review")?it===!0||ot===!0?s.jsx(et,{}):M&&(!U||k)||_&&b?s.jsxs(s.Fragment,{children:[w==="Completed"?s.jsx(re,{analytics:E,onLoad:f=>(G=>G.trackPageLoaded(Ye.Event.reimbursementHome))(f)}):null,s.jsx(nt,{isAppContentDrawerOpen:T,handleDrawerToggle:Z}),s.jsxs(ea,{windowSize:m,children:[s.jsx(Nn,{isOpen:i,drawerLeftMargin:new Bn(0,0,300,600),onClose:()=>{e(`/${u.tenantEmailDomain}/reimbursements`),t(X())},children:s.jsx(ia,{onClick:f=>f.stopPropagation(),children:s.jsx(Qn,{tenantEmailDomain:u.tenantEmailDomain})})}),s.jsx(ta,{isShowDeletedBillsEnabled:o,isShowDeletedReimbursementEnabled:l,location:n,navigate:e,currentTenant:u,period:V,isAdmin:C,isEmployee:U,entity:"reimbursement",onClickMenuIcon:()=>{Z(!0)},createdByUserList:R.createdByUserList,createdByUserListFetchState:R.createdByUserListFetchState,isDownloadEnabled:R.isDownloadEnabled,connectedAccountProvider:W,isBulkActionEnabled:p,bulkSubmissionLimit:R.remiBulkSubmissionLimit,bulkSubmissionFetchState:R.remiListBulkActionInfo.bulkSubmissionFetchState,isAiCfoAccessEnabled:h,onAskAiCfoClick:$,...rt})]})]}):O&&k?s.jsx(N,{to:"../setup"}):A!=null&&He(u,A.loggedInUserRoleMap)?s.jsx(N,{to:"../promo"}):s.jsx(ye,{fetchState:"In-Progress"}):s.jsx(pe,{})}const aa=e=>`/${e}/reimbursements/setup`,sa=(e,t,n)=>{let r=`/${e}/reimbursement/${encodeURIComponent(t)}`;return n=="draft"&&(r+="/edit"),r},ia=P($n)`
|
|
65
|
+
display: flex;
|
|
66
|
+
min-height: 100%;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
`,oa=ee((function(e,t){const{companyId:n}=t;return{reimbursementSetupView:cn(e,n),analytics:E,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(un(n))},onCreateNewRemiButtonClick:()=>{e(dn(t.userRoleId))},onBackClick:()=>{r("../..",{relative:"path"})},onSetupReimbursementSuccess:()=>{t.isEmployee?r("../../reimbursement/new",{relative:"path"}):r("../reimbursements/setup",{relative:"path"})}}}))(Fn),ra=()=>{const e=Un(),t=K(),n=Q(),{tenantEmailDomain:r}=ie(),m=Ke(),[c,d]=g.useState(!1),i=v((C=>H(C))),a=L.getSignedInUserTenant(r)?.companyId??i.companyId,o=L.getSignedInUser(),l=i.userRoleId,p=!!i.userRole?.includes("reimbursements_user"),I=le(),u=Se(I?.loggedInUserRoleMap),T=Ie(I?.loggedInUserRoleMap),y=!!i.userReimbursementInfo?.isReimbursementTOSAccepted,B=!!i.companyReimbursementInfo?.info?.isReimbursementEnabled,D=!!i.companyReimbursementInfo?.info?.isReimbursementTOSAccepted,A=C=>{d(C)};if(o==null)throw Error("Can't access reimbursement promo page without signing in...");return B&&T&&y?s.jsx(N,{to:"../../../reimbursements"}):D&&u?s.jsx(N,{to:"../../reimbursements/setup"}):i.companyReimbursementInfo&&!D||i.userReimbursementInfo&&T&&y===!1?s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:E,onLoad:C=>(R=>R.trackPageLoaded(Ye.Event.reimbursementPromoPage))(C)}),s.jsx(nt,{isAppContentDrawerOpen:c,handleDrawerToggle:A}),s.jsx(oa,{companyId:a,navigate:t,meetingUrl:e("reimbursement_promo"),location:n,userReimbursementInfo:i.userReimbursementInfo,userRoleId:l,isEmployee:p,onClickMenuIcon:()=>{A(!0)}})]}):s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})};function Ma(){const e=v((Z=>H(Z))),t=le(),n=!!e.company?.companyReimbursementInfo.isReimbursementEnabled,r=Ke(),m=!!e.company?.companyReimbursementInfo.isReimbursementTOSAccepted,c=!!e.userReimbursementInfo?.isReimbursementTOSAccepted,{useFeatureGate:d}=oe(),{isFeatureEnabled:i}=d(F.isChargeCardFeatureEnabled),{isFeatureEnabled:a}=d(F.isDebitCardFeatureEnabled),o=Ge(a,e),l=Ve(e),p=e?.userRole!=null&&pn(e?.userRole),I=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&bn(t?.loggedInUserRoleMap),u=gn(t?.loggedInUserRoleMap),T=e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p,y=Se(t?.loggedInUserRoleMap),B=T&&y,D=!!e.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!p,A=D&&hn(t?.loggedInUserRoleMap),C=Ln(e,i,a)&&!p,R=C&&fn(t?.loggedInUserRoleMap),S=Sn(t?.loggedInUserRoleMap),w=In(t?.loggedInUserRoleMap),h=yn(t?.loggedInUserRoleMap),$=D&&w,U=e.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!p&&h,k=Rn(t?.loggedInUserRoleMap),_=kn(t?.loggedInUserRoleMap),b=Ie(t?.loggedInUserRoleMap),M=C&&k,{tenantEmailDomain:O}=ie(),z=Q(),W=n===!0&&(y||b&&c);return s.jsxs(mt,{children:[z.pathname.includes("/reimbursements")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"verification",element:s.jsx(je,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:R,isUserHasOnlyCardAccess:S,productType:"reimbursement",type:"verification"})}),s.jsx(x,{path:"setup",element:s.jsx(je,{isBillPayAdminLevelAccess:I,isUserHasOnlyBillPayAccess:u,isReimbursementAdminLevelAccess:B,isZeniAccountAdminLevelAccess:A,isChargeCardAdminLevelAccess:R,isUserHasOnlyCardAccess:S,productType:"reimbursement",type:"setup"})}),s.jsx(x,{path:"promo",element:s.jsx(ra,{})}),s.jsx(x,{path:"approval-rules/*",element:B?s.jsx(_n,{}):s.jsx(Pn,{showZeniAccountRoute:$,isUserHasBillPayAccess:_,isUserHasReimbursementAccess:b,showTreasuryRoute:U,isTenantBankingOnly:o,showChargeCardRoute:M,tenantEmailDomain:O??""})}),W&&s.jsx(x,{path:"*",element:s.jsx(na,{})}),(o===!0||l===!0)&&s.jsx(x,{path:"/*",element:s.jsx(et,{})}),t!=null&&He(e,t?.loggedInUserRoleMap)&&s.jsx(x,{path:"*",element:s.jsx(N,{to:"../promo"})}),m&&y&&s.jsx(x,{path:"*",element:s.jsx(N,{to:"../setup"})})]}):z.pathname.includes("/reimbursement")?s.jsxs(s.Fragment,{children:[s.jsx(x,{path:"new",element:s.jsx(Ue,{})}),s.jsx(x,{path:":reimbursementId",element:s.jsx(Xn,{})}),s.jsx(x,{path:":reimbursementId/edit",element:s.jsx(Ue,{})}),s.jsx(x,{path:"*",element:s.jsx(pe,{})})]}):s.jsx(x,{path:"*",element:s.jsx(ye,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5,boxShadow:`0px 2px ${j.sp1} ${r.colors.dropShadowNormal}`}})}),s.jsx(x,{path:"*",element:s.jsx(pe,{})})]})}export{Ma as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as f}from"./liveblocks-DXlRhlw7.js";import{g as te,h as ve,u as Ye,i as Ue,j as _,l as xe,n as We,o as oe}from"./core-DtTeGJWB.js";import{fI as Q,EH as S,VC as ze,m3 as ue,ul as he,va as Y,lK as D,lT as F,lL as V,kO as P,kF as A,kE as E,DK as U,vf as ye,bq as Ge,VD as He,bn as Ne,F3 as $e,VE as qe,VF as Ke,ck as I,DD as ne,VG as re,VH as Ze,VI as Je,VJ as Qe,VK as Xe,VL as ea,VM as aa,VN as sa,VO as ta,VP as oa,VQ as na,VR as ra,VS as la,VT as k,VU as x,VV as W,VW as z,VX as G,VY as H,VZ as N,V_ as $,V$ as q,W0 as K,ek as ca,EJ as ia,Ev as le,Ew as ce,EP as da,EA as ie,bG as O,W1 as de,di as pe,EB as _e,EV as pa,W2 as _a,W3 as fa,W4 as ba,W5 as ma,W6 as ua,W7 as ha,W8 as ya,W9 as Ca,Wa as wa,Wb as ga,e1 as Ia,e0 as Ra}from"./zeni-epic-state-DZFeYKWz.js";import{al as Sa,am as Ta,an as ka,a as Oa,$ as ja,p as Ce,d as Z,z as we,ao as Da,V as Fa,f as Va,ap as Pa,aq as Aa,a6 as Ea,k as J,O as Ma,A as La,l as ge,ar as Ba,as as va,at as Ya}from"./index-B_U4bcDF.js";import"./mui-UvvMpioS.js";import Ua from"./NotFoundScreen-l_eBhBHD.js";import{F as xa}from"./FeaturePreviewScreen-5jpbyDlq.js";import{a as u}from"./sentry-CtZyo70D.js";import{u as Wa}from"./useInitialThreadRequest-B9aUCLGn.js";import{t as fe,a as be,b as za}from"./routePaths-DsLddvmS.js";import{t as me}from"./reportTimeframe-CAbHy0y8.js";import{M as Ga}from"./MobileAppDrawer-Diz4hNBc.js";import"./recharts-VBeTlX07.js";import"./analytics-WkSvCk9z.js";import"./plaid-CIpr1Lyg.js";import"./dnd-DR4eaoV-.js";import"./stripe-cKAAJElX.js";import"./lottie-DOEy9FLJ.js";import"./lexical-DF0K2978.js";import"./pdf-rdPHFveP.js";import"./utils-Bmb8VI_4.js";import"./InboxNotificationsProvider-CJ59FBLr.js";import"./useTaskManagerAccess-jB_YQM25.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]="9e676d00-d1ef-4a3e-97d1-981b0319352e",e._sentryDebugIdIdentifier="sentry-dbid-9e676d00-d1ef-4a3e-97d1-981b0319352e")}catch{}})();const Ha=["profit_loss","balance_sheet","cash_flow"],R=e=>e==="balance_sheet"||e==="balance_sheet_by_classes"||e==="balance_sheet_by_projects",h=e=>{e(K({resetLeftScroll:!0})),e(q({resetLeftScroll:!0})),e($({resetLeftScroll:!0})),e(N({resetLeftScroll:!0})),e(H({resetLeftScroll:!0})),e(G({resetLeftScroll:!0})),e(x({resetLeftScroll:!0})),e(z({resetLeftScroll:!0})),e(W({resetLeftScroll:!0}))},Na=e=>{e(fa()),e(ba()),e(ma()),e(ua()),e(ha()),e(ya()),e(Ca()),e(wa()),e(ga())},$a=xe((function(e){const o=we.getSignedInUser(),b=e.tenantState.currentTenantId,m=Q(e),a=m?.companyName??"",s={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:b??""},t=S(e),n=He(m);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,balanceSheetClassesViewReport:t.balanceSheetByClassReport,cashFlowClassesViewReport:t.cashFlowByClassReport,cashFlowProjectViewReport:t.cashFlowByProjectReport,balanceSheetProjectViewReport:t.balanceSheetByProjectReport,cashFlowReport:t.cashFlowReport,downloadState:t.downloadState,analytics:J,isZeniUser:Ne(o),showAccountGroups:n===!0,isAccountingClassesEnabled:ue(e),isAccountingProjectsEnabled:he(e),currentTenantCompanyName:a,statementEndPoint:`${Ya}/statement`,authParams:s,isZeniCOAUsed:n}}),(function(e,o){const{navigate:b,handleDrawerToggle:m}=o;return{onReloadReport:()=>{o.signedInUser!=null&&e(Y(o.signedInUser.userId,!0,!1))},updateDownloadStateHandler:a=>{e(_a(a))},onTimeframeSelectionChanged:(a,s,t)=>{if(e(pa(a)),s){const{isCompareModeOn:n,filter:r}=o,{additionalBalances:i,balancesRange:d}=r;let c=[...i];a==="year"&&(c=c.filter((p=>p!=="this_period_vs_same_period_last_year"&&p!=="this_period_vs_same_period_last_year_percent"&&p!=="same_period_last_year"))),e(le(o.firstMonthOfFY,n,d.numberOfPeriods<1?1:d.numberOfPeriods,c)),i.length>0&&e(ce(o.firstMonthOfFY,c.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",d.numberOfPeriods<1?1:d.numberOfPeriods,c))}t!==!0&&setTimeout((()=>h(e)),50)},onInitialDateRangeAvailable:(a,s)=>{const{filter:t}=o,n=me(t.timeframe),r=O(a),i=O(s),d=de(o.firstMonthOfFY,n,{startDate:r,endDate:i})??t.balancesRange.numberOfPeriods,{startOfTimeframeFY:c,endOfTimeframeFY:p}=pe(i,o.firstMonthOfFY,n);e(_e({numberOfPeriods:d,orderBy:t.balancesRange.orderBy,thisPeriod:{startDate:c,endDate:p}}))},onCustomDateRangeChanged:(a,s,t)=>{const{filter:n}=o,r=me(t??n.timeframe);switch(o.selectedReportID){case"profit_and_loss":case"profit_and_loss_by_classes":e(ye(r,void 0,!0,!1,a,s)),o.selectedReportID==="profit_and_loss_by_classes"&&o.isAccountingClassesEnabled&&e(ne());break;case"profit_and_loss_by_projects":o.isAccountingProjectsEnabled&&e(U());break;case"balance_sheet":e(E(r,!0,!1,a,s));break;case"balance_sheet_by_classes":e(E(r,!0,!1,a,s)),o.isAccountingClassesEnabled&&e(A());break;case"balance_sheet_by_projects":e(E(r,!0,!1,a,s)),o.isAccountingProjectsEnabled&&e(P());break;case"cash_flow":e(D(r,!0,a,s));break;case"cash_flow_by_classes":e(D(r,!0,a,s)),o.isAccountingClassesEnabled&&e(V());break;case"cash_flow_by_projects":e(D(r,!0,a,s)),o.isAccountingProjectsEnabled&&e(F())}const i=O(a),d=O(s),c=de(o.firstMonthOfFY,r,{startDate:i,endDate:d})??n.balancesRange.numberOfPeriods,{startOfTimeframeFY:p,endOfTimeframeFY:M}=pe(d,o.firstMonthOfFY,r);e(_e({numberOfPeriods:c,orderBy:n.balancesRange.orderBy,thisPeriod:{startDate:p,endDate:M}})),h(e)},onReportSelectionChanged:a=>{const s=o.selectedReportID;if(a===s)return;const t=o.classViewLayout;e(k(a)),(R(a)||I(a))&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(ie({numberOfPeriods:1,orderBy:"ascending_date"})),a!=="profit_and_loss"&&a!=="profit_and_loss_by_classes"&&s==="profit_and_loss_by_classes"&&t==="horizontal"&&e(re({classViewLayout:"vertical"})),h(e)},onCOABalancesRangeChanged:(a,s)=>{e(ie(a,s)),h(e)},onThisPeriodChanged:(a,s,t)=>{e(da(o.firstMonthOfFY,a,s<1?1:s)),t!==!0&&h(e)},onAdditionalBalanceSelectionChanged:(a,s,t,n)=>{e(le(o.firstMonthOfFY,a,t<1?1:t,s)),s.length>0&&e(ce(o.firstMonthOfFY,s.includes("this_period_vs_last_period")?"compare_mode_amount":"compare_mode_percent",t<1?1:t,s)),n!==!0&&o.isCompareModeOn===a||setTimeout((()=>h(e)),50)},onUpdateHighlightedNumberOfPeriods:(a,s,t,n)=>{e(ia({firstMonthOfFY:o.firstMonthOfFY,isCompareModeOn:s,additionalBalances:a,maxNumOfPeriodsToHighlight:t<1?1:t,coaBalances:n}))},onAccountBalanceClick:o.hasTransactionAccess!==!0?void 0:(a,s,t)=>{let n,r;if(s.balanceTimeFrame==="month"||s.balanceTimeFrame==="quarter"?(n=s.balanceTimeFrame,r=ca(s)):s.balanceTimeFrame==="year"?(n="quarter",r={startDate:s.endDate.startOf("quarter"),endDate:s.endDate}):console.error(`timeframe ${s.balanceTimeFrame} is not supported`),r!=null&&n!=null){const i=a.accountName===""?a.accountDescription:a.accountName,d=(()=>{if(o.selectedReportID==="profit_and_loss_by_classes"&&o.classViewLayout==="horizontal"&&a.accountType!=null){if(t?.isHorizontalClassTotalColumn===!0)return fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r);if(t?.isHorizontalClassColumn===!0&&s.id!=null)return be(o.tenantEmailDomain,a.accountId,a.accountType,s.id,i,n,r)}return a.projectsViewParentId?.projectId!=null&&a.accountType!=null?za(o.tenantEmailDomain,a.accountId,a.accountType,a.projectsViewParentId.projectId,i,n,r):a.classesViewParentId!=null&&a.classesViewParentId.parentClassId!=null&&a.accountType!=null?be(o.tenantEmailDomain,a.accountId,a.accountType,a.classesViewParentId.parentClassId[0],i,n,r):a.accountType!=null?fe(o.tenantEmailDomain,a.accountId,a.accountType,i,n,r):void 0})();if(d!=null){const c=ge(o.location.state?.pathnameStackToGoBack,o.location.pathname);b(d,{state:{pathnameStackToGoBack:c,referrer:j(o.selectedReportID)}})}}},onTableScroll:(a,s)=>{switch(a){case"profit_and_loss":e(K({scrollPosition:s}));break;case"profit_and_loss_by_classes":e(q({scrollPosition:s}));break;case"profit_and_loss_by_projects":e($({scrollPosition:s}));break;case"balance_sheet":e(N({scrollPosition:s}));break;case"balance_sheet_by_classes":e(H({scrollPosition:s}));break;case"balance_sheet_by_projects":e(G({scrollPosition:s}));break;case"cash_flow_by_classes":e(z({scrollPosition:s}));break;case"cash_flow_by_projects":e(W({scrollPosition:s}));break;case"cash_flow":e(x({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(K({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_classes":e(q({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"profit_and_loss_by_projects":e($({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet":e(N({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_classes":e(H({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"balance_sheet_by_projects":e(G({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_classes":e(z({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow_by_projects":e(W({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;case"cash_flow":e(x({nodeCollapseState:{nodeId:s,isCollapsed:t}}));break;default:console.log(`Collapse state toggle for ${a} is not handled`)}},onBackClick:()=>{b("../../")},onUpdateAccountViewMode:(a,s)=>{const t=s??o.selectedReportID,n=R(t),r=I(t);r?(e(sa({viewMode:a})),e(ta({viewMode:a}))):n?(e(oa({viewMode:a})),e(na({viewMode:a}))):(e(ra({viewMode:a})),e(la({viewMode:a}))),a==="classes"?(o.analytics?.trackGroupBySwitch("Classes",j(t)),e(k(r?"cash_flow_by_classes":n?"balance_sheet_by_classes":"profit_and_loss_by_classes"))):a==="project"?(o.analytics?.trackGroupBySwitch("Projects",j(t)),e(k(r?"cash_flow_by_projects":n?"balance_sheet_by_projects":"profit_and_loss_by_projects"))):(o.analytics?.trackGroupBySwitch("Accounts",j(t)),e(k(r?"cash_flow":n?"balance_sheet":"profit_and_loss"))),h(e)},onUpdateClassesToFilterOut:a=>{I(o.selectedReportID)?e(Xe({classesToFilterOut:a})):R(o.selectedReportID)?e(ea({classesToFilterOut:a})):e(aa({classesToFilterOut:a}))},onUpdateProjectsToFilterOut:a=>{I(o.selectedReportID)?e(Ze({projectsToFilterOut:a})):R(o.selectedReportID)?e(Je({projectsToFilterOut:a})):e(Qe({projectsToFilterOut:a}))},onUpdateClassViewLayout:a=>{e(re({classViewLayout:a}))},onOpenAccountViewMode:()=>{const a=R(o.selectedReportID),s=I(o.selectedReportID);o.isAccountingClassesEnabled&&e(s?V():a?A():ne()),o.isAccountingProjectsEnabled&&e(s?F():a?P():U())},onUpdateDisplayOrder:a=>{e(Ke(a))},onUpdateReportFormat:a=>{Na(e),e(qe(a))},onClickMenuIcon:()=>{m(!0)},onResyncReports:()=>{const a=o.selectedReportID;e(a!=="balance_sheet_by_classes"?a!=="balance_sheet_by_projects"?a!=="cash_flow_by_classes"?a!=="cash_flow_by_projects"?$e(a==="profit_and_loss_by_projects"?"profit_and_loss_by_projects":"profit_and_loss_by_classes"):F(!0):V(!0):P(!0):A(!0))}}}))(Ba);function qa(){const{isAiCfoOpen:e,setIsAiCfoOpen:o}=Oa(),b=ja(),m=va(b),a=ve(),s=Ye(),t=te(),{tenantEmailDomain:n}=Ue(),{useFeatureGate:r}=Ce(),{isFeatureEnabled:i}=r(Z.isReportsHorizontalClassLayoutSwitchEnabled),{isFeatureEnabled:d}=r(Z.isReportsCustomDateRangeEnabled),c=we.getSignedInUser(),[p,M]=u.useState(!1),[X,Ie]=u.useState(!1);if(c==null)throw Error("Can't access reports page without signing in...");const L=_((l=>Q(l))),Re=L.masterTOSInfo?.isMasterTOSAccepted??!1,Se=L.company?.companyInfo.firstMonthOfFY??1,Te=Wa(L?.companyId),w=_((l=>S(l).fetchState)),ke=_((l=>ze(l))),{areTenantIdsInSync:y}=Da(),B=_((l=>l.financeStatementState.selectedReportId)),T=_((l=>ue(l))),g=_((l=>he(l))),Oe=_((l=>S(l).isCompareModeOn)),C=_((l=>S(l).filter)),v=_((l=>S(l).selectedReportAndTimeframeFetchState)),je=_((l=>l.profitAndLossClassesViewState.uiState.classViewLayout));u.useEffect((()=>{!p&&y&&(M(!0),s(Y(c.userId,!0,!0,!1)))}),[p,c,s,y]),u.useEffect((()=>{p&&!X&&w==="Completed"&&y&&(s(Y(c.userId,!1,!0,!1)),Ie(!0))}),[p,X,w,y]),u.useEffect((()=>{if(p&&v.fetchState==="Not-Started"&&C.timeframe!=="free_range"&&C.timeframe!=="week"&&y)switch(B){case"profit_and_loss":case"profit_and_loss_by_classes":s(ye(C.timeframe));break;case"profit_and_loss_by_projects":g&&s(U());break;case"balance_sheet":s(E(C.timeframe));break;case"balance_sheet_by_classes":T&&s(A());break;case"balance_sheet_by_projects":g&&s(P());break;case"cash_flow_by_classes":T&&s(V());break;case"cash_flow_by_projects":g&&s(F());break;case"cash_flow":s(D(C.timeframe))}}),[p,B,v,y,T,g]);const ee=Fa(),De=ee?.loggedInUserRole!=null&&Ge(ee?.loggedInUserRole)!==!0,[Fe,Ve]=u.useState(!1),ae=l=>{Ve(l)},Pe=Va(),Ae=Pa();return(function(l){const{isDataReady:Ee}=l,{pathname:Me}=te(),se=Sa(Me??"")==="reports",Le=Ta(Ee),Be=u.useMemo((()=>se?Ha:void 0),[se]);ka({canFetchSuggestedQuestions:Le,pageContexts:Be})})({isDataReady:w==="Completed"}),Aa({isDataReady:w==="Completed"}),f.jsxs(f.Fragment,{children:[w==="Completed"?f.jsx(Ea,{analytics:J,onLoad:l=>l.trackPageLoaded(Ma.Event.reports)}):null,f.jsx(Ga,{isAppContentDrawerOpen:Fe,handleDrawerToggle:ae}),f.jsx($a,{firstMonthOfFY:Se,tenantEmailDomain:n,location:t,navigate:a,windowSize:b,classViewLayout:je,selectedReportID:B,analytics:J,filter:C,isAccountingClassesEnabled:T,isAccountingProjectsEnabled:g,isCompareModeOn:Oe,hasTransactionAccess:De,signedInUser:c,selectedReportAndTimeframeFetchState:v,handleDrawerToggle:ae,reportsResyncFetchState:ke.reportsResyncFetchState,isAiCfoAccessEnabled:Ae&&Pe&&!e,onAskAiCfoClick:()=>{if(Re)if(m){const l=ge(t.state?.pathnameStackToGoBack,t.pathname);a(`/${n}/ai-cfo/explore`,{state:{pathnameStackToGoBack:l,referrer:"Reports"}})}else o(!0);else La({location:t,navigate:a,mergeState:{referrer:"Reports"}})},isHorizontalClassReportSwitchEnabled:i,isCustomDateRangeEnabled:d,initialOpenThreadRequest:Te})]})}const j=e=>{switch(e){case"profit_and_loss":case"profit_and_loss_by_classes":case"profit_and_loss_by_projects":return"Profit & Loss";case"balance_sheet":case"balance_sheet_by_classes":case"balance_sheet_by_projects":return"Balance Sheet";case"cash_flow":case"cash_flow_by_classes":case"cash_flow_by_projects":return"Cash Flow";default:return"Reports"}};function ys(){const e=_((s=>Q(s))),{useFeatureGate:o}=Ce(),{isFeatureEnabled:b}=o(Z.isDebitCardFeatureEnabled),m=Ia(b,e),a=Ra(e);return m===!0||a===!0?f.jsx(xa,{}):f.jsxs(We,{children:[f.jsx(oe,{path:"/",element:f.jsx(qa,{})}),f.jsx(oe,{path:"*",element:f.jsx(Ua,{})})]})}export{ys as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-DXlRhlw7.js";import{z as b,a6 as N,k as f,O as S,e6 as k,p as I,d as C}from"./index-B_U4bcDF.js";import"./mui-UvvMpioS.js";import g from"./NotFoundScreen-l_eBhBHD.js";import{a as c}from"./sentry-CtZyo70D.js";import{u as D,j as y,h as F,g as L,l as T,n as U,o as d,N as h}from"./core-DtTeGJWB.js";import{fI as _,a32 as j,a33 as p,Em as P,q7 as V,a34 as q,Ek as z}from"./zeni-epic-state-DZFeYKWz.js";import"./recharts-VBeTlX07.js";import"./analytics-WkSvCk9z.js";import"./plaid-CIpr1Lyg.js";import"./dnd-DR4eaoV-.js";import"./stripe-cKAAJElX.js";import"./lottie-DOEy9FLJ.js";import"./lexical-DF0K2978.js";import"./pdf-rdPHFveP.js";import"./utils-Bmb8VI_4.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]="80166a02-4821-44c1-bd8a-e3c618bb501a",e._sentryDebugIdIdentifier="sentry-dbid-80166a02-4821-44c1-bd8a-e3c618bb501a")}catch{}})();const G=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])})),f.trackInviteEmailClicked("send",s,r,s.length)}e(z())},onUpdateInviteFormLocalData:s=>{e(q({localData:s}))},onSubmitSuccess:()=>{e(p())},onCancelClick:()=>{i!=null&&f.trackInviteEmailClicked("cancel")}}}))(k),O=()=>{const e=D(),[t,n]=c.useState(!1),[i,s]=c.useState(!1),r=y((o=>_(o))),m=F(),w=L(),u=b.getSignedInUser();if(u==null)throw Error("Can't access invite referral screen without signing in...");const l=y((o=>j(o))),x=u?.firstName!=null?u.firstName:"User";c.useEffect((()=>{e(p()),r?.rewardsLastViewedTime==null&&i===!1&&(e(P()),s(!0))}),[]),c.useEffect((()=>{t||l.fetchState!=="Not-Started"||(n(!0),e(V(!0)))}),[l.fetchState,e]);const E=r.company?.companyInfo.companyLegalName??r.companyName;return a.jsxs(a.Fragment,{children:[l.fetchState==="Completed"?a.jsx(N,{analytics:f,onLoad:o=>(v=>v.trackPageLoaded(S.Event.inviteEmailViewed))(o)}):null,a.jsx(G,{navigate:m,location:w,currentTenant:r,companyName:E,userName:x,inviteFormCompayData:l.localData})]})};function ne(){const{useFeatureGate:e}=I(),{isFeatureEnabled:t}=e(C.isReferralFeatureEnabled);return a.jsxs(U,{children:[a.jsx(d,{path:"/",element:a.jsx(h,{to:"refer",replace:!0})}),a.jsx(d,{path:"how-it-works",element:a.jsx(h,{to:"refer",replace:!0})}),a.jsx(d,{path:"refer/*",element:t?a.jsx(O,{}):a.jsx(g,{})}),a.jsx(d,{path:"*",element:a.jsx(g,{})})]})}export{ne as default};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import{j as E}from"./liveblocks-DXlRhlw7.js";import{a as v}from"./sentry-CtZyo70D.js";import{i as M,u as H,h as Q,g as ee,j as r,l as te}from"./core-DtTeGJWB.js";import{XB as Fe,XC as Ge,m3 as ae,sF as Ve,sR as Me,t5 as Re,t3 as $e,t6 as Ke,t8 as Ue,XD as Ye,fI as K,WA as pe,XE as Se,h2 as ne,cD as le,cE as se,FN as ve,XF as Ce,FR as Xe,gS as ce,sI as qe,th as ze,dF as We,dE as Ze,TW as fe,FL as He,FF as Qe,XG as De,Fx as et,Fw as tt,Fr as at,FC as nt,FS as lt,XH as Y,XI as ge,Fy as st,WB as oe,G6 as Ae,F$ as Ie,XJ as xe,sL as Te,FV as Be,FT as Le,XK as Je,Gd as we,Ga as je,FW as be,Gc as Ne}from"./zeni-epic-state-DZFeYKWz.js";import{a2 as de,aW as ie,aX as ct,z as ot,j as dt,a5 as it,a6 as ue,k as _,at as ut,aY as rt,l as G,G as ye,c as Ee,aZ as ht,a_ as mt,a$ as pt}from"./index-B_U4bcDF.js";import{n as re}from"./mui-UvvMpioS.js";import{p as St}from"./pathToGoBack-CTzkpPUW.js";import{u as ft}from"./useActualMatchingMatchDetail-cU8XyJV-.js";import Z from"./NotFoundScreen-l_eBhBHD.js";import{c as V}from"./routePaths-DsLddvmS.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]="86da9366-0ed6-4538-843f-e19ff5bc8fda",e._sentryDebugIdIdentifier="sentry-dbid-86da9366-0ed6-4538-843f-e19ff5bc8fda")}catch{}})();function Ut({isRenderedInPanel:e=!1,accrualIdOverride:t,onPanelNavigateBack:c}={}){const{accrualId:l}=M(),s=t??l,n=H(),i=Q(),a=ee(),{accrual:d,actionFetchState:o,detailFetchState:h,localData:A}=r((u=>Fe(u,s??""))),m=r((u=>Ge(u))),C=r((u=>ae(u))),y=ft(),S=v.useCallback((()=>{const u=de(a.state?.pathnameStackToGoBack);i(u.poppedPathname??St(4),{state:{pathnameStackToGoBack:u.newStack}})}),[a.state,i]),I=v.useRef(!1);return v.useEffect((()=>{o.fetchState!=="In-Progress"&&I.current&&o.fetchState==="Completed"&&(I.current=!1,S())}),[o.fetchState,S]),v.useEffect((()=>{s!=null&&d==null&&h.fetchState==="Not-Started"&&n(Ve(s))}),[s,d,h.fetchState]),v.useEffect((()=>{n(Me({scheduleType:"prepaid_expenses",shouldResetEnteredData:!1}))}),[n]),s==null?E.jsx(Z,{}):d==null?h.fetchState==="Not-Started"||h.fetchState==="In-Progress"?E.jsx(ie,{}):E.jsx(Z,{}):E.jsx(Dt,{children:E.jsx(ct,{isRenderedInPanel:e,accrual:d,actionFetchState:o.fetchState,isAccountingClassesEnabled:C,localData:A,newAccrualAccountsView:m,onAccrualFormChange:(u,f)=>{n(Ye({accrualId:u,localData:f}))},onAccrualFormClear:u=>{n(Ue({accrualId:u}))},onApproveAndPost:u=>{n(Ke(s,u))},onNavigateBack:c??S,onOpenJournalEntry:y,onRevert:(u,f)=>{I.current=!0,n($e(s,u,f))},onSkip:(u,f)=>{n(Re(s,u,f))}})})}const Dt=re.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 0 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,gt=ye.getLocalizedStrings(),yt=te((function(e,t){const c=Se(e,t.scheduleTab),l=e.tenantState.currentTenantId;return{authParams:{userId:t.signedInUser.userId??"",sessionId:t.signedInUser.zeniSessionId??"",tenantId:l??""},linkBillExpenseView:c.linkBillExpenseView,transactions:c.linkBillExpenseView.transactions}}),(function(e,t){const{navigate:c,location:l}=t;return{onTransactionSelect(s){e(Ce({selectedTransaction:s}))},onBackClick:()=>{c("..",{relative:"path"})},onCancel(){e(Ce({selectedTransaction:void 0})),e(Xe()),c("..",{relative:"path"})},onTransactionClick:s=>{const n=`${V(s,t.tenantEmailDomain)}`,i=G(l.state?.pathnameStackToGoBack,l.pathname);c(n,{state:{pathnameStackToGoBack:i}})},onLinkSave(){t.setShouldNavigateBack(!1),e(ve(t.scheduleTab,t.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}}))(rt),Yt=({setShouldNavigateBack:e})=>{const t=Q(),c=ee(),{scheduleDetailId:l,tenantEmailDomain:s}=M(),{scheduleType:n}=M();if(s==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const i=r((y=>K(y))),a=pe(n)??"accrued_expenses",d=ot.getSignedInUser();if(d==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(l==null)throw Error("Invalid Schedule Detail Id");const o=r((y=>Se(y,a))),h=o.selectedJELinkRowIndex,A=r((y=>ne(y,i.companyId))),m=dt(o.updateStatus.fetchState);v.useEffect((()=>{m==="In-Progress"&&o.updateStatus.fetchState==="Completed"&&t("..",{relative:"path"})}),[m,o.updateStatus.fetchState]),v.useEffect((()=>{o.fetchState==="Not-Started"&&t("..",{relative:"path"})}),[]),v.useEffect((()=>{o.selectedJEAccruedSchedule!=null&&o.selectedJELinkRowIndex!=null||t("..",{relative:"path"})}),[o.selectedJEAccruedSchedule,o.selectedJELinkRowIndex]);const C=o.linkBillExpenseView.fetchState==="Completed";return E.jsx(E.Fragment,{children:o.linkBillExpenseView.fetchState==="In-Progress"?E.jsx(it,{fetchState:o.linkBillExpenseView.fetchState}):o.selectedJEAccruedSchedule!=null&&h!=null?E.jsxs(E.Fragment,{children:[C===!0?E.jsx(ue,{analytics:_,onLoad:()=>{Et(o,a,A)}}):null,E.jsx(yt,{signedInUser:d,attachmentEndPoint:`${ut}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:o.selectedJEAccruedSchedule.vendor.id??"",location:c,tenantEmailDomain:s,scheduleAccruedDetailsView:o,saveFetchState:o.updateStatus.fetchState,scheduleTab:a,navigate:t,analytics:_,controllerUserDetails:A,saveStatus:o.updateStatus.fetchState,jeAccruedSchedule:o.selectedJEAccruedSchedule,localData:o.scheduleAccruedDetailsLocalData.jeScheduleDetails[h]})]}):null})},_e=e=>{const t=gt.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(t)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(t)??null,endMonth:e.endDate?.format(t)??null}},Et=(e,t,c)=>{const l=e.selectedJEAccruedSchedule,s=e.selectedJELinkRowIndex;let n;s!=null&&l!=null&&(n=l.scheduledJournalEntry[s]);const{transactions:i}=e.linkBillExpenseView,a=i.some((h=>h.isRecommendedTransaction===!0)),d=le(c.controllers),o=se(c.controllerUserIds);l!=null&&_.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:t,schedule:{..._e(l)},scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:a,journalEntryPostingStatus:n?.status.label??""},vendorName:l.vendor.name??null,controllerEmails:d,controllerUserIds:o})};function ke({jeScheduleId:e,scheduleKey:t,scheduleType:c,onDecided:l}){const s=H(),{ignoreStatusById:n,revertStatusById:i}=r((A=>ce(A).jeSchedules)),a=v.useRef(void 0),d=t==null||a.current==null?void 0:a.current==="ignore"?n[t]?.fetchState:i[t]?.fetchState,o=v.useRef(!1),h=v.useRef(l);return h.current=l,v.useEffect((()=>{o.current&&d==="Completed"&&(o.current=!1,h.current())}),[d]),{onScheduleDecision:v.useCallback(((A,m,C)=>{if(t!=null){if(A==="ignore")return(function(y){return We.includes(y)})(m)?(o.current=!0,a.current="ignore",void s(qe(t,c,m,C))):void 0;e!=null&&(function(y){return Ze.includes(y)})(m)&&(o.current=!0,a.current="revert",s(ze(e,t,c,m,C)))}}),[s,e,t,c]),scheduleDecisionStatus:d}}const kt=re.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
min-height: 100%;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 0 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
`,Ct=te((function(e){const t=K(e),c=e.entityAutoCompleteState.autoCompleteText.common,l=De(e,"common");return{tenantName:t.companyName,vendorSearchAutoCompleteData:{autoCompleteText:c,entityAutoCompleteView:l}}}),(function(e,t){const{navigate:c,location:l}=t,s="accrued_expenses";return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const n=de(l.state?.pathnameStackToGoBack);n.poppedPathname==null?c("../schedules/accrued_expenses"):c(n.poppedPathname,{state:{pathnameStackToGoBack:n.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:n=>{t.setShouldNavigateBack(!0),e(ve(s,n))},onDelete:n=>{e(st(s,n))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(n,i)=>{n.trim().length>=2?e(ge({searchString:n,entityType:i,searchOrigin:"common"})):n.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onEditAmount:(n,i)=>{e(lt(s,n,i))},onJELinkClick:n=>{e(nt({selectedJELinkRowIndex:n})),c("./edit_link")},onCancelAccrual:(n,i,a)=>{e(at(n,i,a))},onTransactionClick:n=>{const i=`${V(n,t.tenantEmailDomain)}`,a=G(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewPostedJE:n=>{const i=`${V(n,t.tenantEmailDomain)}`,a=G(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewRecordedJE:n=>{const i=`${V(n,t.tenantEmailDomain)}`,a=G(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onViewBillExpense:n=>{const i=`${V(n,t.tenantEmailDomain)}`,a=G(l.state?.pathnameStackToGoBack,l.pathname);c(i,{state:{pathnameStackToGoBack:a}})},onDetailPageChange:(n,i,a)=>{const{scheduleDetailsAccruedExpensesSection:d}=n,{amount:o,memo:h,months:A,scheduleAccruedExpenseCategory:m,scheduleClass:C,scheduleExpenseCategory:y,startDate:S,vendor:I}=d,u=C.selectedOption!=null?t.classList.find((B=>B.classId===C.selectedOption)):void 0,f=y.selectedOption!=null?t.accountList.find((B=>B.qboId===y.selectedOption)):void 0,D=m.selectedOption!=null?t.accruedAccountList.find((B=>B.qboId===m.selectedOption)):void 0,J=A?.selectedOption;e(et({scheduleType:s,localData:i,selectedJeScheduleDetailId:t.scheduleDetailId})),a!==!1||t.scheduleDetailId!=null||f?.accountId==null||t.isAccountingClassesEnabled!==!1&&u?.classId==null||D==null||I.selectedOption==null||h==null||o==null&&o==0||S==null||J==null||e(tt({scheduleType:s}))}}}))(ht),Xt=({shouldNavigateBack:e,setShouldNavigateBack:t,isRenderedInPanel:c=!1,scheduleDetailIdOverride:l,onPanelCloseAfterDecision:s,onPanelNavigateBack:n}={})=>{const[i,a]=v.useState(!1),d=e??i,o=t??a,h=Q(),A=ee(),m=H(),C=Ee(),{tenantEmailDomain:y}=M(),[S,I]=v.useState(!1);if(y==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:u}=M(),f=l??u;let D;f!=="new"&&(D=f);const J=vt(f),B=r((L=>L.scheduleAccruedDetailState.selectedJEAccruedScheduleKey)),w="accrued_expenses",k=r((L=>Se(L,"accrued_expenses"))),j=r((L=>fe(L))),b=r((L=>L.classListState.fetchState)),x=r((L=>ae(L))),N=j!=="Completed"||b!=="Completed";v.useEffect((()=>{S===!1&&N?(m(He(w,D)),I(!0)):N===!1&&S===!1&&f!=="new"&&(m(Qe(w,f)),I(!0))}),[S]);const P=r((L=>K(L))),T=r((L=>ne(L,P.companyId))),O=A.state?.message==="expenseAutomation",X=r((L=>ce(L).selectedPeriod)),U=c||O,{onScheduleDecision:q,scheduleDecisionStatus:z}=ke({jeScheduleId:k.selectedJEAccruedSchedule?.jeScheduleId,scheduleKey:k.selectedJEAccruedSchedule?.jeAccruedScheduleKey,scheduleType:w,onDecided:()=>{if(s==null)if(O!==!0)h("../schedules/accrued_expenses");else{const{month:L,year:Pe}=X;h(`../../month_end_close_checks/review/je_schedules/${L}-${Pe}`)}else s()}}),F=k.fetchState,R=k.allAccountList,W=k.allClassList,g=k.allAccruedAccountList,p=k.scheduleAccruedDetailsLocalData;if(J!==!0||k.fetchState==="Error")return E.jsx(Z,{});const $=F==="Completed"&&S===!0,Oe=k.selectedJEAccruedSchedule!=null;return F==="Completed"||F==="Not-Started"||c===!0&&Oe?E.jsxs(kt,{children:[$===!0?E.jsx(ue,{analytics:_,onLoad:()=>{At(k,w,T)}}):null,E.jsx(Ct,{onScheduleDecision:U?q:void 0,scheduleDecisionStatus:z,isRenderedInPanel:c,onPanelNavigateBack:n,setShouldNavigateBack:o,scheduleAccruedDetailsView:k,location:A,navigate:h,classList:W,accountList:R,shouldNavigateBack:d,accruedAccountList:g,scheduleLocalData:p,selectedJEScheduleKey:B,scheduleDetailId:D,selectedScheduledJournalEntries:k.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:C,tenantEmailDomain:y,analytics:_,controllerUserDetails:T,isAccountingClassesEnabled:x,status:k.selectedJEAccruedSchedule?.status.code})]}):E.jsx(ie,{})},vt=e=>e!=null,At=(e,t,c)=>{const l=e.selectedJEAccruedSchedule,s=le(c.controllers),n=se(c.controllerUserIds);l!=null&&_.trackScheduleAccruedDetailsLoaded({scheduleType:t,scheduleExpenseCategoryAndClass:{expenseCategory:l.jeDebit.account?.accountName??null,expenseClass:l.jeDebit.accountingClass?.className??null},schedule:{..._e(l)},vendorName:l.vendor.name??null,controllerEmails:s,controllerUserIds:n})},It=re.div`
|
|
18
|
+
display: flex;
|
|
19
|
+
min-height: 100%;
|
|
20
|
+
width: 100%;
|
|
21
|
+
flex: 1 0 auto;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
+
`,he=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,xt=te((function(e){const t=K(e),c=oe(e,"fixed_assets");return{tenantName:t.companyName,scheduleDetailsView:c}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i="fixed_assets",a=n.flatMap((d=>d.error)).filter((d=>!!d))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const d=de(t.location.state?.pathnameStackToGoBack);d.poppedPathname==null?c("../schedules/fixed_assets"):t.navigate(d.poppedPathname,{state:{pathnameStackToGoBack:d.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:d=>{e(Ne(i,d,a.length>0))},onDelete:d=>{e(be(i,d))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(je(i,t.selectedJEScheduleKey))},onEditAmount:(d,o)=>{e(we(i,d,o))},onJELinkClick:d=>{e(Je({selectedJELinkRowIndex:d})),c("./edit_link")},onTransactionClick:d=>{const o=`${V(d,t.tenantEmailDomain)}`,h=G(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:h,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:d=>{const o=`${V(d,t.tenantEmailDomain)}`,h=G(l.state?.pathnameStackToGoBack,l.pathname);c(o,{state:{pathnameStackToGoBack:h}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(d,o)=>{d.trim().length>=2?e(ge({searchString:d,entityType:o,searchOrigin:"common"})):d.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(d,o)=>{const{scheduleDetailsFixedAssetsSection:h,scheduleDetailsListSection:A}=d,{scheduleClass:m,scheduleExpenseCategory:C,accumulatedDepreciationCategory:y,assetId:S,months:I,startDate:u,postingDate:f,vendor:D}=h,J=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((T=>T.id===D?.selectedOption)):void 0,B={id:J?.zeniId??D?.selectedOption??"",name:J?.name??D?.defaultOptions.find((T=>T.value===D?.selectedOption))?.label??"",logo:J?.logo},w=m.selectedOption!=null?t.classList.find((T=>T.classId===m.selectedOption)):void 0,k=C.selectedOption!=null?t.accountList.find((T=>T.qboId===C.selectedOption)):void 0,j=y.selectedOption!=null?t.depAccountList.find((T=>T.qboId===y.selectedOption)):void 0,b=I?.selectedOption,x=A.map(((T,O)=>({...t.scheduleLocalData.jeScheduleDetails[O],amount:{...t.scheduleLocalData.jeScheduleDetails[O].amount,amount:T.amount}}))),N=f.type==="day"?f.dayOfMonth?f.dayOfMonth:1:void 0,P=f.type==="lastDayOfMonth"||void 0;e(Be({scheduleType:i,localData:{selectedAccount:k?.accountId,selectedClass:w?.classId,selectedAccumulatedDepreciationCategory:j?.accountId,selectedDate:u,selectedMonths:b,assetId:S,jeScheduleDetails:x,lastDayOfMonth:P,selectedDayOfMonth:N,selectedVendor:B},selectedJeScheduleDetailId:t.scheduleDetailId})),o!==!1||j?.accountId==null||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||k?.accountId==null||t.isAccountingClassesEnabled!==!1&&w?.classId==null||u==null||b==null||P!==!0&&N==null||e(Le({scheduleType:i}))}}}))(mt),qt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,onPanelCloseAfterDecision:c,onPanelNavigateBack:l}={})=>{const s=Q(),n=ee(),i=H(),a=Ee(),{tenantEmailDomain:d}=M(),[o,h]=v.useState(!1),{scheduleDetailId:A}=M(),m=t??A,C=n.state?.message==="expenseAutomation",y=Tt(m),S=r((g=>g.scheduleDetailState.selectedJEScheduleKey));v.useEffect((()=>{S!=null&&S.length!==0||m!=="new"||s("../schedules/fixed_assets")}),[S,m]);const I="fixed_assets",u=r((g=>oe(g,I))),f=r((g=>g.entityAutoCompleteState.autoCompleteText.common)),D=r((g=>De(g,"common"))),J=r((g=>fe(g))),B=r((g=>g.classListState.fetchState)),w=r((g=>ae(g))),k=r((g=>ce(g).selectedPeriod)),j=J!=="Completed"||B!=="Completed";v.useEffect((()=>{o===!1&&j?(i(Ae(I,F,!0)),h(!0)):j===!1&&o===!1&&(i(Ie(I,m==="new"?void 0:m,!0)),h(!0))}),[o]),v.useEffect((()=>{if(u.markAsCompleteStatus.fetchState==="Completed")if(i(xe()),C===!0){const{month:g,year:p}=k;s(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else s("../schedules/fixed_assets")}),[u.markAsCompleteStatus.fetchState]);const b=r((g=>K(g))),x=r((g=>ne(g,b.companyId))),N=e||C,{onScheduleDecision:P,scheduleDecisionStatus:T}=ke({jeScheduleId:u.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:u.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:I,onDecided:()=>{if(c==null)if(C!==!0)s("../schedules/fixed_assets");else{const{month:g,year:p}=k;s(`../../month_end_close_checks/review/je_schedules/${g}-${p}`)}else c()}}),O=u.fetchState,X=u.allAccountList,U=u.allClassList,q=u.allDepreciationAccountList,z=u.scheduleDetailsLocalData.fixed_assets;let F;if(m!=="new"&&(F=m),y!==!0||u.fetchState==="Error")return E.jsx(Z,{});const R=O==="Completed"&&o===!0,W=u.selectedJEScheduleTransaction!=null;return O==="Completed"||e===!0&&W?E.jsxs(It,{children:[R===!0?E.jsx(ue,{analytics:_,onLoad:()=>{Lt(u,I,x)}}):null,E.jsx(xt,{onScheduleDecision:N?P:void 0,scheduleDecisionStatus:T,isRenderedInPanel:e,onPanelNavigateBack:l,location:n,navigate:s,classList:U,vendorSearchEntityAutoCompleteView:D,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:D},expenseAutomationSelectedPeriod:k,usedInExpenseAutomation:C,removeJeScheduleTransactionKey:(g,p)=>{i(Te(g,p))},accountList:X,depAccountList:q,scheduleLocalData:z,selectedJEScheduleKey:S,scheduleDetailId:F,selectedScheduledJournalEntries:u.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:a,tenantEmailDomain:d,analytics:_,controllerUserDetails:x,isAccountingClassesEnabled:w,status:u.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},Tt=e=>e!=null,Bt=e=>({transactionDate:e.date.format(he),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Lt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...Bt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(he)??null,endMonth:a.endDate?.format(he)??null})},vendorName:s.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:s.jeCredit.account?.accountName??null,assetId:s.otherAttributes.assetId??null},controllerEmails:n,controllerUserIds:i})},Jt=re.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
min-height: 100%;
|
|
28
|
+
width: 100%;
|
|
29
|
+
flex: 1 0 auto;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
align-items: center;
|
|
32
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
+
`,me=ye.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,wt=te((function(e,t){const c=K(e),l=oe(e,t.scheduleTab);return{tenantName:c.companyName,scheduleDetailsView:l}}),(function(e,t){const{navigate:c,location:l,vendorSearchAutoCompleteData:s,selectedScheduledJournalEntries:n}=t,i=n.flatMap((a=>a.error)).filter((a=>!!a))??[];return{onNavigateBack:()=>{if(t.onPanelNavigateBack!=null)return void t.onPanelNavigateBack();const a=de(t.location.state?.pathnameStackToGoBack);a.poppedPathname==null?c("../schedules/prepaid_expenses"):t.navigate(a.poppedPathname,{state:{pathnameStackToGoBack:a.newStack}})},onZeniLogoClick:()=>{t.themeState.toggle()},onSave:a=>{e(Ne(t.scheduleTab,a,i.length>0))},onDelete:a=>{e(be(t.scheduleTab,a))},onMarkAsComplete:()=>{t.selectedJEScheduleKey!=null&&e(je(t.scheduleTab,t.selectedJEScheduleKey))},onEditAmount:(a,d)=>{e(we(t.scheduleTab,a,d))},onJELinkClick:a=>{e(Je({selectedJELinkRowIndex:a})),c("./edit_link")},onTransactionClick:a=>{const d=`${V(a,t.tenantEmailDomain)}`,o=G(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o,message:"comingFromScheduleDetails"}})},onViewLinkedJE:a=>{const d=`${V(a,t.tenantEmailDomain)}`,o=G(l.state?.pathnameStackToGoBack,l.pathname);c(d,{state:{pathnameStackToGoBack:o}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(a,d)=>{a.trim().length>=2?e(ge({searchString:a,entityType:d,searchOrigin:"common"})):a.trim().length===0&&e(Y("common"))},onCancelAutoComplete:()=>{e(Y("common"))}},onDetailPageChange:(a,d)=>{const{scheduleDetailsSection:o,scheduleDetailsListSection:h}=a,{scheduleClass:A,scheduleExpenseCategory:m,months:C,startDate:y,postingDate:S,vendor:I}=o,u=s.entityAutoCompleteView.vendor.length>0?s.entityAutoCompleteView.vendor.find((x=>x.id===I?.selectedOption)):void 0,f={id:u?.zeniId??I?.selectedOption??"",name:u?.name??I?.defaultOptions.find((x=>x.value===I?.selectedOption))?.label??"",logo:u?.logo},D=A.selectedOption!=null?t.classList.find((x=>x.classId===A.selectedOption)):void 0,J=m.selectedOption!=null?t.accountList.find((x=>x.qboId===m.selectedOption)):void 0,B=C?.selectedOption,w=h.map(((x,N)=>({...t.scheduleLocalData.jeScheduleDetails[N],amount:{...t.scheduleLocalData.jeScheduleDetails[N].amount,amount:x.amount}}))),k=S.type==="day"?S.dayOfMonth?S.dayOfMonth:1:void 0,j=S.type==="lastDayOfMonth"||void 0,b={selectedAccount:J?.accountId,selectedClass:D?.classId,selectedDate:y,selectedMonths:B,jeScheduleDetails:w,lastDayOfMonth:j,selectedVendor:f,selectedDayOfMonth:k};e(Be({scheduleType:t.scheduleTab,localData:b,selectedJeScheduleDetailId:t.scheduleDetailId})),d!==!1||t.scheduleDetailId!=null&&t.status!=="draft"&&t.status!=="marked_as_completed"||J?.accountId==null||t.isAccountingClassesEnabled!==!1&&D?.classId==null||y==null||B==null||j!==!0&&k==null||e(Le({scheduleType:t.scheduleTab}))}}}))(pt),zt=({isRenderedInPanel:e=!1,scheduleDetailIdOverride:t,scheduleTypeOverride:c,onPanelCloseAfterDecision:l,onPanelNavigateBack:s}={})=>{const n=Q(),i=ee(),a=H(),d=Ee(),{tenantEmailDomain:o}=M(),[h,A]=v.useState(!1),m=i.state?.message==="expenseAutomation",{scheduleType:C,scheduleDetailId:y}=M(),S=t??y,I=jt(c??C,S),u=r((p=>p.scheduleDetailState.selectedJEScheduleKey));v.useEffect((()=>{u!=null&&u.length!==0||S!=="new"||n("../schedules/prepaid_expenses")}),[u,S]);const f=c??pe(C)??"prepaid_expenses",D=r((p=>oe(p,f))),J=r((p=>p.entityAutoCompleteState.autoCompleteText.common)),B=r((p=>De(p,"common"))),w=r((p=>fe(p))),k=r((p=>p.classListState.fetchState)),j=r((p=>ae(p))),b=r((p=>ce(p).selectedPeriod)),x=w!=="Completed"||k!=="Completed";v.useEffect((()=>{h===!1&&x?(a(Ae(f,R,!0)),A(!0)):x===!1&&h===!1&&(a(Ie(f,S==="new"?void 0:S,!0)),A(!0))}),[h]),v.useEffect((()=>{if(D.markAsCompleteStatus.fetchState==="Completed")if(a(xe()),m===!0){const{month:p,year:$}=b;n(`../../month_end_close_checks/review/je_schedules/${p}-${$}`)}else n("../schedules/prepaid_expenses")}),[D.markAsCompleteStatus.fetchState]);const N=r((p=>K(p))),P=r((p=>ne(p,N.companyId))),T=e||m,{onScheduleDecision:O,scheduleDecisionStatus:X}=ke({jeScheduleId:D.selectedJEScheduleTransaction?.jeScheduleId,scheduleKey:D.selectedJEScheduleTransaction?.jeScheduleTransactionKey,scheduleType:f,onDecided:()=>{if(l==null)if(m!==!0)n("../schedules/prepaid_expenses");else{const{month:p,year:$}=b;n(`../../month_end_close_checks/review/je_schedules/${p}-${$}`)}else l()}}),U=D.fetchState,q=D.allAccountList,z=D.allClassList,F=D.scheduleDetailsLocalData;let R;if(S!=="new"&&(R=S),I!==!0||D.fetchState==="Error")return E.jsx(Z,{});const W=U==="Completed"&&h===!0,g=D.selectedJEScheduleTransaction!=null;return U==="Completed"||e===!0&&g?E.jsxs(Jt,{children:[W===!0?E.jsx(ue,{analytics:_,onLoad:()=>{Nt(D,f,P)}}):null,E.jsx(wt,{onScheduleDecision:T?O:void 0,scheduleDecisionStatus:X,isRenderedInPanel:e,onPanelNavigateBack:s,location:i,vendorSearchEntityAutoCompleteView:B,vendorSearchAutoCompleteData:{autoCompleteText:J,entityAutoCompleteView:B},usedInExpenseAutomation:m,removeJeScheduleTransactionKey:(p,$)=>{a(Te(p,$))},expenseAutomationSelectedPeriod:b,navigate:n,classList:z,accountList:q,scheduleLocalData:F[f],selectedJEScheduleKey:u,scheduleDetailId:R,selectedScheduledJournalEntries:D.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:d,tenantEmailDomain:o,scheduleTab:f,analytics:_,controllerUserDetails:P,isAccountingClassesEnabled:j,status:D.selectedJEScheduleTransaction?.status.code})]}):E.jsx(ie,{})},jt=(e,t)=>pe(e)!=null&&t!=null,bt=e=>({transactionDate:e.date.format(me),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),Nt=(e,t,c)=>{const l=e.selectedJEScheduleTransaction?.baseTransaction,s=e.selectedJEScheduleTransaction,n=le(c.controllers),i=se(c.controllerUserIds);var a;l!=null&&s!=null&&_.trackScheduleDetailsLoaded({scheduleType:t,transaction:{...bt(l)},scheduleExpenseCategoryAndClass:{expenseCategory:s.jeDebit.account?.accountName??null,expenseClass:s.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(a=s,{currentBalance:a.balanceAsOfToday??null,currentStatus:a.status.label,period:a.period??null,startMonth:a.startDate?.format(me)??null,endMonth:a.endDate?.format(me)??null})},vendorName:s.vendor.name??null,controllerEmails:n,controllerUserIds:i})};export{Ut as J,qt as S,Xt as a,zt as b,Yt as c};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/NotFoundScreen-l_eBhBHD.js","assets/sentry-CtZyo70D.js","assets/core-DtTeGJWB.js","assets/zeni-epic-state-DZFeYKWz.js","assets/index-B_U4bcDF.js","assets/mui-UvvMpioS.js","assets/analytics-WkSvCk9z.js","assets/utils-Bmb8VI_4.js","assets/index-BQ3cXEYt.css","assets/DashboardRoutes-CxVvIZyr.js","assets/withTransactionSidePanel-DCK_khop.js","assets/useAskAiCfoHostNavButtonProps-Rl6Dxu4t.js","assets/TransactionDetailScreen-D1z9X11O.js","assets/decodeURIComponentSafe-Dnku9ZdA.js","assets/useInitialThreadRequest-B9aUCLGn.js","assets/routePaths-DsLddvmS.js","assets/expenseAutomationHelper-CNcHl26i.js","assets/stripSplatSuffix-DUYOfZtR.js","assets/reportTimeframe-CAbHy0y8.js","assets/analyticsHelper-PDBXl7Se.js","assets/CompanyPassportScreen-CCrHjEm4.js","assets/MobileAppDrawer-Diz4hNBc.js","assets/InboxNotificationsProvider-CJ59FBLr.js","assets/useTaskManagerAccess-jB_YQM25.js","assets/useAiCfoDashboardSuggestedQuestionsChips-Du9fPfH0.js","assets/FeaturePreviewScreen-5jpbyDlq.js","assets/BillPayRoutes-DjTR6LDc.js","assets/AddressScreen-6MrKOfvb.js","assets/DomesticWireDetailScreen-HGMMXsdl.js","assets/BusinessVerificationPageScreen-C8E7IOrb.js","assets/DrawerScreen-DpM9V-h3.js","assets/SetupPagesScreen-CAejgxls.js","assets/BillPayApprovalRoutes-CqcByft0.js","assets/useEnsureVendorListLoaded-CoE84-0L.js","assets/ReimbursementApprovalRuleDetailScreen-BQTsJiep.js","assets/getLocaleForTenant-Bqc2BhMq.js","assets/ReimbursementRoutes-B_5omRv6.js","assets/ReimbursementApprovalRoutes-D5ZwAxEx.js","assets/TransactionListRoutes-DZvkZnS3.js","assets/ZeniAccountStatementScreen-n4s_O46n.js","assets/SettingsRoutes-foH5ZJ3w.js","assets/AccountMappingScreen-BjOLn722.js","assets/QBOConnectionScreen-Det19rnQ.js","assets/empty-DmZnYBE2.js","assets/index-X62DPOrd.js","assets/url-DDEUDnJw.js","assets/index-CnQ2Hwrv.js","assets/accountMappingHelper-C2thHMMO.js","assets/useEmailConnectResultRefresh-DfCz3FA3.js","assets/ReportsRoutes-CRvQbciE.js","assets/ChargeCardRoutes-D1jDUnLE.js","assets/useChargeCardPusherEvents-CREE1zcc.js","assets/PeopleRoutes-rbgPpJey.js","assets/ExpenseAutomationRoutes-BykEoKxY.js","assets/useActualMatchingMatchDetail-cU8XyJV-.js","assets/ScheduleDetailsPrepaidExpensesScreen-ehyhu56d.js","assets/pathToGoBack-CTzkpPUW.js","assets/TreasuryRoutes-Bm4PZ59U.js","assets/VendorsRoutes-ThVY1BXz.js","assets/ZeniAccountRoutes-gVqLclSg.js","assets/AddressRoutes-wf3jLMp6.js","assets/PandLWithForecastRoutes-D7LURgK7.js","assets/CustomerOnboardingRoutes-CdWk604C.js","assets/TransactionDetailRoutes-CKuWykLU.js","assets/EntityDetailRoutes-CiWU9eOR.js","assets/InvoicingRoutes-DVzjxAr7.js","assets/NotificationRoutes-P-tvBMkz.js","assets/PerformanceRoutes-CoOModp8.js","assets/ActualMatchingMatchDetailScreen-DxeGt00n.js","assets/RewardsRoutes-5nWEeQ99.js","assets/TaskRoutes-C7UfLoX_.js","assets/TaskListScreen-BuEk-5wI.js","assets/useTaskManagerPusherEvents-UGiOcEas.js","assets/AiCfoScreen-D2IsGTI7.js","assets/CardsAiCfoScreen-CyjNAzbg.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{_ as s,bn as hs,fI as Es,e1 as ps,e0 as xs,Bs as Rs,dk as gs,ca as Is,gM as js,gc as Ts,dh as pe,cI as As,gq as fs,cA as Ds,bG as bs,br as ys,U$ as Cs,v as vs,V2 as Os,bq as Ps,V3 as Us,bM as ws,bL as Fs,bu as Ls,cw as Vs,V4 as ks,V5 as Hs,dc as Bs,df as Ss,de as Ns,cH as Ms,cO as Zs,p_ as xe,gl as Re,h0 as $s,gn as ge,gO as Ie,gP as je,go as Gs}from"./zeni-epic-state-DZFeYKWz.js";import{j as e}from"./liveblocks-DXlRhlw7.js";import{a as U}from"./sentry-CtZyo70D.js";import{N as u,u as zs,h as qs,i as Ys,g as Ws,j as $,q as Te,n as Ks,o as n}from"./core-DtTeGJWB.js";import{I as l,u as Xs,z as y,p as Js,f as Qs,r as et,d as S,h as st,K as tt,V as nt,L as F,G as Ae,t as _,P as at,M as ot,k as ne}from"./index-B_U4bcDF.js";import{u as rt}from"./mui-UvvMpioS.js";import{f as fe}from"./analyticsHelper-PDBXl7Se.js";import{t as it}from"./getLocaleForTenant-Bqc2BhMq.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},D=new o.Error().stack;D&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[D]="9e75c5da-bfa1-4d10-99d5-9739242faae6",o._sentryDebugIdIdentifier="sentry-dbid-9e75c5da-bfa1-4d10-99d5-9739242faae6")}catch{}})();const lt=l((()=>s((()=>import("./NotFoundScreen-l_eBhBHD.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),ut=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/reimbursements`}),dt=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/bills`}),De=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/treasury`}),be=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/checking`}),ye=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/cards`}),C=({showZeniAccountRoute:o,isUserHasBillPayAccess:D,isUserHasReimbursementAccess:N,showTreasuryRoute:i,isTenantBankingOnly:V,showChargeCardRoute:O,tenantEmailDomain:v})=>{if(V===!0){if(o)return e.jsx(be,{tenantEmailDomain:v});if(i)return e.jsx(De,{tenantEmailDomain:v});if(O)return e.jsx(ye,{tenantEmailDomain:v})}return o?e.jsx(be,{tenantEmailDomain:v}):i?e.jsx(De,{tenantEmailDomain:v}):O?e.jsx(ye,{tenantEmailDomain:v}):D?e.jsx(dt,{tenantEmailDomain:v}):N?e.jsx(ut,{tenantEmailDomain:v}):e.jsx(lt,{})},ct={dashboard:()=>s((()=>import("./DashboardRoutes-CxVvIZyr.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,25,8])),bills:()=>s((()=>import("./BillPayRoutes-DjTR6LDc.js")),__vite__mapDeps([26,1,2,3,4,5,6,7,27,0,28,11,14,29,15,21,22,23,30,25,31,19,32,33,34,35,8])),reimbursement:()=>s((()=>import("./ReimbursementRoutes-B_5omRv6.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,11,14,30,37,33,34,35,8])),transactions:()=>s((()=>import("./TransactionListRoutes-DZvkZnS3.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])),settings:()=>s((()=>import("./SettingsRoutes-foH5ZJ3w.js")),__vite__mapDeps([40,1,2,3,4,5,6,7,23,41,21,22,42,43,44,45,46,13,47,27,0,19,29,15,20,48,32,33,34,37,8])),reports:()=>s((()=>import("./ReportsRoutes-CRvQbciE.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])),chargeCards:()=>s((()=>import("./ChargeCardRoutes-D1jDUnLE.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])),people:()=>s((()=>import("./PeopleRoutes-rbgPpJey.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])),expenseAutomation:()=>s((()=>import("./ExpenseAutomationRoutes-BykEoKxY.js")),__vite__mapDeps([53,1,2,3,0,4,5,6,7,11,12,13,14,15,16,54,17,10,55,56,47,30,8])),treasury:()=>s((()=>import("./TreasuryRoutes-Bm4PZ59U.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])),vendors:()=>s((()=>import("./VendorsRoutes-ThVY1BXz.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,27,0,25,55,56,54,17,13,15,11,21,22,23,30,47,8])),zeniAccounts:()=>s((()=>import("./ZeniAccountRoutes-gVqLclSg.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,28,27,11,39,8]))},mt=["bills","transactions","settings","reimbursement","reports","chargeCards","people"],ae=o=>{"requestIdleCallback"in window?requestIdleCallback(o):setTimeout(o,100)},_t=l((()=>s((()=>import("./ReportsRoutes-CRvQbciE.js")),__vite__mapDeps([49,1,2,3,4,5,6,7,0,25,14,15,18,21,22,23,8])))),ht=l((()=>s((()=>import("./AddressRoutes-wf3jLMp6.js")),__vite__mapDeps([60,1,2,3,27,4,5,6,7,0,8])))),Et=l((()=>s((()=>import("./PeopleRoutes-rbgPpJey.js")),__vite__mapDeps([52,1,2,3,4,5,6,7,0,11,21,22,23,8])))),pt=l((()=>s((()=>import("./PandLWithForecastRoutes-D7LURgK7.js")),__vite__mapDeps([61,1,2,3,4,5,6,7,0,25,11,14,15,21,22,23,8])))),xt=l((()=>s((()=>import("./CustomerOnboardingRoutes-CdWk604C.js")),__vite__mapDeps([62,1,2,3,27,4,5,6,7,0,42,43,44,45,46,13,48,51,8])))),Rt=l((()=>s((()=>import("./VendorsRoutes-ThVY1BXz.js")),__vite__mapDeps([58,1,2,3,4,5,6,7,27,0,25,55,56,54,17,13,15,11,21,22,23,30,47,8])))),gt=l((()=>s((()=>import("./TransactionDetailRoutes-CKuWykLU.js")),__vite__mapDeps([63,1,2,3,0,4,5,6,7,13,33,12,11,14,15,16,8])))),Ce=l((()=>s((()=>import("./EntityDetailRoutes-CiWU9eOR.js")),__vite__mapDeps([64,1,2,3,4,5,6,7,13,10,11,12,14,15,16,17,8])))),It=l((()=>s((()=>import("./DashboardRoutes-CxVvIZyr.js")),__vite__mapDeps([9,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,0,18,19,20,21,22,23,24,25,8])))),ve=l((()=>s((()=>import("./BillPayRoutes-DjTR6LDc.js")),__vite__mapDeps([26,1,2,3,4,5,6,7,27,0,28,11,14,29,15,21,22,23,30,25,31,19,32,33,34,35,8])))),jt=l((()=>s((()=>import("./SettingsRoutes-foH5ZJ3w.js")),__vite__mapDeps([40,1,2,3,4,5,6,7,23,41,21,22,42,43,44,45,46,13,47,27,0,19,29,15,20,48,32,33,34,37,8])))),Tt=l((()=>s((()=>import("./InvoicingRoutes-DVzjxAr7.js")),__vite__mapDeps([65,1,2,3,4,5,6,7,27,0,21,22,23,42,43,44,45,46,13,8])))),Oe=l((()=>s((()=>import("./ReimbursementRoutes-B_5omRv6.js")),__vite__mapDeps([36,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,11,14,30,37,33,34,35,8])))),At=l((()=>s((()=>import("./ZeniAccountRoutes-gVqLclSg.js")),__vite__mapDeps([59,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,25,28,27,11,39,8])))),ft=l((()=>s((()=>import("./TreasuryRoutes-Bm4PZ59U.js")),__vite__mapDeps([57,1,2,3,4,5,6,7,0,31,29,15,21,22,23,19,11,14,25,8])))),Dt=l((()=>s((()=>import("./TransactionListRoutes-DZvkZnS3.js")),__vite__mapDeps([38,1,2,3,4,5,6,7,10,11,12,13,14,15,16,17,39,8])))),bt=l((()=>s((()=>import("./ChargeCardRoutes-D1jDUnLE.js")),__vite__mapDeps([50,1,2,3,4,5,6,7,11,21,22,23,31,29,15,0,19,14,51,27,8])))),yt=l((()=>s((()=>import("./NotificationRoutes-P-tvBMkz.js")),__vite__mapDeps([66,1,2,3,0,4,5,6,7,11,23,8])))),Ct=l((()=>s((()=>import("./PerformanceRoutes-CoOModp8.js")),__vite__mapDeps([67,1,2,3,0,4,5,6,7,11,21,22,23,8])))),vt=l((()=>s((()=>import("./ExpenseAutomationRoutes-BykEoKxY.js")),__vite__mapDeps([53,1,2,3,0,4,5,6,7,11,12,13,14,15,16,54,17,10,55,56,47,30,8])))),Ot=l((()=>s((()=>import("./ActualMatchingMatchDetailScreen-DxeGt00n.js")),__vite__mapDeps([68,1,2,3,4,5,6,7,54,17,13,15,0,8])))),Pt=l((()=>s((()=>import("./RewardsRoutes-5nWEeQ99.js")),__vite__mapDeps([69,1,2,3,4,5,6,7,0,8])))),Ut=l((()=>s((()=>import("./TaskRoutes-C7UfLoX_.js")),__vite__mapDeps([70,1,2,3,0,4,5,6,7,14,21,22,23,71,11,72,8])))),wt=l((()=>s((()=>import("./AiCfoScreen-D2IsGTI7.js")),__vite__mapDeps([73,1,2,3,4,5,6,7,24,56,15,72,8])))),Pe=l((()=>s((()=>import("./CardsAiCfoScreen-CyjNAzbg.js")),__vite__mapDeps([74,1,2,3,4,5,6,7,8])))),f=l((()=>s((()=>import("./NotFoundScreen-l_eBhBHD.js")),__vite__mapDeps([0,1,2,3,4,5,6,7,8])))),Ft=l((()=>s((()=>import("./TaskListScreen-BuEk-5wI.js").then((o=>o.f))),__vite__mapDeps([71,1,2,3,4,5,6,7,11,21,22,23,72,8])))),Lt=({isDashboardAccess:o,showZeniAccountRoute:D,isUserHasBillPayAccess:N,isUserHasReimbursementAccess:i,showTreasuryRoute:V,isTenantBankingOnly:O,isTenantCardsOnly:v,showChargeCardRoute:k})=>{if(O===!0){if(D)return e.jsx(u,{to:"checking"});if(V)return e.jsx(u,{to:"treasury"});if(k)return e.jsx(u,{to:"cards"})}return v===!0&&k?e.jsx(u,{to:"cards"}):o?e.jsx(u,{to:"dashboard"}):D?e.jsx(u,{to:"checking"}):V?e.jsx(u,{to:"treasury"}):k?e.jsx(u,{to:"cards"}):N?e.jsx(u,{to:"bills"}):i?e.jsx(u,{to:"reimbursements"}):e.jsx(u,{to:"dashboard"})},Ue=({tenantEmailDomain:o})=>e.jsx(u,{to:`/${o}/dashboard`}),$t=Object.freeze(Object.defineProperty({__proto__:null,default:function({setTenantEmailDomain:o}){const D=zs(),N=qs(),{tenantEmailDomain:i}=Ys(),V=rt().mode,{setLoading:O,clearAllLoading:v,clearLoading:k}=Xs(),b=y.getSignedInUserTenant(i)?.tenantId,j=y.getSignedInUser(),K=hs(j),G=Ws(),[L,we]=U.useState(!1),r=$((a=>Es(a))),{useFeatureGate:H}=Js(),M=Qs(),X=et(),Fe=!!r.company?.companyZeniAccountInfo?.isZeniAccountEnabled,Le=r.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:Ve}=H(S.isChargeCardFeatureEnabled),{isFeatureEnabled:oe}=H(S.isDebitCardFeatureEnabled),T=$((a=>a.tenantState.fetchState)),p=$((a=>a.tenantState.activeTenantFetchState.fetchState)),h=p==="Completed"||T==="Completed"?ps(oe,r):void 0,J=p==="Completed"||T==="Completed"?xs(r):void 0,re=p==="Completed"||T==="Completed"?Rs(r)&&!gs(r):void 0,ke=st(r,Ve,oe),{isCardsHidden:He}=tt(r?.tenantId),Be=!ke||!!He,{isFeatureEnabled:Se}=H(S.isSettingsFeatureEnabled),{isFeatureEnabled:Q}=H(S.isAiCfoFileUploadEnabled),{isFeatureEnabled:Ne}=H(S.isInvoicingFeatureEnabled??"is_invoicing_feature_enabled"),Me=Ne||ot==="DEV",Ze=r?.userRole!=null&&Is(r.userRole),z=$((a=>js(a)));if(i!=null){const a=y.getSignedInUserTenant(i);j!=null&&a!=null&&fe(j,r,V)}const Z={tenantId:b,userId:j?.userId,sessionId:j?.zeniSessionId},ie=Ts(),E=nt(),$e=r.company==null||E?.loggedInUserRoleMap!=null&&pe(E.loggedInUserRole),Ge=As(E?.loggedInUserRoleMap),ee=Te("/:tenantEmailDomain/onboarding/*")!==null,ze=Te("/:tenantEmailDomain/month_end_close_checks/review/:selectedTab/:selectedPeriod/*"),se=ze?.params.selectedPeriod,qe=$((a=>Z.tenantId!=null?fs(a,Z.tenantId):void 0));U.useEffect((()=>{O(F.TENANT_FETCHING),o(i)}),[i]),U.useEffect((()=>{if(se!=null&&b!=null){const a=se.split("-");if(a.length===2){const A=Ds(Number(a[0])),c=Number(a[1]),t=bs(`01-${A<10?`0${A}`:A}-${c}`,Ae.getLocalizedStrings().dateFormat.analytics.DDDashMMDashYYYY),d=ys();t.isAfter(d,"month")===!1?D(Cs(b,{month:A,year:c})):N(`/${i}/month_end_close_checks/review`)}}}),[se,i,b]),U.useEffect((()=>{L||(we(!0),O(F.TENANT_FETCHING))}),[L,Z,ie,j,D,y]),U.useLayoutEffect((()=>{!vs(ie,Z)&&y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t){if(Re(A?.userId,A?.zeniSessionId,a.tenantId),c($s(!0)),c(ge(a.tenantId)),a.tenantId!=null&&_.clearTenant(a.tenantId),a.tenantId!=null){const d=y.getSignedInUserTenantWithId(a.tenantId);t&&Ae.updateAppLocaleID(it(t)),d?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(d?.tenantEmailDomain)}a.userId!=null?ne.identify(a.userId,{tenant_id:a.tenantId}):ne.resetUserIdentity()})(Z,j,D,qe))}),[b]),U.useEffect((()=>{y.isSignedIn()&&(O(F.TENANT_FETCHING),(function(a,A,c,t,d,q,B){if(c==null&&t==null)return void console.warn("There is no current tenant selected!!");const Y=t!=null&&d?.zeniSessionId!=null,cs=c==null||c.tenantId!==t,ms=c!=null&&c.excludedResources==null,_s=c!=null&&c.externalConnections==null;if(Y&&cs){B(ge(t));const W=y.getSignedInUserTenantWithId(t);W?.tenantEmailDomain!=null&&y.saveActiveTenantDomainForUser(W?.tenantEmailDomain),Re(d?.userId,d?.zeniSessionId,t),_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)))}else Y&&ms&&_.shouldFetchExcludedResources(t)&&(_.markExcludedResourcesFetchStarted(t),B(Ie(d.userId,t))),Y&&_s&&_.shouldFetchConnections(t)&&(_.markConnectionsFetchStarted(t),B(je(d.userId,t)));if(Y){ne.identify(d.userId,{tenant_id:t});const W=t==null||t!=null&&(A==="Completed"||A==="Error");a==="Completed"||A!=="Not-Started"&&A!=="Error"||t==null||!_.shouldFetchActiveTenant(t)||(_.markActiveTenantFetchStarted(t),q(F.TENANT_FETCHING),B(Gs(d.userId,t,d.zeniSessionId))),W&&(a==="Not-Started"||a==="Error")&&_.shouldFetchAllTenants()&&(_.markAllTenantsFetchStarted(),B(xe(d.userId,d.zeniSessionId)))}})(T,p,r,b,j,O,D))}),[b,p]),U.useEffect((()=>{y.isSignedIn()&&T==="Completed"&&z.tenantsBaseInOrder.length>0&&(k(F.TENANT_FETCHING),y.saveSignedInUserTenants(Os(z.tenantsBaseInOrder)),j!=null&&fe(j,r,V,void 0,z.tenantsBaseInOrder))}),[z,T,r,j]),U.useEffect((()=>{p==="In-Progress"&&O(F.TENANT_FETCHING),p!=="Completed"&&p!=="Error"||(p==="Completed"&&b!=null?(v(),_.markActiveTenantFetchCompleted(b)):p==="Error"&&b!=null&&(_.markActiveTenantFetchFailed(b),k(F.TENANT_FETCHING),k(F.TENANT_SWITCHING))),T!=="Completed"&&T!=="Error"||(T==="Completed"?_.markAllTenantsFetchCompleted():T==="Error"&&_.markAllTenantsFetchFailed())}),[p,T,b,L]);const le=U.useRef(!1);U.useEffect((()=>{!le.current&&p==="Completed"&&L&&(le.current=!0,(function(a=mt,A=3e3){setTimeout((()=>{const c=t=>{if(t>=a.length)return;const d=a[t],q=ct[d];q!=null?q().then((()=>ae((()=>c(t+1))))).catch((()=>ae((()=>c(t+1))))):c(t+1)};ae((()=>c(0)))}),A)})())}),[p,L]);const P=r?.userRole!=null&&Ps(r?.userRole),{isFeatureEnabled:Ye}=H(S.isReferralFeatureEnabled),{isFeatureEnabled:We}=H(S.isAccrualEnabled),Ke=r?.userRole!=null&&r.userRole.includes("charge_card_user"),Xe=r?.userRole!=null&&r.userRole.includes("charge_card_admin"),w=r?.userRole!=null&&pe(r.userRole),ue=r?.company==null||r.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!P,de=!Be&&!P,Je=Us(E?.loggedInUserRoleMap),Qe=r.externalConnections?.accounting[0]?.isValid,es=r.externalConnections?.fetchState==="Completed",te=r.company?.companyOnboardingInfo.isOnboardingCompleted,ce=r?.company==null||r.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!P,me=ce&&ws(E?.loggedInUserRoleMap),_e=Fe&&!P,ss=Le&&!P,ts=ue&&Fs(E?.loggedInUserRoleMap),ns=de&&Ls(E?.loggedInUserRoleMap),as=_e&&Vs(E?.loggedInUserRoleMap),os=ks(E?.loggedInUserRoleMap),rs=Hs(E?.loggedInUserRoleMap),is=Bs(E?.loggedInUserRoleMap),ls=Ss(E?.loggedInUserRoleMap),us=Ns(E?.loggedInUserRoleMap),x=Ms(E?.loggedInUserRoleMap),R=Zs(E?.loggedInUserRoleMap),he=ue&&x,Ee=ce&&R,g=_e&&is,I=ss&&ls,m=de&&us,ds=r.excludedResources?.resources?.find((a=>a.resource==="/invites"))!=null||Ge===!0||Je===!0||os===!0||rs===!0;return y.isSignedIn()?b==null?T==="Completed"?e.jsx(u,{to:"/",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}):(j!=null&&T!=="In-Progress"&&D(xe(j.userId,j.zeniSessionId)),null):p!=="In-Progress"&&p!=="Not-Started"||T==="Completed"?(te===!0||K&&!ee)&&es&&Qe!==!0&&h===!1&&J===!1&&re===!1?(o(void 0),e.jsx(u,{to:"/connection/auth",replace:!0})):!L||re!==!0||te!==!0||ee||K?!L||te!==!1||ee||K?L&&r?.userRole&&h!=null&&J!=null&&i!=null&&Object.keys(E.loggedInUserRoleMap).length>0?e.jsx(Ks,{children:e.jsxs(n,{element:e.jsx(at,{}),children:[e.jsx(n,{path:"/",element:e.jsx(Lt,{isDashboardAccess:w,showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,isTenantCardsOnly:J,showChargeCardRoute:m})}),e.jsx(n,{path:"dashboard/*",element:w?e.jsx(It,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reports/*",element:w?e.jsx(_t,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"people/*",element:ds||w?e.jsx(Et,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"forecast/*",element:w?e.jsx(pt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"onboarding/*",element:e.jsx(xt,{})}),e.jsx(n,{path:"transaction/*",element:w&&P===!1||Ke||Xe?e.jsx(gt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"transactions/*",element:w&&P===!1?e.jsx(Dt,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"customer/*",element:w&&P===!1?e.jsx(Ce,{entityType:"customer"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,isTenantBankingOnly:h,showTreasuryRoute:I,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"vendor/*",element:w&&P===!1?e.jsx(Ce,{entityType:"vendor"}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"tasks",element:e.jsx(Ft,{})}),e.jsx(n,{path:"tasks/*",element:e.jsx(Ut,{})}),e.jsx(n,{path:"address/*",element:ts||me||as||ns?e.jsx(ht,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"checking/*",element:g?e.jsx(At,{}):e.jsx(f,{})}),e.jsx(n,{path:"treasury/*",element:I?e.jsx(ft,{}):e.jsx(f,{})}),e.jsx(n,{path:"performance",element:X===!0?e.jsx(Ct,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"month_end_close_checks/review/*",element:X===!0&&P===!1?e.jsx(vt,{}):e.jsx(Ue,{tenantEmailDomain:i})}),e.jsx(n,{path:"expense-automation/actual-matching/:matchId",element:X===!0&&P===!1&&We===!0?e.jsx(Ot,{}):e.jsx(f,{})}),e.jsx(n,{path:"notifications/*",element:e.jsx(yt,{})}),e.jsx(n,{path:"vendors/*",element:$e?e.jsx(Rt,{}):e.jsx(f,{})}),e.jsx(n,{path:"bill/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"bills/*",element:he?e.jsx(ve,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursement/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"reimbursements/*",element:Ee?e.jsx(Oe,{}):e.jsx(C,{showZeniAccountRoute:g,isUserHasBillPayAccess:x,isUserHasReimbursementAccess:R,showTreasuryRoute:I,isTenantBankingOnly:h,showChargeCardRoute:m,tenantEmailDomain:i})}),e.jsx(n,{path:"settings/*",element:Se?e.jsx(jt,{hasAdminLevelAccess:me}):e.jsx(f,{})}),e.jsx(n,{path:"invoicing/*",element:Me&&Ze?e.jsx(Tt,{}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(f,{})}),e.jsx(n,{path:"cards/ask/:session_id",element:m&&M?e.jsx(Pe,{isFileUploadEnabled:Q}):e.jsx(f,{})}),e.jsx(n,{path:"cards/*",element:m?e.jsx(bt,{}):e.jsx(f,{})}),e.jsx(n,{path:"rewards/*",element:Ye?e.jsx(Pt,{}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/",element:M?e.jsx(u,{to:"explore"}):e.jsx(f,{})}),e.jsx(n,{path:"/ai-cfo/:session_id",element:M?e.jsx(wt,{isFileUploadEnabled:Q}):e.jsx(f,{})}),e.jsx(n,{path:"*",element:e.jsx(f,{})})]})}):null:(o(void 0),e.jsx(u,{to:`/${i}/onboarding`,replace:!0})):(o(void 0),e.jsx(u,{to:`/${i}/onboarding/thankyou`,replace:!0})):null:(console.warn("User logged out!!"),o(void 0),e.jsx(u,{to:"/signin/auth",replace:!0,state:{...G.state,message:"...",origin:G.pathname}}))}},Symbol.toStringTag,{value:"Module"}));export{C as F,$t as S};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-DXlRhlw7.js";import{a as d}from"./sentry-CtZyo70D.js";import{h as F,g as H,u as U,i as L,j as C,l as K,n as J,o as k}from"./core-DtTeGJWB.js";import{fI as v,_t as Pe,Oe as je,_0 as ve,_9 as we,ca as Y,cV as Ae,cW as De,bq as Ue,dg as Re,Gw as Te,_u as Me,PH as Be,N5 as Ne,MY as de,MV as Oe,GA as ue,M$ as pe,N2 as ge,N8 as X,CE as ee,Gz as Ve,ly as Z,lB as me,_v as Fe,mL as Le,GR as Ge,Wu as $e,Wv as Ze,lw as He,_w as Ke,lz as We,uP as ze,Wp as qe,Wq as Je,uT as Qe,hZ as Ye,Vm as q,hR as ae,hO as Xe,hW as en,Vn as nn,GO as tn,_x as an,_y as on,Nm as sn,m3 as rn,e0 as fe,e1 as he,_z as ln,gF as cn,VD as dn,GN as oe,gK as se,gJ as un,GM as pn,gI as gn,gH as mn,_A as fn,UO as Ce,_B as hn,_C as Cn,_D as yn,_E as Sn,_F as bn,_G as In,GU as xn,_H as En,GL as ie,GF as $,_I as kn,_J as _n,_K as re,_L as Pn,dV as jn,_M as vn,_N as wn,_O as An,U_ as Dn,c2 as Un,c9 as Rn,c8 as Tn,c3 as Mn,_P as Bn,c6 as Nn,c5 as On,c7 as Vn,c4 as Fn}from"./zeni-epic-state-DZFeYKWz.js";import{bU as Ln,z as j,V as G,a5 as ne,c4 as Gn,k as W,p as te,d as O,h as ye,K as Se,c5 as $n,j as Zn,W as be,c6 as Hn,ag as Kn,c7 as Wn,c8 as zn,ao as qn,c9 as Jn,l as Qn,e as Ie,ca as Yn}from"./index-B_U4bcDF.js";import{n as B}from"./mui-UvvMpioS.js";import{u as xe}from"./useTaskManagerAccess-jB_YQM25.js";import{U as Xn}from"./AccountMappingScreen-BjOLn722.js";import{t as et,A as nt}from"./AddressScreen-6MrKOfvb.js";import V from"./NotFoundScreen-l_eBhBHD.js";import{g as tt}from"./analyticsHelper-PDBXl7Se.js";import{u as at,B as ot}from"./BusinessVerificationPageScreen-C8E7IOrb.js";import{C as st}from"./CompanyPassportScreen-CCrHjEm4.js";import{M as T}from"./MobileAppDrawer-Diz4hNBc.js";import{u as it,a as rt}from"./useEmailConnectResultRefresh-DfCz3FA3.js";import{q as le}from"./QBOConnectionScreen-Det19rnQ.js";import{B as lt}from"./BillPayApprovalRoutes-CqcByft0.js";import{R as ct}from"./ReimbursementApprovalRoutes-D5ZwAxEx.js";import"./recharts-VBeTlX07.js";import"./analytics-WkSvCk9z.js";import"./plaid-CIpr1Lyg.js";import"./dnd-DR4eaoV-.js";import"./stripe-cKAAJElX.js";import"./lottie-DOEy9FLJ.js";import"./lexical-DF0K2978.js";import"./pdf-rdPHFveP.js";import"./utils-Bmb8VI_4.js";import"./accountMappingHelper-C2thHMMO.js";import"./routePaths-DsLddvmS.js";import"./InboxNotificationsProvider-CJ59FBLr.js";import"./empty-DmZnYBE2.js";import"./pdf-lib-C8URdnXW.js";import"./index-X62DPOrd.js";import"./url-DDEUDnJw.js";import"./index-CnQ2Hwrv.js";import"./decodeURIComponentSafe-Dnku9ZdA.js";import"./useEnsureVendorListLoaded-CoE84-0L.js";import"./ReimbursementApprovalRuleDetailScreen-BQTsJiep.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="d3550452-3a46-4437-8c5d-994dae6b85c4",e._sentryDebugIdIdentifier="sentry-dbid-d3550452-3a46-4437-8c5d-994dae6b85c4")}catch{}})();const dt=B.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,ut=K((function(e,l){const o=v(e),i=ve(e),r=we(e),n=l.roleMap.bill_pay_admin;return{isDisabled:(Y(o?.userRole??[])||n)&&"readonly",billpayApprovalView:i,remiApproverView:r,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i}=l;return{onSetupApprovalRulesBillPaySectionClick:()=>{o("bills/approval-rules")},onSetupApprovalRulesRemiSectionClick:()=>{o("reimbursements/approval-rules")},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))(Gn),pt=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),c=C((g=>v(g)));at();const u=C((g=>g.remiSetupApproverViewState.fetchState)),h=C((g=>Pe(g))),{isApprovalRulesV3Enabled:S,isLoading:m}=Ln(c?.tenantId),p=c.companyId??j.getSignedInUserTenant(i)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access Approval Rules settings page without signing in...");const b=G();d.useEffect((()=>{t||u!=="Not-Started"||m||c?.tenantId==null||(s(!0),o(je(!0,!1,!1,S)))}),[t,u,m,S,c?.tenantId,o]);const E=g=>{n(g)};return b?.loggedInUserRoleMap!=null?a.jsxs(dt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:E}),a.jsx(ut,{navigate:e,location:l,companyId:p,currentTenant:c,roleMap:b.loggedInUserRoleMap,onClickMenuIcon:()=>{E(!0)}})]}):a.jsx(ne,{fetchState:h.fetchState})},gt=B.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100%;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
`,mt=K((function(e,l){const{companyId:o,isZeniAccountEnabled:i,isChargeCardEnabled:r,isBillPayEnabled:n,isRemiEnabled:t,isTreasuryEnabled:s}=l,c=v(e);return{bankSetupView:Me(e,o,n,t,i,r,s),connectedAccountProvider:c.company?.featuresActivationInfo.connectedAccountProvider??"",analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t,s)=>{e(ee(t,n,s))},onEstablishConnectionClick:(n,t,s)=>{e(X(n,r,t,s))},onUpdatePaymentAccountStatus:(n,t,s,c,u)=>{e(ge(n,t,u,c,s))},onUpdatePaymentAccountLoginStatus:(n,t,s,c)=>{e(pe(!1,n,c,s,t))},onEstablishConnectionSuccess:(n,t)=>{e(ue(t,n))},onUpdateAccountClick:(n,t,s,c,u)=>{e(u==="paymentAccount"?de(n,t,s,c):Oe(c,n,t))},onUpdatePrimaryFundingAccount:(n,t,s)=>{e(Ne(r,t,n,s))},onRemoveConnection:n=>{e(Be(n))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")}}}))($n),ft=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),r=G(),{useFeatureGate:n}=te(),{isFeatureEnabled:t}=n(O.isChargeCardFeatureEnabled),{isFeatureEnabled:s}=n(O.isDebitCardFeatureEnabled),[c,u]=d.useState(!1),[h,S]=d.useState(!1),m=C((w=>v(w))),p=C((w=>w.settingsViewState.bankConnection.fetchState)),b=Ae(m,r?.loggedInUserRoleMap),E=De(m,r?.loggedInUserRoleMap),g=m?.userRole!=null&&Ue(m.userRole),P=!!m.company?.companyZeniAccountInfo?.isZeniAccountEnabled&&!g,_=m.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified"&&!g,R=ye(m,t,s),A=Re(m,r?.loggedInUserRoleMap)&&R,{isCardsHidden:I}=Se(m?.tenantId),x=m.companyId??j.getSignedInUserTenant(i)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");d.useEffect((()=>{h||p==="Completed"||(S(!0),o(Te(!1)))}),[h,o,p]);const M=w=>{u(w)};return b||P||E||A?a.jsxs(gt,{children:[a.jsx(T,{isAppContentDrawerOpen:c,handleDrawerToggle:M}),a.jsx(mt,{navigate:e,location:l,companyId:x,currentTenant:m,roleMap:r.loggedInUserRoleMap,isBillPayEnabled:b,isRemiEnabled:E,isZeniAccountEnabled:P,isChargeCardEnabled:A,isChargeCardsHidden:I,isTreasuryEnabled:_,onClickMenuIcon:()=>{M(!0)}})]}):a.jsx(V,{})},ht=B.div`
|
|
18
|
+
display: flex;
|
|
19
|
+
height: 100%;
|
|
20
|
+
width: 100%;
|
|
21
|
+
flex: 1 1 auto;
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
align-items: center;
|
|
24
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
25
|
+
`,Ct=K((function(e,l){const{companyId:o}=l,i=v(e),r=l.roleMap.bill_pay_admin,n=Fe(e,o),{uiState:t}=n,s=(Y(i?.userRole??[])||r)&&n.setupView.accountFetchStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.link_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.plaidConnectionDetails.update_account.updateStatus.fetchState!=="In-Progress"&&n.setupView.accountUpdateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{billingSetupView:n,uiState:t,stripeKey:be.stripeKey,isCardPaymentPopupOpen:!1,connectedAccountProvider:i.company?.featuresActivationInfo.connectedAccountProvider??"",isDisabled:s,analytics:W}}),(function(e,l){const{navigate:o,currentTenant:i,companyId:r}=l;return{onFetchLinkTokenClick:(n,t)=>{e(ee("billing_setup",n,t))},onEstablishConnectionClick:n=>{e(X(n,r,"billing_setup","billing"))},onEstablishConnectionSuccess:()=>{e(ue("billing","billing_setup"))},onUpdatePaymentAccountStatus:(n,t,s)=>{e(ge(n,t,"billing","billing_setup",s))},onUpdatePaymentAccountLoginStatus:(n,t)=>{e(pe(!1,n,"billing","billing_setup",t))},onUpdateAccountClick:(n,t)=>{e(de(n,t,"billing","billing_setup"))},onBackClick:()=>{i?.companyBillPayInfo?.info?.isBillPayEnabled!=null&&i.companyBillPayInfo.info.isBillPayEnabled===!1?o("../.."):o("../")},onNavigateToDashboard:()=>{o("../dashboard")},handleCreateCardSetupIntent:n=>{e(me(n))},handleConfirmCardSetupIntent:n=>{e(We(n))},updateCardPaymentModalState:n=>{e(Ke({isCardPaymentPopupOpen:n}))},handleAddCardPaymentSource:(n,t,s)=>{e(He(n,t,s))},handleFetchPaymentSources:()=>{e(Z())},resetCardPaymentViewState:()=>{e(Ze())},handleResetCardPaymentErrorStatuses:()=>{e($e())},onBillingAddressSave:n=>{e(Ge(n))},onAddressEditHandler:n=>{if(n!=null){const t=et(n);e(Le({addressType:"subscription_billing_address",addressToCreate:t}))}}}}))(Hn),yt=()=>{const e=F(),l=H(),o=U(),{tenantEmailDomain:i}=L(),[r,n]=d.useState(!1),[t,s]=d.useState(!1),[c,u]=d.useState(!1),h=C((_=>v(_))),S=C((_=>_.cardPaymentViewState)),m=C((_=>_.plaidAccountViewState.billing_setup.accountDetails.fetchStatus.fetchState)),p=Zn(S.addCardPaymentSourceStatus.fetchState),b=S.addCardPaymentSourceStatus.fetchState,E=h.companyId??j.getSignedInUserTenant(i)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access bank connections page without signing in...");const g=G();d.useEffect((()=>{E!=null&&o(Ve(E,!1))}),[E,o]),d.useEffect((()=>{t||(s(!0),o(Z()))}),[t,o]),d.useEffect((()=>{c||(me(["card"]),u(!0))}),[c]),d.useEffect((()=>{p==="In-Progress"&&b==="Completed"&&o(Z())}),[p,b]);const P=_=>{n(_)};return g?.loggedInUserRoleMap!=null?a.jsxs(ht,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:P}),a.jsx(Ct,{navigate:e,location:l,companyId:E,currentTenant:h,roleMap:g.loggedInUserRoleMap,onClickMenuIcon:()=>{P(!0)},googleAPIKey:be.googleMapsAPIKey})]}):a.jsx(ne,{fetchState:m})},Q="external_integrations",St=K((function(e){const l=Je(e,Q);return{notifyMeRegisteredSlugs:new Set(l.map((o=>o.additionalInfo)).filter((o=>o!=null)))}}),(function(e,l){const{navigate:o,integrationsView:i,signedInUserEmail:r,tenantEmailDomain:n,tenantId:t}=l;return{onBackClick:()=>{o("../")},onNavigateToDashboard:()=>{o("../dashboard")},onReconnectQBO:()=>{le.init("/connection/auth",n),le.handleClick()},onRefreshClick:()=>{i.integrations.refreshQBO.fetchState!=="In-Progress"&&e(tn())},onSaveChargeBeeCredentials:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="chargebee"))?.connectionId;u!=null&&e(en(t,u,q("revenue"),nn("chargebee"),{api_key:s,site:c}))},onConnectHubSpot:(s,c)=>{const u=i.externalConnections?.revenue?.find((h=>h.connectionName==="hubspot"))?.connectionId;if(u!=null){const h=`${window.location.origin}/oauth/hubspot/callback`;sessionStorage.setItem("hubspot_oauth_pending",JSON.stringify({client_id:s,client_secret:c,connection_id:u,redirect_uri:h,tenant_id:t}));const S="oauth crm.objects.deals.read crm.objects.owners.read";window.location.href=`https://app.hubspot.com/oauth/authorize?client_id=${encodeURIComponent(s)}&scope=${encodeURIComponent(S)}&redirect_uri=${encodeURIComponent(h)}`}},onDisconnect:(s,c)=>{e(Xe(t,s,q(c)))},onConnectGmail:()=>{e(ae(t,"gmail",window.location.href))},onConnectOutlook:()=>{e(ae(t,"outlook",window.location.href))},onSaveConnectorCredentials:s=>{e(Ye(t,q("payments"),s))},onNotifyMe:s=>{W.trackIntegrationsNotifyMeClicked("Settings",s),e(Qe(Q,s,r))}}}))(Wn),bt=()=>{const e=Kn(),l=F(),o=U(),{tenantEmailDomain:i}=L(),{pendingAutoFocusTabId:r}=it(),[n,t]=d.useState(!1),s=C((I=>I.tenantState.fetchState)),c=C((I=>v(I))),u=c.companyId??j.getSignedInUserTenant(i)?.companyId,h=j.getSignedInUser(),S=G(),m=Y(c.userRole??[]);if(h==null)throw Error("Can't access Integrations page without signing in...");d.useEffect((()=>{o(ze(Q))}),[o]);const[p,b]=d.useState(!1);d.useEffect((()=>{p||(b(!0),o(Z()))}),[p,o]);const E=I=>{t(I)},g=C((I=>qe(I,u))),P=C((I=>I.plaidAccountViewState.external_account.plaidConnectionDetails)),{plaidAccounts:_,onAddPlaidAccount:R,onReLoginPlaidAccount:A}=rt({companyId:u??c.companyId});return S?.loggedInUserRoleMap!=null?a.jsxs(It,{children:[a.jsx(T,{isAppContentDrawerOpen:n,handleDrawerToggle:E}),a.jsx(St,{navigate:l,meetingUrl:e("settings_integrations"),onClickMenuIcon:()=>{E(!0)},isAdmin:m,integrationsView:g,signedInUserEmail:h.userEmail??"",tenantEmailDomain:c.tenantEmailDomain??i??"",tenantId:c.tenantId,saveChargeBeeState:g.externalConnections?.saveAPIKeyConnectionState??"Not-Started",saveChargeBeeError:g.externalConnections?.saveAPIKeyConnectionError?.message,saveHubSpotState:g.externalConnections?.saveOAuthConnectionState??"Not-Started",saveHubSpotError:g.externalConnections?.saveOAuthConnectionError?.message,saveConnectorCredentialsStateBySlug:g.externalConnections?.saveConnectorCredentialsStateBySlug??{},saveConnectorCredentialsErrorBySlug:Object.fromEntries(Object.entries(g.externalConnections?.saveConnectorCredentialsErrorBySlug??{}).map((([I,x])=>[I,x?.message]))),deleteConnectionState:g.externalConnections?.deleteConnectionState??"Not-Started",deleteConnectionError:g.externalConnections?.deleteConnectionError?.message,isLoading:s==="In-Progress",autoFocusTabId:r??void 0,plaidAccounts:_,onAddPlaidAccount:R,onReLoginPlaidAccount:A,plaidConnectionDetails:P})]}):a.jsx(ne,{fetchState:s})},It=B.div`
|
|
26
|
+
display: flex;
|
|
27
|
+
height: 100%;
|
|
28
|
+
width: 100%;
|
|
29
|
+
flex: 1 1 auto;
|
|
30
|
+
flex-direction: column;
|
|
31
|
+
align-items: center;
|
|
32
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
+
`,xt=B.div`
|
|
34
|
+
display: flex;
|
|
35
|
+
height: 100%;
|
|
36
|
+
width: 100%;
|
|
37
|
+
flex: 1 1 auto;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
align-items: center;
|
|
40
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
41
|
+
`,Et=()=>{const e=U(),{tenantEmailDomain:l}=L(),[o,i]=d.useState(!1),r=C((p=>v(p))).companyId??j.getSignedInUserTenant(l)?.companyId,n=j.getSignedInUser();if(n==null)throw Error("Can't access my bank connections page without signing in...");const t=C((p=>an(p,n.userId))),s=C((p=>on(p,r,"bill_pay","user_reimbursement_account"))),{plaidConnectionDetails:c}=s,u=p=>{i(p)},h=d.useCallback((p=>{e(ee("user_reimbursement_account",p))}),[]),S=d.useCallback((p=>{e(X(p,r,"user_reimbursement_account",void 0,"link_account_no_microdeposit"))}),[]);d.useEffect((()=>{t.fetchState!=="Completed"&&t.fetchState!=="In-Progress"&&e(sn(n.userId))}),[n.userId,t.fetchState]);const m=t.fetchState==="Not-Started"||t.fetchState==="In-Progress";return a.jsxs(xt,{children:[a.jsx(T,{isAppContentDrawerOpen:o,handleDrawerToggle:u}),a.jsx(zn,{plaidConnectionDetails:c,isLoading:m,myBankConnectionsView:t,onFetchLinkTokenClick:h,onEstablishConnectionClick:S,onClickMenuIcon:()=>{u(!0)}})]})},kt=B.div`
|
|
42
|
+
display: flex;
|
|
43
|
+
height: 100%;
|
|
44
|
+
width: 100%;
|
|
45
|
+
flex: 1 1 auto;
|
|
46
|
+
flex-direction: column;
|
|
47
|
+
align-items: center;
|
|
48
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
49
|
+
`,ce=({appContent:e})=>{const l=U(),o=F(),i=H(),[r,n]=d.useState(!1),t=C((y=>v(y))),{tenantEmailDomain:s}=t,c=t.companyId??j.getSignedInUserTenant(s)?.companyId;if(j.getSignedInUser()==null)throw Error("Can't access My Profile page without signing in...");const{useFeatureGate:u}=te(),h=!!t.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:S}=u(O.isChargeCardFeatureEnabled),{isFeatureEnabled:m}=u(O.isDebitCardFeatureEnabled),p=t.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",b=C((y=>rn(y))),E=fe(t),g=he(m,t),P=!g&&b,_=ye(t,S,m),{isCardsHidden:R}=Se(t?.tenantId),A=!_||R,{areTenantIdsInSync:I}=qn();d.useEffect((()=>{I&&l(ln(c,P))}),[c,l,P,I]);const x=C((y=>cn(y,P))),M=x.fetchState==="Not-Started"||x.fetchState==="In-Progress"||c==null,w=dn(t),f=!!t.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,D=y=>{n(y)};return a.jsxs(kt,{children:[a.jsx(T,{isAppContentDrawerOpen:r,handleDrawerToggle:D}),e!=null?a.jsx(a.Fragment,{children:e}):a.jsx(Jn,{myProfileView:x,isAccountingClassesEnabled:b,isReimbursementDisabled:f===!1,isZeniAccountsDisabled:h===!1,isChargeCardDisabled:A,isTreasuryDisabled:p===!1,isLiteRoleDisabled:w===!1,onClickMenuIcon:()=>{D(!0)},isLoading:M,isBankingOnlyTenant:g,isCardsOnlyTenant:E,onAddressClick:y=>{const N=(function(ke,_e){let z=`/${ke}/settings/my_profile`;return z=z.concat(`/new/${_e}`),z})(s,y),Ee=Qn(i.state?.pathnameStackToGoBack,i.pathname);o(N,{state:{pathnameStackToGoBack:Ee}})},onGetOtp:y=>{const N={...x.myProfileLocalData,phone:y};l(oe({localData:N})),l(mn(y,"MyProfile"))},onResendOtp:y=>{l(gn(y,"MyProfile"))},onCancelClick:()=>{l(pn())},onSaveClick:()=>{l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},onVerifyOtp:(y,N)=>{l(un(y,N,"MyProfile"))},onVerifyOtpSuccess:y=>{y!=null&&j.saveZeniOtpToken(y),l(se("MyProfile",x.myProfileLocalData.phone,x.myProfileLocalData.otpChallenge,x.myProfileLocalData.dateOfBirth,x.addressData?.addressToCreate))},updateMyProfileLocalData:y=>{l(oe({localData:y}))}})]})};function _t(){const e=U(),l=C((f=>v(f))),o=l.companyId,i=l.tenantId,r=C((f=>fn(f))),n=C((f=>Ce(f))),t=C((f=>hn(f.notificationRegistryState))),s=C((f=>Cn(f))),c=C((f=>yn(f))),u=Ie(),{isZeniUser:h,isNotificationControlsEnabled:S}=xe(u),[m,p]=d.useState(!1),b=d.useCallback((f=>{p(f)}),[]),E=d.useCallback((f=>{e(Sn(f))}),[]),g=d.useCallback((()=>{u?.userEmail!=null&&e(bn({loggedInUserEmail:u.userEmail})),e(In())}),[u?.userEmail]),P=d.useCallback((()=>{e(xn()),c&&e(En())}),[c]);if(u==null)throw Error("Can't access Notification Settings page without signing in...");const _=d.useCallback((()=>{const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o)),e($())}),[o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled]),R=d.useCallback((()=>{e(kn())}),[]),A=d.useCallback(((f,D,y)=>{e(_n({eventId:f,channel:re(D),enabled:y}))}),[e]),I=d.useCallback(((f,D)=>{e(Pn({groupId:f,frequency:jn(D)}))}),[e]),x=d.useCallback(((f,D,y)=>{e(vn({groupId:f,channel:re(D),enabled:y}))}),[e]),M=d.useMemo((()=>{if(S&&t!=null)return{isZeniUser:h,registry:t,preferences:s,onToggleEventChannel:A,onSetGroupFrequency:I,onSetGroupChannelMaster:x}}),[S,h,t,s,A,I,x]);d.useEffect((()=>{i!=null&&n.fetchState==="Not-Started"&&e($())}),[e,i,n.fetchState]);const w=d.useRef(i);return d.useEffect((()=>{w.current!==i&&(e(wn()),e(An()),e($()),w.current=i)}),[e,i]),d.useEffect((()=>{if(n.fetchState==="Completed"&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"){const f=n.notificationSettings.monthEndInsightsNotificationSettings.enabled!=null;e(ie(f,o))}}),[r.fetchState,o,n.notificationSettings.monthEndInsightsNotificationSettings.enabled,n.fetchState]),a.jsxs(a.Fragment,{children:[a.jsx(T,{isAppContentDrawerOpen:m,handleDrawerToggle:b}),a.jsx(Yn,{notificationSettingsView:r,onFormDataChange:E,onCancel:g,onSave:P,onClickMenuIcon:()=>{b(!0)},signedInUser:u,onRefresh:_,resetUpdateStatus:R,taskNotifications:M,isTaskNotificationsDirty:c})]})}function ua(e){const[l,o]=d.useState(!1),i=C((b=>Ce(b))),r=C((b=>v(b))),n=G(),t=Ie(),s=U(),{useFeatureGate:c}=te(),{isFeatureEnabled:u}=c(O.isDebitCardFeatureEnabled),{isTaskManagerAccessEnabled:h}=xe(t),S=t?.userEmail==null||i.fetchState!=="Completed"||Dn(i.notificationSettings,t.userEmail,u,r,h);d.useEffect((()=>{i.fetchState!=="In-Progress"&&i.fetchState!=="Completed"&&l===!1&&(o(!0),s($()))}),[i.fetchState,l]);const m=he(u,r),p=fe(r);return i.fetchState!=="In-Progress"&&i.fetchState!=="Not-Started"||S!==!0?Un(r)?a.jsxs(J,{children:[Rn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"accounting/*",element:a.jsx(Xn,{})}),Tn(n?.loggedInUserRole??[],u,r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"approval_rules/*",element:a.jsx(Pt,{hasAdminLevelAccess:e.hasAdminLevelAccess})}),Mn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"my_bank_connections",element:a.jsx(Et,{})}),Bn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"bank_connections",element:a.jsx(ft,{})}),Nn(r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"business_verification",element:a.jsx(ot,{productType:m?"zeni_accounts":p?"charge_cards":tt(r,n?.loggedInUserRoleMap)})}),On(n?.loggedInUserRole??[],r,n?.loggedInUserRoleMap)&&a.jsx(k,{path:"company_details",element:a.jsx(st,{})}),Vn(n?.loggedInUserRole??[],r)&&a.jsx(k,{path:"billing",element:a.jsx(yt,{})}),Fn(n?.loggedInUserRole??[],u,r)&&a.jsx(k,{path:"integrations",element:a.jsx(bt,{})}),a.jsx(k,{path:"my_profile/new/:addressType",element:a.jsx(ce,{appContent:a.jsx(nt,{isSubPage:!1})})}),a.jsx(k,{path:"my_profile",element:a.jsx(ce,{})}),S&&a.jsx(k,{path:"notifications",element:a.jsx(_t,{})}),a.jsx(k,{path:"*",element:a.jsx(V,{})})]}):a.jsx(J,{children:a.jsx(k,{path:"*",element:a.jsx(V,{})})}):null}function Pt(e){return a.jsxs(J,{children:[a.jsx(k,{path:"/",element:a.jsx(pt,{})}),a.jsx(k,{path:"bills/approval-rules/*",element:a.jsx(lt,{})}),a.jsx(k,{path:"reimbursements/approval-rules/*",element:e.hasAdminLevelAccess?a.jsx(ct,{}):a.jsx(V,{})}),a.jsx(k,{path:"*",element:a.jsx(V,{})})]})}export{ua as default};
|