@zeniai/web-app-ui 5.2.19-next → 5.2.19-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-B7ET6G-y.js +1 -0
- package/dist/assets/{AddressScreen-DM3Cytik.js → AddressScreen-CGTYstNo.js} +1 -1
- package/dist/assets/{AiCfoScreen-C7VAZJ1A.js → AiCfoScreen-CA8qqox4.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-C9icCWAb.js → BillPayApprovalRoutes-guz2sdH1.js} +1 -1
- package/dist/assets/{BillPayRoutes-DffUP74I.js → BillPayRoutes-D0Ag3ATI.js} +1 -1
- package/dist/assets/{BusinessVerificationPageScreen-qG6q7Wb6.js → BusinessVerificationPageScreen-BohezKn6.js} +1 -1
- package/dist/assets/{CardsAiCfoScreen-BahaNrfe.js → CardsAiCfoScreen-GOQqQudn.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-SaV3T-oM.js → ChargeCardRoutes-C3e575qW.js} +1 -1
- package/dist/assets/{CompanyPassportScreen-CQUCnlmj.js → CompanyPassportScreen-CxVFTUSz.js} +1 -1
- package/dist/assets/{ConnectionAuthScreen-DxTli2yc.js → ConnectionAuthScreen-CDBmxiL_.js} +1 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DbN5QLGb.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-Ber4B0KW.js → CustomerOnboardingRoutes-C6q0UB9j.js} +1 -1
- package/dist/assets/{DashboardRoutes-CDwIkoUk.js → DashboardRoutes-BCmwgis8.js} +1 -1
- package/dist/assets/{DefaultTenantHome-CLCoE5KB.js → DefaultTenantHome-CC2FeaFy.js} +1 -1
- package/dist/assets/{DomesticWireDetailScreen-Cy5XGzM3.js → DomesticWireDetailScreen-qVcyg1bS.js} +1 -1
- package/dist/assets/{DrawerScreen-CFq_1rdP.js → DrawerScreen-YrXahOEM.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-lCFdhj0N.js → EntityDetailRoutes-CteWzOFU.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-BnRbsSz6.js → ExpenseAutomationRoutes-ChtLHwSX.js} +1 -1
- package/dist/assets/{FeaturePreviewScreen-1q69VsC1.js → FeaturePreviewScreen-C_bWMNSt.js} +1 -1
- package/dist/assets/{HubSpotOAuthCallbackScreen-X0-DSjZb.js → HubSpotOAuthCallbackScreen-CFlu3uRE.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-Dfdz57KO.js → MagicLinkRoutes-B6CyGV5n.js} +1 -1
- package/dist/assets/{MagicLinkSignInScreen-3rm3mwQp.js → MagicLinkSignInScreen-CU5qkDL2.js} +1 -1
- package/dist/assets/{MobileAppDrawer-uvkpUvp_.js → MobileAppDrawer-O95nPlSQ.js} +1 -1
- package/dist/assets/NotFoundScreen-BeJq256C.js +1 -0
- package/dist/assets/{NotificationRoutes-Cd2QvtFH.js → NotificationRoutes-dRraueia.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-B3JPBskg.js → OAuthConsentScreen-CRSd0T8_.js} +1 -1
- package/dist/assets/{PandLWithForecastRoutes-W3OrOyHu.js → PandLWithForecastRoutes-DdDF5n8o.js} +1 -1
- package/dist/assets/{PeopleRoutes-DNg7Ihue.js → PeopleRoutes-DPUju30P.js} +1 -1
- package/dist/assets/{PerformanceRoutes-o3ofDHl6.js → PerformanceRoutes-BSNXb7w3.js} +1 -1
- package/dist/assets/{Preview-GrKYlvV7.js → Preview-CxHKvNb3.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-Bky1RVSb.js → QBOConnectionScreen-vAHPaqo7.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-DGVz-GX1.js → ReimbursementApprovalRoutes-DhrGnU7Q.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-4DU8eod7.js → ReimbursementApprovalRuleDetailScreen-BdQmAA7j.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-C1MfITXr.js → ReimbursementRoutes-OiL1KOsA.js} +1 -1
- package/dist/assets/{ReportsRoutes-CoMGWCHx.js → ReportsRoutes-cJ_74y1a.js} +1 -1
- package/dist/assets/{RewardsRoutes-e7w8wtnX.js → RewardsRoutes-DaWb-BQo.js} +1 -1
- package/dist/assets/{ScreenRoutes-KCqCdpwt.js → ScreenRoutes-CRY8MlH6.js} +2 -2
- package/dist/assets/{SettingsRoutes-BZ_pWEty.js → SettingsRoutes-B0QfLxKl.js} +1 -1
- package/dist/assets/{SetupPagesScreen-D_WJHeIH.js → SetupPagesScreen-DqGd8bGY.js} +1 -1
- package/dist/assets/{SignInScreen-BNoucZFL.js → SignInScreen-wUhLdLU-.js} +1 -1
- package/dist/assets/{SignOutScreen-CMf4hwn3.js → SignOutScreen-BChwhvvy.js} +1 -1
- package/dist/assets/{TaskListScreen-C_rNr9Jk.js → TaskListScreen-q9ElonDb.js} +1 -1
- package/dist/assets/{TaskRoutes-CpISGdNU.js → TaskRoutes-B9S8VECk.js} +1 -1
- package/dist/assets/{TransactionDetailRoutes-CmH9g66g.js → TransactionDetailRoutes-D9ZuqZEq.js} +1 -1
- package/dist/assets/{TransactionDetailScreen-BAzuDRZQ.js → TransactionDetailScreen-B77dqrVQ.js} +1 -1
- package/dist/assets/{TransactionListRoutes-CoFY3pbX.js → TransactionListRoutes-t_0rbITT.js} +1 -1
- package/dist/assets/{TreasuryRoutes--lIehLfz.js → TreasuryRoutes-C2A809wv.js} +1 -1
- package/dist/assets/{VendorsRoutes-BlvpjJIF.js → VendorsRoutes-Ba7d72j7.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-C62-fzuC.js → WiseConfirmationScreen-AJ6Zf-xE.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-DsEwo2kw.js → ZeniAccountRoutes-DdIrrwcf.js} +1 -1
- package/dist/assets/{ZeniAccountStatementScreen-DsIySC9T.js → ZeniAccountStatementScreen-BUgkOPv6.js} +1 -1
- package/dist/assets/{accountMappingHelper-DF_wZmqr.js → accountMappingHelper-BmtW64tm.js} +1 -1
- package/dist/assets/{analytics-CsrWBSkJ.js → analytics-C2MbRoEp.js} +1 -1
- package/dist/assets/{analyticsHelper-eo4F52XS.js → analyticsHelper-DqO64pHt.js} +1 -1
- package/dist/assets/{core-Ct1Na3r4.js → core-D2KaS3N5.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-Dl7JnLtd.js → decodeURIComponentSafe-CD_zntJd.js} +1 -1
- package/dist/assets/{dnd-DXTfJSUb.js → dnd-D-AkKI2c.js} +1 -1
- package/dist/assets/{empty-C9Atwx5F.js → empty-ByGkxZf5.js} +1 -1
- package/dist/assets/{empty-enRUfXAJ.js → empty-D1hMU_8M.js} +1 -1
- package/dist/assets/{emptyVideoElement-BWmmLkB3.js → emptyVideoElement-B0o6h5Gb.js} +1 -1
- package/dist/assets/{epic-CPUd8eYu.js → epic-C_V7SCDP.js} +1 -1
- package/dist/assets/{getLocaleForTenant-C9iKXyPU.js → getLocaleForTenant--JGxRDjE.js} +1 -1
- package/dist/assets/{index-C5jp_Nos.js → index-BFVwI6w6.js} +1 -1
- package/dist/assets/{index-UCOMlrxB.js → index-BQPo7Zt4.js} +1 -1
- package/dist/assets/{index-Lktm9qH-.js → index-CHRJI22G.js} +1 -1
- package/dist/assets/{index-BBFNuY8-.js → index-CivdpZRT.js} +8 -8
- package/dist/assets/{index-DD29fIsd.js → index-CjrIzFQ1.js} +1 -1
- package/dist/assets/{index-DHN0iULb.js → index-D6D50L1U.js} +1 -1
- package/dist/assets/{index-CpAcGISI.js → index-Dyy6NuL-.js} +1 -1
- package/dist/assets/{index-D_W5SS2j.js → index-nz48Z_9j.js} +2 -2
- package/dist/assets/{lexical-5nbymAIm.js → lexical-BQ-Po3YF.js} +1 -1
- package/dist/assets/{liveblocks-P0DntAgT.js → liveblocks-BBLi67DG.js} +1 -1
- package/dist/assets/{lottie-7Wgw-CzS.js → lottie-Dz6JZ58r.js} +1 -1
- package/dist/assets/{mui-SSWNL1tt.js → mui-C1ThRyKO.js} +1 -1
- package/dist/assets/{pathToGoBack-wtH43kNb.js → pathToGoBack-Du20FI7g.js} +1 -1
- package/dist/assets/{pdf-COhrBMN3.js → pdf-2k8d7AeQ.js} +3 -3
- package/dist/assets/{pdf-lib-DerHPYIF.js → pdf-lib-DqPqgk_2.js} +1 -1
- package/dist/assets/{plaid-CdfVkhIW.js → plaid-Do7hhR27.js} +1 -1
- package/dist/assets/{pusher-hTFVCAHJ.js → pusher-TY6R8jm6.js} +1 -1
- package/dist/assets/{react-CYqO4utD.js → react-BReY6fnO.js} +1 -1
- package/dist/assets/{react-Ci3GJXKz.js → react-Bfs0rs07.js} +1 -1
- package/dist/assets/{react-CB88nZl5.js → react-CASCBfCG.js} +1 -1
- package/dist/assets/{react-G31LEvJE.js → react-CCcFi-WD.js} +1 -1
- package/dist/assets/{react-C3avayV7.js → react-D8jfsv_0.js} +1 -1
- package/dist/assets/{react-DAcDxy2I.js → react-DPqkDk9u.js} +1 -1
- package/dist/assets/{recharts-KVNUr0cO.js → recharts-jHFM5Sob.js} +1 -1
- package/dist/assets/{routePaths-Dvh0MCMy.js → routePaths-TRamKMNj.js} +1 -1
- package/dist/assets/{sentry-CfbcqWq3.js → sentry-DW4kKH26.js} +1 -1
- package/dist/assets/{url-CbJg2s3J.js → url-8bOSIiqX.js} +1 -1
- package/dist/assets/{url-FHfZtBCR.js → url-GR46giUc.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-BLXE02N5.js → useAiCfoDashboardSuggestedQuestionsChips-CuA1dWGl.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-BeiXTDS4.js → useAskAiCfoHostNavButtonProps-CNoSipqI.js} +1 -1
- package/dist/assets/{useCashManagementBanner-D5vpE0Fa.js → useCashManagementBanner-COk5CYpf.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-B55cb89o.js → useChargeCardPusherEvents-9ezHPs6j.js} +1 -1
- package/dist/assets/{useDeviceId-BAVWaoiW.js → useDeviceId-CHTVQQ8G.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-DZEhjfaj.js → useEmailConnectResultRefresh-Ddee2XH0.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-J5ElkQVA.js → useInitialThreadRequest-UA6eH2dj.js} +1 -1
- package/dist/assets/{utils-BmRSZi-a.js → utils-DIwqH7uj.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-u9hB8oy5.js → withTransactionSidePanel-DWx4OX2G.js} +1 -1
- package/dist/assets/{zeni-epic-state-x9uZgubN.js → zeni-epic-state-BJ_gdj7r.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +1 -1
- package/dist/assets/AddressRoutes-D14Xrcr-.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-DCVZbjhG.js +0 -1
- package/dist/assets/NotFoundScreen-DR4zbgK0.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-BBLi67DG.js";import{a as u}from"./sentry-DW4kKH26.js";import{u as y,j as b,n as w,g as A,N}from"./core-D2KaS3N5.js";import{Md as U,eZ as _,g3 as k,Me as L,oi as R,Mf as z}from"./zeni-epic-state-BJ_gdj7r.js";import{u as O,z as f,L as T,t as I,O as j,b as $}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import{t as P}from"./getLocaleForTenant--JGxRDjE.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="392dbe06-a716-44af-9e31-11501bb5b62d",t._sentryDebugIdIdentifier="sentry-dbid-392dbe06-a716-44af-9e31-11501bb5b62d")}catch{}})();const M=w((function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}}))((function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map((l=>l.tenantEmailDomain)),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const C=E(r.pathname);if(C!=null)c=`../${o.tenantEmailDomain}/${C}`,m="comingFromV2UrlPath",C==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,F)=>l||i.split("/").find((D=>D===F))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(N,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=O(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>U(e))),n=b((e=>e.tenantState.fetchState)),i=b((e=>e.tenantState.error)),a=b((e=>e.tenantState.activeTenantFetchState.fetchState)),c=b((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(T.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)}),[a,n]),u.useEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(T.TENANT_FETCHING),t(k(d.userId,e))))}),[n,a,d,t]),u.useEffect((()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!L(i))&&t(R(e.userId)))}),[n,a,i,d,t]),u.useEffect((()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())}),[m.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(j.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(M,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
|
package/dist/assets/{DomesticWireDetailScreen-Cy5XGzM3.js → DomesticWireDetailScreen-qVcyg1bS.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-BBLi67DG.js";import{h as w,g as C,j as h,n as A,i as $}from"./core-D2KaS3N5.js";import{Qk as k,Qr as _,gl as W,gk as K,gj as q,jD as J,Nu as L,rN as M,eZ as D,PS as V,jB as T,Ql as S,Qu as j,jz as F,jW as G}from"./zeni-epic-state-BJ_gdj7r.js";import{bz as X,K as N,A as R,z as U,y as z,p,d as v,B as Z,bA as Y,o as O,bB as ee,r as te}from"./index-CivdpZRT.js";import{n as Q}from"./mui-C1ThRyKO.js";import"./sentry-DW4kKH26.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]="f3995963-2004-4347-b2d7-85caa3b65958",e._sentryDebugIdIdentifier="sentry-dbid-f3995963-2004-4347-b2d7-85caa3b65958")}catch{}})();const ne=A(null,(function(e,t){return{onSaveVendor:n=>{e(J(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(L("common")),n!=null&&e(M(n))},onGetOtp:n=>{e(q(n,"BillPayVendor"))},onResendOtp:n=>{e(K(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(W(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(_(n,a,o))}}}))(X);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h((i=>k(i,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=Q.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-
|
|
1
|
+
import{j as d}from"./liveblocks-BBLi67DG.js";import{K as b,F as l,y as f}from"./index-CivdpZRT.js";import{D as c}from"./mui-C1ThRyKO.js";import"./sentry-DW4kKH26.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="89fbbb96-b48a-4b8e-a23e-0117ebf93880",e._sentryDebugIdIdentifier="sentry-dbid-89fbbb96-b48a-4b8e-a23e-0117ebf93880")}catch{}})();const p={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:a}=e,n=b(),s=o?.valuePx(n)??p.drawerLeftMargin.valuePx(n),i=f();return d.jsx(c,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:t})}export{h as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-BBLi67DG.js";import{a as c}from"./sentry-DW4kKH26.js";import{h as N,u as O,g as A,i as B,j as d,N as q,n as F,o as _,p as z}from"./core-D2KaS3N5.js";import{OC as H,eZ as K,N_ as M,lG as R,Kv as I,OH as W,Nt as Y,kG as $,Kw as S,O3 as V,O4 as X,Nv as Z,Nu as J}from"./zeni-epic-state-BJ_gdj7r.js";import{aX as L,f as Q,p as U,r as tt}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import{d as k}from"./decodeURIComponentSafe-CD_zntJd.js";import{w as et}from"./withTransactionSidePanel-DWx4OX2G.js";import{f as at,c as nt}from"./routePaths-TRamKMNj.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";import"./useAskAiCfoHostNavButtonProps-CNoSipqI.js";import"./TransactionDetailScreen-B77dqrVQ.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="73f378c2-e1b0-4cc0-a56c-7e99ac27e25a",a._sentryDebugIdIdentifier="sentry-dbid-73f378c2-e1b0-4cc0-a56c-7e99ac27e25a")}catch{}})();const ot=F((function(a,t){const e=t.entity,o=W(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:Y(a,"common")},trendWithTransactionsReport:o,analytics:Q,isAccountingClassesEnabled:$(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,l=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:l}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(Z({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(J("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(V()),a(X()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=U(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??C();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(L),it=et((function({entityType:a,...t}){const e=N(),o=O(),l=A(),[m,T]=c.useState(!1),[h,D]=c.useState(!1),{tenantEmailDomain:b,entityIdEncoded:v,entityNameEncoded:w}=B(),r=k(v??""),p=k(w??""),u=rt(r,p),G=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=d((n=>H(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),j=d((n=>K(n).company?.companyInfo.firstMonthOfFY??1)),f=d((n=>M(n.trendWithTransactionsState,i,"EntityDetail")));c.useEffect((()=>{m===!1&&u===!0&&(T(!0),o(R(i)))}),[m,u,i]);const E=d((n=>n.trendState.fetchState)),P=f?.selectedPeriod?.timePeriod??g,x=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(f?.selectedPeriod?.timePeriod,g);return c.useEffect((()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:f?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))}),[m,h,E]),u?s.jsx(ot,{firstMonthOfFY:j,tenantEmailDomain:b,location:l,navigate:e,entity:i,defaultTransactionTimePeriod:x,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(q,{to:C(G.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,C=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function vt({entityType:a}){return s.jsx(_,{children:s.jsx(z,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{vt as EntityDetailRoutes,vt as default};
|
package/dist/assets/{ExpenseAutomationRoutes-BnRbsSz6.js → ExpenseAutomationRoutes-ChtLHwSX.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as S}from"./liveblocks-
|
|
1
|
+
import{j as S}from"./liveblocks-BBLi67DG.js";import ca from"./NotFoundScreen-BeJq256C.js";import{a,b as en}from"./sentry-DW4kKH26.js";import{n as Le,S as ia}from"./mui-C1ThRyKO.js";import{u as Se,h as tn,g as tt,j as w,n as la,i as Bt,o as ra,p as Qe}from"./core-D2KaS3N5.js";import{eZ as Oe,Ti as da,os as ve,f_ as ua,so as ma,Tj as We,fB as nt,Tk as Vt,ei as pa,fk as ha,Tl as Ot,Tm as Be,p8 as ga,Tn as Ca,pp as Sa,oJ as nn,gr as ue,gt as fa,To as Ia,p2 as an,pj as ka,Tp as on,oD as Ea,rW as Ta,fL as ye,Tq as _e,uu as sn,EQ as cn,Tr as ln,Ts as ba,ru as at,OD as _t,OF as ya,kJ as va,OG as Aa,kQ as Pa,c_ as wa,vK as ot,oP as rn,pt as ze,Tt as Ra,Nv as zt,Nu as Ue,Tu as Mt,l5 as xa,Tv as Da,Tw as Fa,Tx as Ua,Ty as Ba,oW as Va,pw as Ve,Tz as Oa,TA as _a,TB as za,pD as Ma,kU as La,kL as ja,TC as qa,kT as Lt,ON as $a,TD as Ga,TE as Na,rq as Ja,r2 as Ya,pu as Ce,r1 as He,TF as Ka,TG as Za,TH as Qa,mo as Wa,bo as Ha,mj as jt,m5 as Xa,TI as eo,gE as to,mg as no,xD as ao,TJ as oo,q2 as so,pZ as co,q1 as io,pO as lo,TK as ro,fO as dn,pc as uo,oS as mo,f$ as qt,py as po,TL as ho,TM as go,pv as un,TN as Co,TO as So,TP as fo,TQ as Io,TR as $t,rC as ko,qV as Eo,Nt as To,TS as bo,TT as yo,kS as vo,TU as Ao,Jw as Po,kR as wo,kG as Ro,fN as xo,qr as mn,qN as Do,ps as Gt,px as Fo,bE as Uo,md as Bo,ma as Vo,TV as Oo,pN as Nt,qJ as Jt,qH as _o,TW as zo,qw as Mo,qc as Lo,qK as jo,TX as qo,TY as $o,qg as Go,TZ as No,q7 as Jo,qf as Yo,qd as Ko,qQ as Zo}from"./zeni-epic-state-BJ_gdj7r.js";import{A as Me,d as K,f as J,r as ie,_ as pn,a0 as hn,cZ as Qo,z as je,c_ as Wo,c$ as Ho,d0 as Xo,au as Ae,d1 as es,d2 as Yt,aZ as Kt,B as gn,d3 as ts,ar as Xe,O as ns,a9 as as,d4 as os,a4 as ss,d5 as cs,Z as is,d6 as ls,d7 as rs,v as ds,e as us,aS as ms,d8 as ps,d9 as hs,be as gs,F as Cs,aV as Ss}from"./index-CivdpZRT.js";import{u as Cn}from"./useAskAiCfoHostNavButtonProps-CNoSipqI.js";import{f as Zt,a as fs,b as Is,g as ks,C as Es}from"./TransactionDetailScreen-B77dqrVQ.js";import{w as Ts}from"./withTransactionSidePanel-DWx4OX2G.js";import{h as bs,v as ys}from"./routePaths-TRamKMNj.js";import{g as et}from"./accountMappingHelper-BmtW64tm.js";import{D as vs}from"./DrawerScreen-YrXahOEM.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";import"./decodeURIComponentSafe-CD_zntJd.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="f5f727af-ec2e-4196-8807-e7a058572001",t._sentryDebugIdIdentifier="sentry-dbid-f5f727af-ec2e-4196-8807-e7a058572001")}catch{}})();const As=()=>{const t=Se(),s=tn(),A=tt(),E=w((u=>Oe(u))),{useFeatureGate:b}=Me(),{isFeatureEnabled:i}=b(K.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:m}=b(K.aiAuditScorePercentage),f=w((u=>u.expenseAutomationViewState.selectedPeriodByTenantId)),c=w((u=>da(u,E.tenantId))),{isAiCfoAccessEnabled:C,onAskAiCfoClick:h}=Cn({mobileExploreReferrer:"Month-End Close Overview"}),P=a.useCallback(((u,z,ae=!1)=>{t(ve({tenantId:z,period:{month:u.month,year:u.year},refreshViewInBackground:ae}))}),[]),v=a.useCallback((u=>{const z=A.state?.referrer;c.monthEndCloseChecks?.auditSummary!=null&&J.trackMonthCloseAuditPage(u.month,u.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,z??null),t(ua(E.tenantId,u))}),[E.tenantId,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),r=f[E.tenantId],p=a.useCallback((()=>{const u=A.state?.referrer;c.monthEndCloseChecks?.auditSummary!=null&&J.trackMonthCloseAuditPage(r.month,r.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,u??null),P(r,E.tenantId,!0)}),[P,r,E.tenantId,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),B=ie(A.state?.pathnameStackToGoBack,A.pathname),R=a.useCallback((()=>{if(c.monthEndCloseChecks!=null&&r!=null){const u=c.monthEndCloseChecks.monthEndCloseCheckList.find((z=>z.progress<100));if(u!=null)return void s(`./${u.id}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:B,message:"comingFromOverview"}});s(`./month_end_insights/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:B,message:"comingFromOverview"}})}}),[c.monthEndCloseChecks,r]),{areTenantIdsInSync:I}=pn();return hn({isDataReady:c.fetchState==="Completed"}),a.useEffect((()=>{r!=null&&c.fetchState!=="In-Progress"&&c.fetchState!=="Completed"&&I&&P(r,E.tenantId)}),[P,r,c.fetchState,E.tenantId,I]),a.useEffect((()=>{r!=null&&c.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&c.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&I&&t(ma(r))}),[r,c.monthClosePerformanceTrendFetchStatus.fetchState,I]),a.useEffect((()=>{const u=setInterval((()=>{c.fetchState!=="In-Progress"&&c.fetchState==="Completed"&&p()}),3e5);return()=>clearInterval(u)}),[c.fetchState]),a.useEffect((()=>{if(c.fetchState==="Completed"&&c.monthEndCloseChecks?.auditSummary!=null){const u=A.state?.referrer;J.trackMonthCloseAuditPage(c.selectedPeriod.month,c.selectedPeriod.year,c.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",c.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,u??null)}}),[c.fetchState,c.selectedPeriod,c.monthEndCloseChecks?.auditSummary,c.monthEndCloseChecks?.reportEmailSentDate]),S.jsx(Ps,{children:S.jsx(Qo,{monthEndCloseChecksView:c,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:u=>{s(`./${u}/${r.month}-${r.year}`,{state:{pathnameStackToGoBack:B,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:v,handleReviewButtonClick:R,onBackClick:()=>{s("../../dashboard")},onReload:p,isAiCfoAccessEnabled:C,onAskAiCfoClick:h,aiAuditScorePercentageEnabled:m})})},Ps=Le.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-BBLi67DG.js";import{a as r}from"./sentry-DW4kKH26.js";import{a5 as f,a6 as l,a7 as p,p as m}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import c from"./NotFoundScreen-BeJq256C.js";import{h as u,g as b}from"./core-D2KaS3N5.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new e.Error().stack;a&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[a]="b50ef9de-1e19-4e43-a9d6-fe41049e3584",e._sentryDebugIdIdentifier="sentry-dbid-b50ef9de-1e19-4e43-a9d6-fe41049e3584")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),d=r.useCallback((()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=f(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:d}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./sentry-
|
|
1
|
+
import{a as r}from"./sentry-DW4kKH26.js";import{u as l,h as f,g as m}from"./core-D2KaS3N5.js";import{hA as p,MB as g,MC as b}from"./zeni-epic-state-BJ_gdj7r.js";import{u as _,L as h,z as y}from"./index-CivdpZRT.js";import"./liveblocks-BBLi67DG.js";import"./recharts-jHFM5Sob.js";import"./mui-C1ThRyKO.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ca75bbe3-d871-4bc5-9043-4e7cf70793fe",e._sentryDebugIdIdentifier="sentry-dbid-ca75bbe3-d871-4bc5-9043-4e7cf70793fe")}catch{}})();function R(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:d}=_(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(h.CONNECTION_AUTH)}),[i]),r.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),b("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{R as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-BBLi67DG.js";import{i as y,n as x,h as C,g as S,u as ee,t as ae,j as E,N as te,o as ne,p}from"./core-D2KaS3N5.js";import{Mu as k,Mv as v,Mw as M,By as B,Bk as T,Mx as D,My as oe,Mz as se,Bo as ie,fC as $,Bv as le,Bs as re}from"./zeni-epic-state-BJ_gdj7r.js";import{K as f,o as r,m as de,f as j,k as G,n as ce,p as me,q as pe,r as H,A as ue,d as he,s as xe,v as fe,y as ge,x as we,B as be,C as ye,V as Se,D as ke,E as ve,F as je,G as $e}from"./index-CivdpZRT.js";import{n as m}from"./mui-C1ThRyKO.js";import g from"./NotFoundScreen-BeJq256C.js";import{a as I}from"./sentry-DW4kKH26.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.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]="1df2b55b-ee5e-4779-a10f-aaaaaaf3f4f6",e._sentryDebugIdIdentifier="sentry-dbid-1df2b55b-ee5e-4779-a10f-aaaaaaf3f4f6")}catch{}})();const Ie=m.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100%;
|
|
4
4
|
width: 100%;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as g}from"./liveblocks-
|
|
1
|
+
import{j as g}from"./liveblocks-BBLi67DG.js";import{a as u}from"./sentry-DW4kKH26.js";import{u as F,g as O,h as _,t as w,j as l,N as T}from"./core-D2KaS3N5.js";import{z as r,y as V,O as P,g as A,f as N,h as W,W as Z,V as q,j as R}from"./index-CivdpZRT.js";import{eZ as $,Mf as B,Mp as G,Mg as H,fC as J,g2 as K,Ml as Q,gv as X,cZ as Y,Mq as ee,Mr as te}from"./zeni-epic-state-BJ_gdj7r.js";import{n as ne}from"./mui-C1ThRyKO.js";import{u as se}from"./useDeviceId-CHTVQQ8G.js";import{f as ae}from"./analyticsHelper-DqO64pHt.js";import{t as ie}from"./getLocaleForTenant--JGxRDjE.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="fbd07177-0cf0-4093-9e2a-ecc046be5c84",t._sentryDebugIdIdentifier="sentry-dbid-fbd07177-0cf0-4093-9e2a-ecc046be5c84")}catch{}})();const C=(t,a)=>t!=null&&t.length>0&&a==="magic_links";function Ce(){const t=F(),a=O(),m=_(),[b]=w(),n=b.get("token"),p=b.get("stytch_token_type"),f=r.getMagicLinkCodeVerifier(),i=se(),{otpChallenge:c,twoFAPhoneNumber:x,magicLinkEmail:d,verifyDeviceFetchState:z,resendVerifyDeviceOTPFetchState:D}=l((e=>e.tenantState)),S=l((e=>e.tenantState.fetchState)),k=l((e=>e.tenantState.activeTenantFetchState.fetchState)),h=l((e=>e.tenantState.signInState)),I=l((e=>e.tenantState.magicLinkSignInFetchState.fetchState)),s=l((e=>e.tenantState.loggedInUser)),o=l((e=>$(e))),y=l((e=>B(e))),M=r.getSignedInUser(),v=V().mode;u.useEffect((()=>{s?.zeniSessionId==null&&n!=null&&C(n,p)&&i!=null&&f!=null&&(r.saveMagicLinkTriggered(n),t(G(n,i,f)))}),[n,p,t,i,f,s?.zeniSessionId]),u.useEffect((()=>{h!=="In-Progress"||S!=="Completed"&&k!=="Completed"||s?.zeniSessionId==null||o==null||(n!=null&&r.saveLastUsedMagicLinkToken(n),r.saveSignedInUserWithSession(s,s.zeniSessionId),r.saveSignedInUserTenants(H(y.tenantsInOrder),s.zeniSessionId),J(s.userId,s.zeniSessionId,o.tenantId),t(K(o.tenantId)),r.saveActiveTenantDomainForUser(o.tenantEmailDomain),t(Q("Completed")),P.updateAppLocaleID(ie(o)),ae(s,o,v,void 0,y.tenantsInOrder),X().then((()=>{const e=R();e!=null&&A(e)})),setTimeout((()=>{N.trackLogin(W.Event.loginSuccess,"email",Y(o.productSettings))}),2e3))}),[h,S,k,s,o,y,v,a.state,t]);const E=u.useCallback((()=>{m("/signin/auth")}),[m]),j=u.useCallback((()=>{i!=null&&c!=null&&d!=null&&t(ee(i,d,c))}),[i,c,t,d]),U=u.useCallback((e=>{i!=null&&n!=null&&d!=null&&c!=null&&t(te(e,i,d,c))}),[i,n,t,d,c]);if(I==="Completed"&&c!=null)return g.jsx(Z,{phoneNumber:x,verifyOtpFetchState:z.fetchState,resendVerifyDeviceOTPFetchState:D,onResendOtp:j,onVerifyOtp:U,onCancelVerifyDevice:E});if(h==="In-Progress"&&S==="Completed"&&s?.zeniSessionId!=null&&o!=null||M!=null){const e=a.state?.origin??"/";return g.jsx(T,{to:e,state:{...a.state,origin:""}})}if(!C(n,p)||f==null||I==="Error"){const e=a.state?.origin??"/",L=n!=null&&r.getLastUsedMagicLinkToken()===n;return g.jsx(T,{to:e,state:{...a.state,origin:"",magicLinkAlreadyUsed:L,magicLinkExpired:!L&&(r.isMagicLinkTriggered(n??"")||I==="Error"&&s?.zeniSessionId==null)}})}return g.jsx(oe,{"data-testid":"smooth-loader",children:g.jsx(q,{size:"ExtraLarge",start:!0})})}const oe=ne.div`
|
|
2
2
|
position: fixed;
|
|
3
3
|
top: 0;
|
|
4
4
|
left: 0;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as V}from"./liveblocks-
|
|
1
|
+
import{j as V}from"./liveblocks-BBLi67DG.js";import{a as c}from"./sentry-DW4kKH26.js";import{u as fe,j as n,i as He,g as We,h as Je,l as x}from"./core-D2KaS3N5.js";import{eZ as me,fH as Ke,fI as be,ft as Qe,bn as Xe,eY as qe,fJ as ea,fK as aa,fM as ta,fP as na,fQ as g,fS as sa,fT as de,fW as oa,fU as ia,fV as ra,fX as da,cP as la,fZ as ca,cV as ua,fs as fa,g2 as ma,g3 as ba,g1 as pa}from"./zeni-epic-state-BJ_gdj7r.js";import{a9 as ha,aa as Sa,v as ga,A as Ea,z as k,x as ka,u as Ca,d as r,i as ya,c as Ia,ab as Ta,e as Aa,a as _a,ac as wa,a5 as Da,ad as Fa,ae as va,af as le,ag as ce,L as $a,ah as Pa,ai as ue,f as G,a1 as Ma,r as A,aj as R,ak as xa}from"./index-CivdpZRT.js";import{D as Ga}from"./mui-C1ThRyKO.js";(function(){try{var f=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new f.Error().stack;d&&(f._sentryDebugIds=f._sentryDebugIds||{},f._sentryDebugIds[d]="4fb91689-7102-4a33-9e50-ba12b6f5e67c",f._sentryDebugIdIdentifier="sentry-dbid-4fb91689-7102-4a33-9e50-ba12b6f5e67c")}catch{}})();const Ra=ha((({isAppContentDrawerOpen:f,handleDrawerToggle:d})=>{const{tenantEmailDomain:t}=He(),a=We(),C=ga(),o=Je(),B=Qe(),m=fe(),{useFeatureGate:i}=Ea(),N=k.getSignedInUser(),U=Xe(N),s=n((e=>me(e))),pe=s.masterTOSInfo?.isMasterTOSAccepted??!1,O=n((e=>qe(e))),j=O.uiState.currentChatSessionId,y=ka(),{setLoading:he}=Ca(),[_,L]=c.useState(void 0),w=x("/:tenantEmailDomain/dashboard")!==null,Z=x("/:tenantEmailDomain/reports")!==null,I=x("/:tenantEmailDomain/onboarding/*")!==null,Se=!!s.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:ge}=i(r.isChargeCardFeatureEnabled),{isFeatureEnabled:z}=i(r.isDebitCardFeatureEnabled),Ee=ya(s,ge,z),{isFeatureEnabled:ke}=i(r.isSettingsFeatureEnabled),Y=n((e=>ea(e))),{isFeatureEnabled:T}=i(r.isReferralFeatureEnabled),D=n((e=>aa(e)));c.useEffect((()=>{y&&T&&!I&&D.fetchState==="Not-Started"&&m(ta(!0))}),[y,T,D.fetchState,I]);const h=k.getSignedInUser(),F=n((e=>e.tenantState)),Ce=n((e=>F.fetchState==="Completed"?na(e):[])),E=n((e=>e.expenseAutomationViewState.selectedPeriodByTenantId)),{isFeatureEnabled:ye}=i(r.isApAgingFeatureEnabled),{isFeatureEnabled:Ie}=i(r.isArAgingFeatureEnabled),{isFeatureEnabled:Te}=i(r.isExpenseAutomationEnabled),{isFeatureEnabled:Ae}=i(r.isExpenseAutomationEnabledV2),H=Ia(),{isFeatureEnabled:_e}=i(r.isDashboardSidebarHalloweenAnimationEnabled),{isFeatureEnabled:we}=i(r.isDashboardSidebarThanksGivingAnimationEnabled),{isFeatureEnabled:De}=i(r.isDashboardSidebarChristmasAnimationEnabled),{isFeatureEnabled:Fe}=i(r.isDashboardSidebarNewYearAnimationEnabled),v=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",{isFeatureEnabled:ve}=i(r.isTaskManagerCustomerUserAccessEnabled),$e=U||!U&&ve,Pe=n((e=>g(e).totalUnreadCount)),Me=n((e=>g(e).reducedFetchCountState)),W=n((e=>g(e).notificationDetailsByTab.tasks.uiState.unreadCount)),J=n((e=>g(e).notificationDetailsByTab.comments.uiState.unreadCount)),xe=n((e=>g(e).notificationDetailsByTab.tasks.fetchCountState)),$=n((e=>g(e).notificationDetailsByTab.comments.fetchCountState)),{inboxNotifications:K,isLoading:Q,isFetchingMore:X,hasFetchedAll:q,fetchMore:Ge}=Ta();c.useEffect((()=>{const e=setTimeout((()=>Ge?.()),0);return()=>clearTimeout(e)})),c.useEffect((()=>{if(Q===!1&&X===!1&&q===!0)if(s?.companyId!=null&&K!=null){const e=`dashboard_${s.companyId}`;L(K.filter((u=>u.roomId===e&&u.readAt==null)).length)}else L(0)}),[Q,X,q]),c.useEffect((()=>{y&&!I&&xe.fetchState==="Not-Started"&&B.tenantId!=null&&m(sa("task_manager","dashboard"))}),[y,B.tenantId]),c.useEffect((()=>{I||$.fetchState!=="Not-Started"||m(de({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),c.useEffect((()=>{_!=null&&$.fetchState==="In-Progress"&&(m(de({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),m(be({unreadCount:_},"comments")))}),[_,$.fetchState]);const Re={fetchStatus:Me,count:Pe},ee=t!=null?k.getSignedInUserTenant(t):null,ae=n((e=>ee?.tenantId!=null?oa(e,ee.tenantId):void 0)),S=[];ye===!1&&S.push("accounts_payable_aging"),Ie===!1&&S.push("accounts_receivable_aging"),S.push("zeni_accounts_promo_card","treasury_promo_card"),T===!1&&S.push("rewards_card"),H===!1&&S.push("expense_automation_card");const Ve=Aa(),te=n((e=>ia(e,S,h,Ae,Te).fetchState)),ne=n((e=>ra(e).fetchState)),Be=w&&(te==="Completed"||te==="Error")||Z&&(ne==="Completed"||ne==="Error")||!w&&!Z?void 0:"disabled",Ne=c.useMemo((()=>da(s.userRole)),[s.userRole]),Ue=la(Ne),Oe=s?.rewardsLastViewedTime==null,je=h?.userEmail!=null&&Y.fetchState==="Completed"&&ca(Y.notificationSettings,h.userEmail,z,s),se=_a(),Le=se&&wa(a),oe=ua(Ve?.loggedInUserRoleMap),ie=s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,P=c.useCallback((()=>v&&oe&&!k.getTreasuryPopupSeen(t??"")&&ie===!1&&Da(a.pathname)!=="treasury"),[v,oe,ie,a.pathname,t]),[Ze,re]=c.useState(P);c.useEffect((()=>{re(P())}),[P]);const ze=n((e=>e.treasurySetupViewState.treasuryFundsDetails)).fundsDetails,Ye=Fa(ze);return V.jsx(Ga,{container:window.document.body,variant:"temporary",open:f,onClose:()=>d(!1),PaperProps:{sx:{width:240,zIndex:8,borderRight:"none",backgroundImage:"none"}},ModalProps:{keepMounted:!0},children:V.jsx(va,{signedInUser:N,currentTenantId:F.currentTenantId??"",tenants:F.fetchState==="Completed"?Ce:ae!=null?[ae]:[],currentTenant:s,isTenantDropdownDisabled:Be,isSettings:ce(a),isSettingsFeatureEnabled:ke,isVendorsTabVisible:Ue,isZeniAccountEnabled:Se,isChargeCardEnabled:Ee,isTreasuryEnabled:v,treasuryYieldPercentage:Ye,isTreasuryPopupVisible:Ze,isNotificationsTabVisible:je,notificationCountDetails:Re,isExpenseAutomationEnabledForUser:H,selectedMenu:le(a),rewardsConfiguration:{isRewardsTabVisible:T,isRewardsAnimated:Oe,rewardsPlan:D.rewardsPlan},isAiCfoAccessEnabled:se,onNotificationIconClick:()=>{d(!1);let e=W===0&&J>0?"notifications/comments":"notifications/tasks";ce(a)&&(e=W===0&&J>0?"../../notifications/comments":"../../notifications/tasks");const u=A(a.state?.pathnameStackToGoBack,a.pathname);o(e,{state:{pathnameStackToGoBack:u}})},handleCockpitClick:()=>{window.open("/cockpit")},handleLogOutClick:()=>{d(!1);const e=A(a.state?.pathnameStackToGoBack,a.pathname);o("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},handleMenuChange:e=>{if(d(!1),t==null)return;if(e.type==="ai_cfo"){if(G.trackAICFOChatScreenStateChanged("viewed","left_menu",j??null,null),!pe)return void Ma({location:a,navigate:o,mergeState:{referrer:"Sidebar"}});const p=A(a.state?.pathnameStackToGoBack,a.pathname);return void o(`/${t}/ai-cfo/explore`,{state:{pathnameStackToGoBack:p,referrer:"Sidebar"}})}const u=A(a.state?.pathnameStackToGoBack,a.pathname),l=e.type,b=R(l)&&l!=="command_center";if(R(e.type)&&E[s.tenantId]!=null&&G.trackMonthEndCloseClicked(E[s.tenantId].month,E[s.tenantId].year,"Sidebar"),b&&E[s.tenantId]!=null){const p=E[s.tenantId];return void o(`/${t}/month_end_close_checks/review/${e.type}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})}const M=xa(e.type);ue(e.type)?(j!=null&&m(pa()),o(`/${t}/ai-cfo/${e.type}`,{state:{pathnameStackToGoBack:u.slice(0,-1),referrer:"Sidebar"}})):o(`/${t}/${M}`,{state:{pathnameStackToGoBack:u,referrer:"Sidebar"}})},handleMyProfileClick:()=>{d(!1),o(`/${t}/settings/my_profile`)},handleReferralsClick:()=>{d(!1),o(`/${t}/rewards`)},handleBackClick:()=>{o(`/${t}/dashboard`)},handleTenantSelect:e=>{he($a.TENANT_SWITCHING),d(!1);const u=e.tenantEmailDomain,l=le(a);let b=`/${encodeURIComponent(u)}/`;const M=R(l);l==="home"?b+="dashboard":l==="users_and_roles"?b+="people":Pa(l)?b+="settings/my_profile":ue(l)?b+=`ai-cfo/${l}`:b+=l==="task_checklist"?"tasks":M?"month_end_close_checks/review":encodeURIComponent(l),o(b,{replace:!0}),h!=null&&(m(ma(e.tenantId)),m(ba(h.userId,e.tenantId,h.zeniSessionId)));const p=e;G.trackCompanySwitch(p.companyId,p.companyName,p.userRole)},handlePopupClose:()=>{k.saveTreasuryPopupSeen(t??"",!0),re(!1)},onZeniLogoClick:()=>{C.toggle()},isAiCfo:Le,aiCfoView:O,isOnDashboard:w,updateCurrentChatSessionId:e=>{m(fa({sessionId:e,agentId:"controller"})),o(`/${t}/ai-cfo/${e}`,{state:{...a.state}})},halloweenAnimationEnabled:_e,isTaskManagerAccessEnabled:$e,thanksGivingAnimationEnabled:we,christmasAnimationEnabled:De,newYearAnimationEnabled:Fe})})})),La=f=>{const d=fe(),t=n((C=>me(C))),a={events:t.userRoleId!=null?[`private-encrypted-${t.userRoleId}.dashboard-user-notification`]:[],eventCallback:(C,o)=>{Sa(o)&&Ke(o.mode)==="dashboard"&&d(be({unreadCount:o.data.unread},"tasks"))}};return V.jsx(Ra,{...f,...a})};export{La as M};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-BBLi67DG.js";import{h as n,n as e}from"./core-D2KaS3N5.js";import{R as i}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import"./sentry-DW4kKH26.js";import"./zeni-epic-state-BJ_gdj7r.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";(function(){try{var o=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new o.Error().stack;t&&(o._sentryDebugIds=o._sentryDebugIds||{},o._sentryDebugIds[t]="9ceba748-25d5-4d32-9a3c-da4194015415",o._sentryDebugIdIdentifier="sentry-dbid-9ceba748-25d5-4d32-9a3c-da4194015415")}catch{}})();const a=e(null,(function(o,t){return{onGoBack:()=>{t.navigate(-1)},onGoHome:()=>{t.navigate("/")}}}))(i);function _(){const o=n();return r.jsx(a,{navigate:o})}export{_ as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-
|
|
1
|
+
import{l as ct,a as mt,m as dt,j as E}from"./liveblocks-BBLi67DG.js";import lt from"./NotFoundScreen-BeJq256C.js";import{a as k}from"./sentry-DW4kKH26.js";import{h as ft,g as ut,i as ht,u as pt,j as S,n as kt,o as gt,p as Q}from"./core-D2KaS3N5.js";import{cw as St,fJ as q,eZ as H,fX as bt,fQ as b,Td as K,fT as d,fI as y,sI as M,ye as It,Te as Tt,fH as Ct,fZ as yt,sN as _t,Tf as $,bo as F,fB as x,sR as X,Tg as At,cI as Et,cB as Nt}from"./zeni-epic-state-BJ_gdj7r.js";import{_ as Bt,z as wt,A as xt,d as Rt,a0 as Dt,cW as vt,r as N,a9 as Pt,cX as Ut,aa as Gt,p as $t}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import{u as Ft}from"./useAskAiCfoHostNavButtonProps-CNoSipqI.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new t.Error().stack;l&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[l]="80f898f0-483d-459f-85c4-9603c3bf602a",t._sentryDebugIdIdentifier="sentry-dbid-80f898f0-483d-459f-85c4-9603c3bf602a")}catch{}})();const Mt=(t,l)=>new Promise(((n,u)=>{const g=t.map((i=>new Promise((s=>{l(i),s()}))));Promise.all(g).then((()=>{setTimeout((()=>{n()}),2e3)})).catch((i=>{u(i)}))})),jt=kt((function(t,l){const n=q(t),{signedInUser:u,isDebitCardFeatureEnabled:g}=l,i=b(t),s=H(t),{currentTab:h}=i;return{notificationView:i,isNotificationSettingsVisible:u.userEmail!=null&&yt(n.notificationSettings,u.userEmail,g,s),isDisabled:i.notificationDetailsByTab[h].fetchState==="In-Progress"?"disabled":void 0}}),(function(t,l){const{location:n,tenantEmailDomain:u,loggedInUserRoleMap:g,externalNotificationsUnreadCount:i,allUnreadCommentsNotificationIds:s,navigate:h,markInboxNotificationAsRead:B,fetchMoreCommentsNotifications:R}=l;return{onNotificationClick:(a,o,m,c)=>{if(c==="task_deleted"){const r=`/${u}/tasks`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}else{const r=`/${u}/tasks/${o}`,I=N(n.state?.pathnameStackToGoBack,n.pathname);h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}m==="unread"&&t(X("task_manager","read",[a],!1))},onCommentNotificationClick:(a,o,m)=>{const c=o.toString().split(`/${u}/`);if(c[1]!=null){m==="unread"&&(B(a),t($([a],F())));let r=`/${u}/${c[1]}`;const I=N(n.state?.pathnameStackToGoBack,n.pathname);c[1].startsWith("reimbursement")&&!Et(g)&&(r="not-found"),c[1].startsWith("bill")&&!Nt(g)&&(r="not-found"),h(r,{state:{pathnameStackToGoBack:I,message:"triggerBackClick"}})}},onUpdateNotificationViewUIState:(a,o)=>{t(y(a,o))},onUpdateNotificationTabState:(a,o)=>{t(d(a,o))},onUpdateNotificationViewCurrentTabAndSubTab:(a,o)=>{t(K(a,o));const m=`../${a}`,c=N(n.state?.pathnameStackToGoBack,n.pathname);h(m,{state:{pathnameStackToGoBack:c}})},onUpdateNotificationViewSubTab:a=>{t(At(a))},onFetchMoreNotifications:(a,o)=>{if(a==="tasks"){const m=[];o==="all"?m.push("read","unread"):o!=="mentions"&&m.push(o),t(M("task_manager","dashboard",m))}else R?.()},onUpdateNotificationStatus:(a,o,m,c)=>{a==="tasks"?t(X("task_manager",m,c)):(t(d({markAsReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Promise.all(c.map((r=>{m==="read"&&(B(r),t($([r],F())))}))).then((()=>{t(d({markAsReadState:{fetchState:"Completed",error:void 0},selectedNotificationIds:[]},"comments")),t(y({unreadCount:i-c.length>0?i-c.length:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))}),(r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})).catch((r=>{t(d({markAsReadState:{fetchState:"Error",error:r}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onMarkAllNotificationsAsRead:a=>{a==="tasks"?t(_t("task_manager","read")):(t(d({markAsAllReadState:{fetchState:"In-Progress",error:void 0}},"comments")),Mt(s,B).then((()=>{t($(s,F())),t(d({markAsAllReadState:{fetchState:"Completed",error:void 0}},"comments")),t(y({unreadCount:0},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"success",type:"success",showStatusIcon:!0}))})).catch((o=>{t(d({markAsAllReadState:{fetchState:"Error",error:o}},"comments")),t(x({messageSection:"notification_mark_as_read",messageText:"failed",type:"error",showStatusIcon:!0}))})))},onBackClick:()=>{const a=$t(n.state?.pathnameStackToGoBack),o=a.poppedPathname??"../../dashboard";h(o,{state:{pathnameStackToGoBack:a.newStack}})},onSettingsClick:()=>{const a=N(n.state?.pathnameStackToGoBack,n.pathname);h("../../settings/notifications",{state:{pathnameStackToGoBack:a}})}}}))(Pt(Ut)),Vt=()=>{const t=ft(),l=ut(),{tenantEmailDomain:n,selectedTab:u}=ht(),{areTenantIdsInSync:g}=Bt(),i=St(u??""),s=pt(),h=wt.getSignedInUser(),[B,R]=k.useState(!1),a=S((e=>q(e))),o=S((e=>H(e))),{useFeatureGate:m}=xt(),{isFeatureEnabled:c}=m(Rt.isDebitCardFeatureEnabled),{isAiCfoAccessEnabled:r,onAskAiCfoClick:I}=Ft({mobileExploreReferrer:"Notifications"});Dt({isDataReady:!0});const O=bt(o.userRole);if(o==null||n==null||o.companyId==null)throw Error("Can't access notifications page without current tenant...");if(h==null)throw Error("Can't access notifications page without signed in...");const j=S((e=>b(e).notificationDetailsByTab.tasks.fetchState)),V=S((e=>b(e).currentTab)),D=S((e=>b(e).currentSubTab)),Y=S((e=>b(e).notificationDetailsByTab.comments.fetchCountState)),v=S((e=>b(e).notificationDetailsByTab.comments.fetchState)),tt=S((e=>b(e).notificationDetailsByTab.comments.uiState.unreadCount)),et=S((e=>b(e).allExternalNotifications)).filter((e=>e.inboxNotification.readAt==null)).map((e=>e.inboxNotification.id)),at=vt().allUsers,{inboxNotifications:w,isLoading:_,hasFetchedAll:T,isFetchingMore:P,fetchMore:ot}=ct(),{threads:W,isLoading:L,fetchMore:Z,isFetchingMore:z,hasFetchedAll:J}=mt({query:{metadata:{companyId:o.companyId,application:"dashboard"}}});k.useEffect((()=>{if(V!==i&&i!=null&&s(K(i)),i==null){const e=`../${V}`,p=N(l.state?.pathnameStackToGoBack,l.pathname);t(e,{state:{pathnameStackToGoBack:p}})}}),[i]),k.useEffect((()=>{Y.fetchState==="Not-Started"&&s(d({fetchCountState:{fetchState:"In-Progress",error:void 0}},"comments"))}),[]),k.useEffect((()=>{if(_===!1&&T===!0&&o?.companyId!=null&&w!=null){const e=`dashboard_${o.companyId}`,p=w.filter((C=>C.roomId===e&&C.readAt==null)).length;s(d({fetchCountState:{fetchState:"Completed",error:void 0}},"comments")),s(y({unreadCount:p},"comments"))}}),[_,T]),k.useEffect((()=>{j!=="In-Progress"&&g&&s(M("task_manager","dashboard",["read","unread"]))}),[g]),k.useEffect((()=>{const e=setTimeout((()=>ot?.()),0);return()=>clearTimeout(e)}));const U=_||P===!0||T!==!0||_||P===!0||T!==!0;k.useEffect((()=>{U&&v!=="In-Progress"?s(d({fetchState:"In-Progress",error:void 0},"comments")):U||v!=="In-Progress"||s(d({fetchState:"Completed",error:void 0},"comments"))}),[U,v]),k.useEffect((()=>{s(y({hasMore:T!==!0},"comments"))}),[T]),k.useEffect((()=>{a.fetchState!=="In-Progress"&&a.fetchState!=="Completed"&&B===!1&&(R(!0),s(It()))}),[a.fetchState]),k.useEffect((()=>{if(_===!1&&L===!1&&w!=null&&W!=null){const e=`dashboard_${o.companyId}`,p=w.filter((f=>f.roomId===e)).filter((f=>f.kind==="thread")),C=p.filter((f=>f.readAt==null)),A=p.map((f=>f.id)),it=p.map((f=>{const G=W.find((rt=>rt.id===f.threadId));return G!=null?{inboxNotification:{...f,threadId:G.id},thread:G}:(z||J===!0||Z==null||Z(),null)})).filter((f=>f!=null));s(d({allNotificationsIds:A},"comments")),s(y({totalCount:A.length,unreadCount:C.length},"comments")),s(Tt(it))}}),[_,P,z,T,J,L,w?.length]);const st={events:o.userRoleId!=null?[`private-encrypted-${o.userRoleId}.dashboard-user-notification`]:[],eventCallback:(e,p)=>{if(Gt(p)){const C=Ct(p.mode);if(C==="dashboard"&&s(y({unreadCount:p.data.unread},"tasks")),j!=="In-Progress"){const A=[];D==="all"?A.push("read","unread"):D!=="mentions"&&A.push(D),s(M("task_manager",C,A,!0))}}}},nt=dt();return E.jsx(jt,{tenantEmailDomain:n,loggedInUserRoleMap:O,signedInUser:h,externalNotificationsUnreadCount:tt,location:l,navigate:t,isDebitCardFeatureEnabled:c,users:at,markInboxNotificationAsRead:nt,allUnreadCommentsNotificationIds:et,isAiCfoAccessEnabled:r,onAskAiCfoClick:I,...st})};function ne(){return E.jsxs(gt,{children:[E.jsx(Q,{path:"/:selectedTab",element:E.jsx(Vt,{})}),E.jsx(Q,{path:"*",element:E.jsx(lt,{})})]})}export{ne as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as m}from"./liveblocks-
|
|
1
|
+
import{j as m}from"./liveblocks-BBLi67DG.js";import{a as r}from"./sentry-DW4kKH26.js";import{u as T,g as A,j as o,N as P}from"./core-D2KaS3N5.js";import{ME as j,eZ as C,fP as x,MF as z,MG as D,MH as L,MI as R,oi as k,LB as N}from"./zeni-epic-state-BJ_gdj7r.js";import{z as h,M as I}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";(function(){try{var n=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new n.Error().stack;a&&(n._sentryDebugIds=n._sentryDebugIds||{},n._sentryDebugIds[a]="1497b19d-ff7a-4110-b12a-1cb36287a629",n._sentryDebugIdIdentifier="sentry-dbid-1497b19d-ff7a-4110-b12a-1cb36287a629")}catch{}})();function ee(){const n=T(),a=A(),{params:t,error:i}=r.useMemo((()=>j(a.search)),[a.search]),w=r.useMemo((()=>new URLSearchParams(a.search).get("client_name")??t?.clientId??"Unknown Application"),[a.search,t]),f=h.isSignedIn(),s=h.getSignedInUser(),p=o((e=>C(e))),l=o((e=>x(e))),d=o((e=>e.tenantState.fetchState)),b=o(z),y=o(D),u=o(L),[v,S]=r.useState(null),[E,M]=r.useState(null);r.useEffect((()=>{document.querySelector("#app-shell-loader")?.remove()}),[]),r.useEffect((()=>()=>{n(R())}),[n,a.search]),r.useEffect((()=>{i!=null&&console.warn("[OAuthConsent] invalid params:",i)}),[i]);const g=r.useRef(!1);r.useEffect((()=>{f&&s!=null&&!g.current&&(d!=="Not-Started"&&d!=="Error"||(g.current=!0,n(k(s.userId,s.zeniSessionId??void 0))))}),[f,s,d,n]),r.useEffect((()=>{u!=null&&u!==""&&(window.location.href=u)}),[u]);const _=r.useMemo((()=>{if(p?.tenantId!=null)return p.tenantId;const e=h.getActiveTenantForUser()?.tenantId;return e!=null&&l.some((U=>U.tenantId===e))?e:l.length===1?l[0].tenantId:null}),[p?.tenantId,l]),c=v??_;return i!=null?m.jsx(I,{variant:"invalid_params",paramsError:i}):f?m.jsx(I,{variant:"signed_in",clientName:w,userEmail:s?.userEmail,isInitializing:d!=="Completed",tenants:l,selectedTenantId:c,onSelectTenant:S,approveError:E??y,isApproving:b==="In-Progress",showAllowButton:c!=null,onApprove:()=>{t!=null&&s!=null&&c!=null&&n(N(s.userId,s.zeniSessionId??void 0,c,t.clientId,t.redirectUri,t.codeChallenge,t.codeChallengeMethod,t.state,t.responseType))},onDeny:()=>{if(t!=null)try{const e=new URL(t.redirectUri);e.searchParams.set("error","access_denied"),e.searchParams.set("error_description","The user denied the request"),e.searchParams.set("state",t.state),window.location.href=e.toString()}catch{M("Unable to deny: redirect_uri is not a valid URL. Close this window or contact support.")}}}):m.jsx(P,{to:"/signin/auth",state:{origin:a.pathname+a.search},replace:!0})}export{ee as default};
|
package/dist/assets/{PandLWithForecastRoutes-W3OrOyHu.js → PandLWithForecastRoutes-DdDF5n8o.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as n}from"./liveblocks-
|
|
1
|
+
import{j as n}from"./liveblocks-BBLi67DG.js";import{h as V,u as z,g as H,i as J,j as d,n as K,o as Q,p as I}from"./core-D2KaS3N5.js";import{eZ as U,sw as R,s4 as X,N9 as v,r$ as y,bs as ee,bn as ae,bZ as te,s0 as se,Na as oe,MY as C,dI as re,wb as ne,Nb as ie,wy as ce,fG as le,fE as de}from"./zeni-epic-state-BJ_gdj7r.js";import{z as me,_ as fe,a0 as pe,e as ue,A as w,d as M,C as he,f as N,ap as ge,r as Fe}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import be from"./NotFoundScreen-BeJq256C.js";import{F as Ie}from"./FeaturePreviewScreen-C_bWMNSt.js";import{a as g}from"./sentry-DW4kKH26.js";import{u as Ce}from"./useAskAiCfoHostNavButtonProps-CNoSipqI.js";import{u as ye}from"./useInitialThreadRequest-UA6eH2dj.js";import{t as Se}from"./routePaths-TRamKMNj.js";import{M as Te}from"./MobileAppDrawer-O95nPlSQ.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.js";(function(){try{var s=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new s.Error().stack;e&&(s._sentryDebugIds=s._sentryDebugIds||{},s._sentryDebugIds[e]="5867bc77-3bd4-4d06-a77a-ec336f681805",s._sentryDebugIdIdentifier="sentry-dbid-5867bc77-3bd4-4d06-a77a-ec336f681805")}catch{}})();const S=(s,e,a,o)=>{if(s!=e){const r=o??"";s!=null&&s.length>0?a(`../${e}${r}`,{replace:!0}):a(`${e}${r}`,{replace:!0})}},Ae=K((function(s){const e=oe(s),a={},o=e.pandLReportWithForecast.uiState.nodeCollapseState;return Object.keys(o).forEach((r=>{a[r]=o[r]===!1})),{selectedTimeframe:e.selectedTimeframe,isForecastVsActualOn:e.isForecastVsActualOn,compareMode:e.compareMode,forecastList:e.forecastList,selectedForecast:e.selectedForecast,pandLreport:e.pandLReportWithForecast,scrollPosition:e.pandLReportWithForecast.uiState.scrollPosition,nodeOpenStatus:a,type:"name+balances_forecast",analytics:N}}),(function(s,e){return{onForecastSelectionChanged:(a,o)=>{s(v(a,o)),e.isPandLReportFetched(a)||s(y(a)),S(e.forecastIdFromUrlPath,a,e.navigate)},onTimeframeChanged:a=>{s(ce(a))},onForecastVsActualsCompareToggle:a=>{s(ie(a)),s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:{scrollLeft:0,scrollTop:0}}))},onCompareModeChanged:a=>{s(ne(e.firstMonthOfFY,a,0,[]))},onAccountBalanceClick:e.hasTransactionAccess!==!0?void 0:(a,o)=>{let r,i;const p=a.accountName===""?a.accountDescription:a.accountName;if(o.balanceTimeFrame==="month"||o.balanceTimeFrame==="quarter"?(r=o.balanceTimeFrame,i=re(o)):o.balanceTimeFrame==="year"?(r="quarter",i={startDate:o.endDate.startOf("quarter"),endDate:o.endDate}):console.error(`timeframe ${o.balanceTimeFrame} is not supported`),i!=null&&r!=null){const m=Se(e.tenantEmailDomain,a.accountId,a.accountType,p,r,i),u=Fe(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(m,{state:{pathnameStackToGoBack:u,referrer:"Forecast"}})}},onNodeCollapseToggled:(a,o)=>{s(C({forecastId:e.forecastIdFromUrlPath,nodeCollapseState:{nodeId:a,isCollapsed:o===!1}}))},onTableScroll:a=>{s(C({forecastId:e.forecastIdFromUrlPath,scrollPosition:a}))},onBackClick:()=>{e.navigate("../../")}}}))(ge);function O(){const s=V(),e=z(),a=H(),{forecastId:o,tenantEmailDomain:r}=J(),[i,p]=g.useState(!1),[m,u]=g.useState(!1),h=me.getSignedInUser(),T=d((t=>U(t))),$=T.company?.companyInfo.firstMonthOfFY??1,c=d((t=>R(t.forecastState,t.forecastListState))),l=d((t=>t.forecastListState.fetchState==="Completed")),A=d((t=>t.profitAndLossState)),k=d((t=>t.reportUIOptionsState.selectedForecast)),x=t=>A.pandLByForecastID[t]!=null&&se(t,A).reducedAllFetchState.fetchState==="Completed",{areTenantIdsInSync:F}=fe();pe({isDataReady:l});const{isAiCfoAccessEnabled:_,onAskAiCfoClick:q}=Ce({mobileExploreReferrer:"Forecast"});g.useEffect((()=>{if(!i&&F)p(!0),l||e(X());else if(l&&!m){u(!0);const t=((f,L,P)=>L!=null?f.forecasts.findIndex((b=>b.id===L)):P!=null?f.forecasts.findIndex((b=>b.id===P)):f.forecasts.length>0?0:-1)(c,o,k?.id);t===-1&&o!=null?s("page-not-found",{replace:!0}):t!==-1&&t!=k?.index?(e(v(c.forecasts[t].id,t)),S(o,c.forecasts[t].id,s,a.search)):o==null&&t!==-1&&S(void 0,c.forecasts[t].id,s,a.search),t!==-1&&!x(c.forecasts[t].id)&&F&&e(y(c.forecasts[t].id))}}),[i,p,e,l,c,m,u,R,y,F]);const D=ue(),B=D?.loggedInUserRole!=null&&ee(D.loggedInUserRole),{useFeatureGate:G}=w(),{isFeatureEnabled:E}=G(M.isReportsCommentingEnabled),W=ye(E?T?.companyId:void 0,{clearParams:l&&m}),[Y,Z]=g.useState(!1),j=t=>{Z(t)};return n.jsxs(n.Fragment,{children:[l?n.jsx(he,{analytics:N,onLoad:t=>(f=>f.trackForecast())(t)}):null,n.jsx(Te,{isAppContentDrawerOpen:Y,handleDrawerToggle:j}),n.jsx(Ae,{firstMonthOfFY:$,tenantEmailDomain:r,forecastIdFromUrlPath:o,navigate:s,location:a,isPandLReportFetched:x,meetingUrl:te(`https://meetings.hubspot.com/svitlana-grankovska?firstname=${h?.firstName}&lastname=${h?.lastName}&email=${h?.userEmail}`),hasTransactionAccess:B,isAiCfoAccessEnabled:_,onAskAiCfoClick:q,isReportsCommentingEnabled:E,isZeniUser:ae(h),initialOpenThreadRequest:W,onClickMenuIcon:()=>{j(!0)}})]})}function Ze(){const s=d((i=>U(i))),{useFeatureGate:e}=w(),{isFeatureEnabled:a}=e(M.isDebitCardFeatureEnabled),o=le(a,s),r=de(s);return o===!0||r===!0?n.jsx(Ie,{}):n.jsxs(Q,{children:[n.jsx(I,{path:"/",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId",element:n.jsx(O,{})}),n.jsx(I,{path:"/:forecastId/*",element:n.jsx(be,{})})]})}export{Ze as PandLWithForecastRoutes,Ze as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as a}from"./liveblocks-
|
|
1
|
+
import{j as a}from"./liveblocks-BBLi67DG.js";import{N5 as oe,eZ as Q,kG as H,fG as X,fE as ie,Kz as ee,ML as re,v8 as ke,N6 as Y,uZ as Ee,vi as ve,vc as le,v1 as ce,vg as Pe,vd as je,N7 as de,wZ as Le,fq as Te,gi as Ae,N8 as _,v5 as pe,v4 as ue,vl as Fe,c7 as Oe}from"./zeni-epic-state-BJ_gdj7r.js";import{K as me,A as ae,d as G,z as K,i as ge,S as fe,I as he,al as Ce,am as Re,F as ye,o as R,J as be,O as M,an as Ve,_ as Ze,a0 as Be,C as Ue,f as Se,h as $e,r as ze,ao as _e,e as Ge}from"./index-CivdpZRT.js";import{D as we,n as N,S as xe}from"./mui-C1ThRyKO.js";import te from"./NotFoundScreen-BeJq256C.js";import{a as c}from"./sentry-DW4kKH26.js";import{u as se,i as He,j as g,h as Ke,g as Me,n as Ne,o as ne,p as z}from"./core-D2KaS3N5.js";import{u as We}from"./useAskAiCfoHostNavButtonProps-CNoSipqI.js";import{M as qe}from"./MobileAppDrawer-O95nPlSQ.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.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]="e323582e-43ca-41f7-b541-a027a1286c96",e._sentryDebugIdIdentifier="sentry-dbid-e323582e-43ca-41f7-b541-a027a1286c96")}catch{}})();const Je={overlayWidth:new ye(100,100,48)},W=M.getLocalizedStrings().peoplePage.invitePage,Ye=M.getLocalizedStrings().common,Qe=({companyId:e,managersListView:t,companyPassportView:d,classListView:n,mode:f,isEditPeopleDrawerOpen:i,closeDrawerHandler:b})=>{const h=me(),m=se(),[V,Z]=c.useState(!1),[k,S]=c.useState(!1),{userId:w}=He(),r=g((l=>oe(l))),p=g((l=>Q(l))),E=g((l=>H(l))),{useFeatureGate:D}=ae(),{isFeatureEnabled:I}=D(G.isDebitCardFeatureEnabled),v=X(I,p),L=ie(p),T=ee(p),B=re(p),U=!!p.company?.featuresActivationInfo?.isReimbursementFeatureEnabled,x=!v&&E&&n.fetchState!=="Completed"||t.fetchState!=="Completed"||d.fetchState!=="Completed"||e==null;if(K.getSignedInUser()==null)throw Error("Can't access invite people page without signing in...");const C=()=>{m(Y()),b()},A=()=>{V===!0?S(!0):C()},$=d.companyView?.controllers?.map((l=>l.user)),u=!!p.company?.companyZeniAccountInfo?.isZeniAccountEnabled,{isFeatureEnabled:P}=D(G.isChargeCardFeatureEnabled),j=ge(p,P,I),{isCardsHidden:F}=fe(p?.tenantId),y=!j||F,O=p.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",s={peopleDetails:r,classList:n.classes,managersList:t.users,controllersList:$,mode:f,isZeniTenant:T,isAccountingClassesEnabled:E,isReimbursementDisabled:U===!1,isZeniAccountsDisabled:u===!1,isChargeCardDisabled:y,isTreasuryDisabled:O===!1,isLiteRoleDisabled:B===!1,isBankingOnlyTenant:v,isCardsOnlyTenant:L,onResetClick:C,onDeleteUser:l=>{m(ce(l.userId,l.userRole.userRoleId))},onPeopleLocalDataUpdated:l=>{m(le({peopleLocalData:l})),Z(!0)},onSaveClick:()=>{m(f==="zeni_only"?Ee(e):ve(T))},onCloseClick:A,isLoading:x||r.person==null},o={onOkClick:()=>{S(!1),C()},onCancelClick:()=>{S(!1)}};return c.useEffect((()=>{x===!1&&w!=null&&m(ke(w))}),[x,w]),c.useEffect((()=>{r.updatePersonState.fetchState==="Completed"&&C()}),[r.updatePersonState.fetchState]),a.jsx(we,{anchor:"right",open:i,PaperProps:{style:{width:Je.overlayWidth.valuePercentage(h),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:he.overlayDark,cursor:"pointer"}}},onClose:A,children:a.jsxs(Xe,{onClick:l=>l.stopPropagation(),children:[k===!0?a.jsx(Ce,{titleComponent:a.jsx(De,{children:W.discardTitle}),descriptionComponent:a.jsx(Ie,{children:W.discardDescription}),primaryButtonText:W.discard,secondaryButtonText:Ye.no,action:o,isEditPopup:!0}):null,a.jsx(Re,{...s})]})})},Xe=N(xe)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-BBLi67DG.js";import E from"./NotFoundScreen-BeJq256C.js";import{a as r}from"./sentry-DW4kKH26.js";import{h as _,g as v,j as p,i as M,u as U,N as P,n as z,o as B,p as h}from"./core-D2KaS3N5.js";import{eZ as O,Th as b,bq as F,bn as N,im as V,fB as q}from"./zeni-epic-state-BJ_gdj7r.js";import{v as Y,z as I,a0 as Z,cY as $}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import{u as G}from"./useAskAiCfoHostNavButtonProps-CNoSipqI.js";import{M as H}from"./MobileAppDrawer-O95nPlSQ.js";import"./recharts-jHFM5Sob.js";import"./analytics-C2MbRoEp.js";import"./plaid-Do7hhR27.js";import"./dnd-D-AkKI2c.js";import"./stripe-cKAAJElX.js";import"./lottie-Dz6JZ58r.js";import"./lexical-BQ-Po3YF.js";import"./pdf-2k8d7AeQ.js";import"./utils-DIwqH7uj.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]="d41624c0-4033-4bc2-a2e0-9f6a994af547",e._sentryDebugIdIdentifier="sentry-dbid-d41624c0-4033-4bc2-a2e0-9f6a994af547")}catch{}})();const J=z((function(e){const t=I.getSignedInUser(),c=e.tenantState.currentTenantId,o={userId:t?.userId??"",sessionId:t?.zeniSessionId??"",tenantId:c??""},{aggregatedReportViewState:n}=b(e);return{authParams:o,isDisabled:!1,loggedInUser:t,aggregatedReport:n}}),(function(e,t){return{onBackClick:()=>{t.navigate("../../")},onClickMenuIcon:()=>{t.handleDrawerToggle(!0)}}}))($),K=()=>{const e=_(),t=v(),c=Y(),o=p((a=>O(a))),{aggregatedReportViewState:n}=p((a=>b(a))),{tenantEmailDomain:m}=M(),u=U(),d=I.getSignedInUser();if(d==null)throw new Error("Can't access this page without signing in...");const f=r.useRef(!1),[w,S]=r.useState(!1),C=F(o?.userRole??[]),k=o?.userRole?.includes("bookkeeping_admin")??!1,x=N(d),y=C||k||x,l=r.useCallback(((a,i,A)=>{u(V({fromMonth:a,toMonth:i,cacheOverride:A}))}),[]);r.useEffect((()=>{n?.fetchState==="Completed"&&f.current&&(u(q({messageSection:"data_refresh_update",messageText:"success",type:"success",showStatusIcon:!0})),f.current=!1)}),[n?.fetchState]);const D=r.useCallback(((a,i)=>{n!=null&&n?.fetchState==="In-Progress"||l(a,i,!0),f.current=!0}),[n?.fetchState,l]),j=r.useCallback(((a,i)=>{l(a,i,!1)}),[l]),g=a=>{S(a)},{isAiCfoAccessEnabled:R,onAskAiCfoClick:T}=G({mobileExploreReferrer:"Performance"});return Z({isDataReady:n?.fetchState==="Completed"}),y?s.jsxs(s.Fragment,{children:[s.jsx(H,{isAppContentDrawerOpen:w,handleDrawerToggle:g}),s.jsx(J,{navigate:e,location:t,themeState:c,currentTenant:o,signedInUser:d,tenantEmailDomain:m,onReload:D,onTimeRangeSelect:j,handleDrawerToggle:g,isAiCfoAccessEnabled:R,onAskAiCfoClick:T})]}):s.jsx(P,{to:`/${m}/dashboard`,replace:!0})};function ge(){return s.jsxs(B,{children:[s.jsx(h,{path:"*",element:s.jsx(K,{})}),s.jsx(h,{path:"*",element:s.jsx(E,{})})]})}export{ge as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,b as t}from"./sentry-
|
|
1
|
+
import{a as h,b as t}from"./sentry-DW4kKH26.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new r.Error().stack;a&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[a]="a301a95b-8420-43bd-aa56-5738077199ba",r._sentryDebugIdIdentifier="sentry-dbid-a301a95b-8420-43bd-aa56-5738077199ba")}catch{}})();const c="64px",b={};var k=({src:r,light:a,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[p,i]=h.useState(null);h.useEffect((()=>{r&&a&&n&&v({src:r,light:a,oEmbedUrl:n})}),[r,a,n]);const v=async({src:e,light:d,oEmbedUrl:I})=>{if(t.isValidElement(d))return;if(typeof d=="string")return void i(d);if(b[e])return void i(b[e]);i(null);const E=await fetch(I.replace("{url}",e)),g=await E.json();if(g.thumbnail_url){const f=g.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(f),b[e]=f}},o=t.isValidElement(a),y={display:"flex",alignItems:"center",justifyContent:"center"},s={preview:{width:"100%",height:"100%",backgroundImage:p&&!o?`url(${p})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...y},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:o?"absolute":void 0,...y},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=t.createElement("div",{style:s.shadow,className:"react-player__shadow"},t.createElement("div",{style:s.playIcon,className:"react-player__play-icon"}));return t.createElement("div",{style:s.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},o?a:null,w||_)};export{k as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as Ol}from"./liveblocks-
|
|
1
|
+
import{j as Ol}from"./liveblocks-BBLi67DG.js";import{p as Q,e as xc,d as kc,g as jl,a as xl}from"./sentry-DW4kKH26.js";import{L as dt,bZ as Tc,eZ as Ac,Mf as Rc,MJ as kl,c7 as Tl,g2 as Al,g3 as Rl}from"./zeni-epic-state-BJ_gdj7r.js";import{a as lt,b as Il,c as Pl,d as Nl,e as an,f as Ll,g as $l,h as Ml,i as Vt,j as Ic,k as oe,l as je,m as Cl,o as Yt,p as ue,q as Dl}from"./utils-DIwqH7uj.js";import{r as un}from"./empty-D1hMU_8M.js";import{r as Fl,a as Bl,b as Ul,c as ql}from"./pdf-lib-DqPqgk_2.js";import{r as Gl}from"./index-CHRJI22G.js";import{r as zl}from"./index-Dyy6NuL-.js";import{h as Zl,g as Hl,u as Vl,j as En,n as Yl}from"./core-D2KaS3N5.js";import{u as Kl,z as Pc,L as Wl,N as Jl,Q as Xl,k as Ql,f as tf}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import{d as Pe}from"./decodeURIComponentSafe-CD_zntJd.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},f=new t.Error().stack;f&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[f]="235f1eef-55f4-4e21-9a94-c1b331a3b572",t._sentryDebugIdIdentifier="sentry-dbid-235f1eef-55f4-4e21-9a94-c1b331a3b572")}catch{}})();var _n,Sn={exports:{}},On,jn,xn,kn,Tn,An,Rn,In,Pn,Ne,Nn,Ln,$n,Mn,Cn,Dn,Fn,Bn,Un,qn,Gn,Le,zn,Zn,Hn,Vn,Yn,Kn,Wn,$e,Jn,Xn,Qn,to,eo,ro,no,Me={exports:{}},Ce={exports:{}},De={};function Nc(){if(On)return De;function t(r){return t=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(r)}function f(r,e){return f=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(a,p){return a.__proto__=p,a},f(r,e)}function m(r){var e=(function(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}})();return function(){var a,p=s(r);if(e){var h=s(this).constructor;a=Reflect.construct(p,arguments,h)}else a=p.apply(this,arguments);return(function(d,b){if(b&&(t(b)==="object"||typeof b=="function"))return b;if(b!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return(function(g){if(g===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return g})(d)})(this,a)}}function s(r){return s=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},s(r)}On=1;var l,o,n={};function i(r,e,a){a||(a=Error);var p=(function(h){(function(c,y){if(typeof y!="function"&&y!==null)throw new TypeError("Super expression must either be null or a function");c.prototype=Object.create(y&&y.prototype,{constructor:{value:c,writable:!0,configurable:!0}}),Object.defineProperty(c,"prototype",{writable:!1}),y&&f(c,y)})(g,h);var d,b=m(g);function g(c,y,v){var S;return(function(w,_){if(!(w instanceof _))throw new TypeError("Cannot call a class as a function")})(this,g),S=b.call(this,(function(w,_,M){return typeof e=="string"?e:e(w,_,M)})(c,y,v)),S.code=r,S}return d=g,Object.defineProperty(d,"prototype",{writable:!1}),d})(a);n[r]=p}function u(r,e){if(Array.isArray(r)){var a=r.length;return r=r.map((function(p){return String(p)})),a>2?"one of ".concat(e," ").concat(r.slice(0,a-1).join(", "),", or ")+r[a-1]:a===2?"one of ".concat(e," ").concat(r[0]," or ").concat(r[1]):"of ".concat(e," ").concat(r[0])}return"of ".concat(e," ").concat(String(r))}return i("ERR_AMBIGUOUS_ARGUMENT",'The "%s" argument is ambiguous. %s',TypeError),i("ERR_INVALID_ARG_TYPE",(function(r,e,a){var p,h,d;if(l===void 0&&(l=ie()),l(typeof r=="string","'name' must be a string"),typeof e=="string"&&(h="not ",e.substr(0,h.length)===h)?(p="must not be",e=e.replace(/^not /,"")):p="must be",(function(g,c,y){return(y===void 0||y>g.length)&&(y=g.length),g.substring(y-c.length,y)===c})(r," argument"))d="The ".concat(r," ").concat(p," ").concat(u(e,"type"));else{var b=(function(g,c,y){return typeof y!="number"&&(y=0),!(y+c.length>g.length)&&g.indexOf(c,y)!==-1})(r,".")?"property":"argument";d='The "'.concat(r,'" ').concat(b," ").concat(p," ").concat(u(e,"type"))}return d+=". Received type ".concat(t(a))}),TypeError),i("ERR_INVALID_ARG_VALUE",(function(r,e){var a=arguments.length>2&&arguments[2]!==void 0?arguments[2]:"is invalid";o===void 0&&(o=lt());var p=o.inspect(e);return p.length>128&&(p="".concat(p.slice(0,128),"...")),"The argument '".concat(r,"' ").concat(a,". Received ").concat(p)}),TypeError),i("ERR_INVALID_RETURN_VALUE",(function(r,e,a){var p;return p=a&&a.constructor&&a.constructor.name?"instance of ".concat(a.constructor.name):"type ".concat(t(a)),"Expected ".concat(r,' to be returned from the "').concat(e,'"')+" function but got ".concat(p,".")}),TypeError),i("ERR_MISSING_ARGS",(function(){for(var r=arguments.length,e=new Array(r),a=0;a<r;a++)e[a]=arguments[a];l===void 0&&(l=ie()),l(e.length>0,"At least one arg needs to be specified");var p="The ",h=e.length;switch(e=e.map((function(d){return'"'.concat(d,'"')})),h){case 1:p+="".concat(e[0]," argument");break;case 2:p+="".concat(e[0]," and ").concat(e[1]," arguments");break;default:p+=e.slice(0,h-1).join(", "),p+=", and ".concat(e[h-1]," arguments")}return"".concat(p," must be specified")}),TypeError),De.codes=n,De}function ef(){if(xn)return jn;function t(k,E){var j=Object.keys(k);if(Object.getOwnPropertySymbols){var x=Object.getOwnPropertySymbols(k);E&&(x=x.filter((function(O){return Object.getOwnPropertyDescriptor(k,O).enumerable}))),j.push.apply(j,x)}return j}function f(k){for(var E=1;E<arguments.length;E++){var j=arguments[E]!=null?arguments[E]:{};E%2?t(Object(j),!0).forEach((function(x){m(k,x,j[x])})):Object.getOwnPropertyDescriptors?Object.defineProperties(k,Object.getOwnPropertyDescriptors(j)):t(Object(j)).forEach((function(x){Object.defineProperty(k,x,Object.getOwnPropertyDescriptor(j,x))}))}return k}function m(k,E,j){return(E=l(E))in k?Object.defineProperty(k,E,{value:j,enumerable:!0,configurable:!0,writable:!0}):k[E]=j,k}function s(k,E,j){return E&&(function(x,O){for(var $=0;$<O.length;$++){var N=O[$];N.enumerable=N.enumerable||!1,N.configurable=!0,"value"in N&&(N.writable=!0),Object.defineProperty(x,l(N.key),N)}})(k.prototype,E),Object.defineProperty(k,"prototype",{writable:!1}),k}function l(k){var E=(function(j,x){if(p(j)!=="object"||j===null)return j;var O=j[Symbol.toPrimitive];if(O!==void 0){var $=O.call(j,x);if(p($)!=="object")return $;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(j)})(k,"string");return p(E)==="symbol"?E:String(E)}function o(k,E){if(E&&(p(E)==="object"||typeof E=="function"))return E;if(E!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n(k)}function n(k){if(k===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return k}function i(k){var E=typeof Map=="function"?new Map:void 0;return i=function(j){if(j===null||(x=j,Function.toString.call(x).indexOf("[native code]")===-1))return j;var x;if(typeof j!="function")throw new TypeError("Super expression must either be null or a function");if(E!==void 0){if(E.has(j))return E.get(j);E.set(j,O)}function O(){return u(j,arguments,a(this).constructor)}return O.prototype=Object.create(j.prototype,{constructor:{value:O,enumerable:!1,writable:!0,configurable:!0}}),e(O,j)},i(k)}function u(k,E,j){return u=r()?Reflect.construct.bind():function(x,O,$){var N=[null];N.push.apply(N,O);var P=new(Function.bind.apply(x,N));return $&&e(P,$.prototype),P},u.apply(null,arguments)}function r(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch{return!1}}function e(k,E){return e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(j,x){return j.__proto__=x,j},e(k,E)}function a(k){return a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(E){return E.__proto__||Object.getPrototypeOf(E)},a(k)}function p(k){return p=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(E){return typeof E}:function(E){return E&&typeof Symbol=="function"&&E.constructor===Symbol&&E!==Symbol.prototype?"symbol":typeof E},p(k)}xn=1;var h=lt().inspect,d=Nc().codes.ERR_INVALID_ARG_TYPE;function b(k,E,j){return(j===void 0||j>k.length)&&(j=k.length),k.substring(j-E.length,j)===E}var g="",c="",y="",v="",S={deepStrictEqual:"Expected values to be strictly deep-equal:",strictEqual:"Expected values to be strictly equal:",strictEqualObject:'Expected "actual" to be reference-equal to "expected":',deepEqual:"Expected values to be loosely deep-equal:",equal:"Expected values to be loosely equal:",notDeepStrictEqual:'Expected "actual" not to be strictly deep-equal to:',notStrictEqual:'Expected "actual" to be strictly unequal to:',notStrictEqualObject:'Expected "actual" not to be reference-equal to "expected":',notDeepEqual:'Expected "actual" not to be loosely deep-equal to:',notEqual:'Expected "actual" to be loosely unequal to:',notIdentical:"Values identical but not reference-equal:"};function w(k){var E=Object.keys(k),j=Object.create(Object.getPrototypeOf(k));return E.forEach((function(x){j[x]=k[x]})),Object.defineProperty(j,"message",{value:k.message}),j}function _(k){return h(k,{compact:!1,customInspect:!1,depth:1e3,maxArrayLength:1/0,showHidden:!1,breakLength:1/0,showProxy:!1,sorted:!0,getters:!0})}function M(k,E,j){var x="",O="",$=0,N="",P=!1,G=_(k),A=G.split(`
|
|
2
2
|
`),I=_(E).split(`
|
|
3
3
|
`),R=0,B="";if(j==="strictEqual"&&p(k)==="object"&&p(E)==="object"&&k!==null&&E!==null&&(j="strictEqualObject"),A.length===1&&I.length===1&&A[0]!==I[0]){var V=A[0].length+I[0].length;if(V<=10){if(!(p(k)==="object"&&k!==null||p(E)==="object"&&E!==null||k===0&&E===0))return"".concat(S[j],`
|
|
4
4
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as r}from"./liveblocks-
|
|
1
|
+
import{j as r}from"./liveblocks-BBLi67DG.js";import $ from"./NotFoundScreen-BeJq256C.js";import{a as p}from"./sentry-DW4kKH26.js";import{h as x,g as C,u as E,j as u,N as D,n as k,o as O,p as g}from"./core-D2KaS3N5.js";import{eZ as I,Qz as S,QP as b,FY as V,F5 as U,FX as d,FO as B,R0 as N,F_ as W}from"./zeni-epic-state-BJ_gdj7r.js";import{z as F,a9 as L,bZ as z,ag as T,bC as Q,b_ as Z}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.js";import{u as K,R as A}from"./ReimbursementApprovalRuleDetailScreen-BdQmAA7j.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]="12e2438f-512c-4f0f-8f8c-366274e260ec",e._sentryDebugIdIdentifier="sentry-dbid-12e2438f-512c-4f0f-8f8c-366274e260ec")}catch{}})();const y="reimbursement-approval-rule-update",P=k((function(e){return{approvalView:S(e),remiSetupApproverViewUpdateData:b(e).remiSetupApproverViewUpdateData}}),(function(e,o){const{navigate:s,location:a}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(y)&&e(N(!1))},onBackClick:()=>{T(a)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!1))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))}}}))(L(z)),X=({isLoading:e})=>{const o=x(),s=C(),a=E(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((n=>n.remiSetupApproverViewState.fetchState)),l=u((n=>I(n))),c=u((n=>S(n))),v=u((n=>b(n).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&a(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),a(U(!0,!1,!1,!1)))}),[t,f,e,a]),F.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(R(!0),a(d())),o("./new"))}),[m,c,a]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${y}`]:[],eventCallback:(n,_,h)=>{n.endsWith(y)&&h.onApprovalRulesEventReceived(n)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(P,{currentTenant:l,location:s,navigate:o,...w})},j="reimbursement-approval-rule-update",Y=k((function(e){const o=S(e),s=b(e).remiSetupApproverViewUpdateData,a={};for(const i of Object.values(e.vendorState.vendorByID))i?.id!=null&&(a[i.id]=i.name);const t={};for(const i of Object.values(e.classState.classesByKey))i?.classId!=null&&(t[i.classId]=i.className);return{approvalView:o,remiSetupApproverViewUpdateData:s,vendorNamesById:a,departmentNamesById:t}}),(function(e,o){const{navigate:s,location:a}=o;return{onApprovalRulesEventReceived:t=>{t.endsWith(j)&&e(N(!1))},onBackClick:()=>{T(a)?s("../../"):s("../../../reimbursements/setup")},onDeleteRuleClick:t=>{e(B(t,!0))},onEditRuleClick:t=>{t!=null?(e(d(t)),s(`./${t}/edit`)):(e(d()),s("./new"))},onReorderRules:t=>{e(W(t,!0))}}}))(L(Z)),q=()=>{const e=u((a=>I(a))),{isApprovalRulesV3Enabled:o,isLoading:s}=Q(e?.tenantId);return o?r.jsx(G,{isLoading:s}):r.jsx(X,{isLoading:s})},G=({isLoading:e})=>{const o=x(),s=C(),a=E(),[t,i]=p.useState(!1),[m,R]=p.useState(!1),f=u((n=>n.remiSetupApproverViewState.fetchState)),l=u((n=>I(n))),c=u((n=>S(n)));K();const v=u((n=>b(n).remiSetupApproverViewUpdateData));if(p.useEffect((()=>{v?.updateStatus.fetchState==="Completed"&&a(V())}),[v]),p.useEffect((()=>{t||f!=="Not-Started"||e||(i(!0),a(U(!0,!1,!1,!0)))}),[t,f,e,a]),F.getSignedInUser()==null)throw Error("Can't access reimbursement approval without signing in...");p.useEffect((()=>{c.allApprovalRules.length===0&&c.fetchState==="Completed"&&(m||(R(!0),a(d())),o("./new"))}),[m,c,a]);const w={events:l.companyId!=null?[`private-encrypted-${l.companyId}.${j}`]:[],eventCallback:(n,_,h)=>{n.endsWith(j)&&h.onApprovalRulesEventReceived(n)}};return l?.companyReimbursementInfo?.info?.isReimbursementTOSAccepted===!1?r.jsx(D,{to:"../../promo"}):r.jsx(Y,{currentTenant:l,location:s,navigate:o,isLoading:e,...w})};function oe(){return r.jsxs(O,{children:[r.jsx(g,{path:"/",element:r.jsx(q,{})}),r.jsx(g,{path:"/new",element:r.jsx(A,{})}),r.jsx(g,{path:"/:approvalRuleId/edit",element:r.jsx(A,{})}),r.jsx(g,{path:"*",element:r.jsx($,{})})]})}export{oe as R};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as b}from"./liveblocks-
|
|
1
|
+
import{j as b}from"./liveblocks-BBLi67DG.js";import{a as f}from"./sentry-DW4kKH26.js";import{u as T,j as g,h as _,g as O,i as k,n as F}from"./core-D2KaS3N5.js";import{l6 as L,QP as w,Qz as C,FR as V,G1 as B,FY as A,FZ as E,QQ as j,eZ as z,FX as Z}from"./zeni-epic-state-BJ_gdj7r.js";import{z as P,y as N,B as Q,bP as G,ag as $,bC as K,bQ as W}from"./index-CivdpZRT.js";import"./mui-C1ThRyKO.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]="b299935a-0703-4363-9cbb-f2e8cbadb5ff",e._sentryDebugIdIdentifier="sentry-dbid-b299935a-0703-4363-9cbb-f2e8cbadb5ff")}catch{}})();function X(){const e=T(),s=f.useRef(!1),t=g((o=>o.vendorListState.fetchStateBillsTab.fetchState??"Not-Started")),p=g((o=>o.vendorListState.allVendorIdsBillsTab.length>0));f.useEffect((()=>{s.current||p||t==="Completed"||t==="In-Progress"||(s.current=!0,e(L({})))}),[p,t,e])}const Y=F((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=p==="approval_create"&&t.allApprovalRules.length!==0;let l=t.allApprovalRules.length===0;return s.approvalRuleId&&(l=t.allApprovalRules.findIndex((r=>r.approvalRuleId===s.approvalRuleId))===0),{localData:t,hideUpperBoundField:o,isLowerBoundDisabled:l,approvalUpdateActionType:p}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=v=>{const h=[];return v.forEach((u=>{const R=u.actors.selectedUsers.map((m=>({type:"user",subType:void 0,userId:m.userId,idType:"user",isImplicitActor:!1}))),I=u.actors.selectedNonUsers.map((m=>{const y=(S=m.value,j(S)==null);var S;return{type:y?"attribute":"role",subType:m.value,userId:void 0,idType:void 0,isImplicitActor:!y}})),c=R.concat(I);h.push({action:u.stepType.selectedOption,actors:c,operator:c.length>1?u.stepType.selectedOption==="require_approval"?"or":"and":"is"})})),h},n={amount:{type:"amount",comparator:"range",min:{amount:a.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:a.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(r==="approval_create"){const v={criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}else{const v={approvalRuleId:l,criteria:n,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(v))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!1))},onSaveRuleSuccess:()=>{t("../")}}}))(G);function H(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g((n=>w(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(Y,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t})}function pe(e){return j(e)==null}const J=F((function(e,s){const t=w(e),p=t.remiSetupApproverViewUpdateData?.type??"approval_create",o=[],l={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o.push(r.id),l[r.id]=r.name);return{localData:t,approvalUpdateActionType:p,allVendorIds:o,vendorNamesById:l,editingRuleId:p==="approval_update"?s.approvalRuleId:void 0,allApprovalRulesWithUser:C(e).allApprovalRules}}),(function(e,s){const{navigate:t,approvalUpdateDataView:p,approverViewData:o,approvalRuleId:l}=s,r=p.remiSetupApproverViewUpdateData?.type,i=$(s.location);return{onApprovalRuleDataUpdated:a=>{const d=c=>{const m=[];return c.forEach((y=>{const S=y.actorKind?.selectedOption,U=y.selectedRole?.selectedOption;let D=[];S==="role"&&U!=null?D=[{type:"attribute",subType:U,userId:void 0,idType:void 0,isImplicitActor:!1}]:S==="specific_person"&&(D=(y.persons?.selectedUsers??[]).map((q=>({type:"user",subType:void 0,userId:q.userId,idType:"user",isImplicitActor:!1}))));const x=y.action??"require_approval";m.push({action:x,actors:D,operator:D.length>1?x==="require_approval"?"or":"and":"is"})})),m},n=a.amountCriteria,v=a.vendorCriteria,h=a.departmentCriteria,u={};if(n!=null&&n.comparator.selectedOption!=null){const c=n.comparator.selectedOption;u.amount={type:"amount",comparator:c,min:c==="less_than"?void 0:n.min,max:c==="greater_than"?void 0:n.max}}const R=v?.selection.selectedOptions??[];R.length>0&&(u.vendor={type:"vendor",operator:v?.operator.selectedOption??"is",vendorIds:R});const I=h?.selection.selectedOptions??[];if(I.length>0&&(u.department={type:"department",operator:h?.operator.selectedOption??"is",departmentIds:I}),r==="approval_create"){const c={name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}else{const c={approvalRuleId:l,name:a.name,description:a.description,separationOfDuties:a.separationOfDuties,isFallback:a.isFallback,criteria:u,steps:d(a.steps),isApplicableOnPendingApprovalEntity:a.applyToExistingReimbursements.includes("applyToExistingReimbursements")};e(E(c))}},onResetClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(A()),r==="approval_update"||i?t("../"):o.allApprovalRules.length===0&&o.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(B(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:a=>{e(Z(a)),t(r==="approval_update"?`../../${a}/edit`:`../${a}/edit`)}}}))(W);function ne(){const e=g((t=>z(t))),{isApprovalRulesV3Enabled:s}=K(e?.tenantId);return s?b.jsx(M,{}):b.jsx(H,{})}function M(){const e=_(),s=T(),t=O(),{approvalRuleId:p}=k(),o=P.getSignedInUser(),l=N(),r=g((n=>w(n))),i=g((n=>C(n))),[a,d]=f.useState(!1);if(X(),f.useEffect((()=>{a||(d(!0),s(V(!0)))})),f.useEffect((()=>{i.fetchState==="Not-Started"&&e(p!=null?"../../":"../")}),[i,p]),o==null)throw Error("Can't access address page without signing in...");return r.approversDetailsFetchStatus.fetchState=="Not-Started"||r.approversDetailsFetchStatus.fetchState==="In-Progress"?b.jsx(Q,{fetchState:r.approversDetailsFetchStatus.fetchState,style:{backgroundColor:l.colors.grey5}}):b.jsx(J,{navigate:e,approvalUpdateDataView:r,approvalRuleId:p,approverViewData:i,location:t},p??"new")}export{ne as R,pe as i,X as u};
|