@zeniai/web-app-ui 5.1.68-prod → 5.1.69-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/AddressRoutes-Ck8fazsz.js +1 -0
- package/dist/assets/AddressScreen-DvRag0Iy.js +9 -0
- package/dist/assets/AiCfoScreen-DvkdApRC.js +22 -0
- package/dist/assets/BillPayApprovalRoutes-CqQJw4lw.js +1 -0
- package/dist/assets/BillPayRoutes-D8C-y48D.js +119 -0
- package/dist/assets/BusinessVerificationPageScreen-uYl0dcg3.js +9 -0
- package/dist/assets/CardsAiCfoScreen-DcUjhcGf.js +14 -0
- package/dist/assets/ChargeCardRoutes-BgOM-913.js +71 -0
- package/dist/assets/CompanyPassportScreen-BxcaHIgB.js +1 -0
- package/dist/assets/ConnectionAuthScreen-FNB_rwVt.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-CLk0fM0D.js +1 -0
- package/dist/assets/CustomerOnboardingRoutes-Dn46PgZe.js +30 -0
- package/dist/assets/{DashboardRoutes-vIJdSKk_.js → DashboardRoutes-CnwmoBMp.js} +4 -4
- package/dist/assets/DefaultTenantHome-Ckc062A8.js +1 -0
- package/dist/assets/DomesticWireDetailScreen-4iiJOmgC.js +18 -0
- package/dist/assets/DrawerScreen-TcEyPR7p.js +1 -0
- package/dist/assets/EntityDetailRoutes-BBj_kLv_.js +1 -0
- package/dist/assets/ExpenseAutomationRoutes-Ch7zG-J6.js +25 -0
- package/dist/assets/FeaturePreviewScreen-BhjGS-SQ.js +1 -0
- package/dist/assets/HubSpotOAuthCallbackScreen-Cu-STjmq.js +1 -0
- package/dist/assets/MagicLinkRoutes-CJA2IXUt.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-C3h9fJcW.js +12 -0
- package/dist/assets/MobileAppDrawer-HA-p_xT8.js +1 -0
- package/dist/assets/NotFoundScreen-7PHlhgpl.js +1 -0
- package/dist/assets/NotificationRoutes-UcbK-fl3.js +1 -0
- package/dist/assets/OAuthConsentScreen-C4bO49C7.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-DlktfT1b.js +1 -0
- package/dist/assets/PeopleRoutes-BkMxdvGN.js +22 -0
- package/dist/assets/PerformanceRoutes-DdNjBQqZ.js +1 -0
- package/dist/assets/{Preview-Dd00Vauk.js → Preview-CdfrzFpw.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-C69S1kfR.js → QBOConnectionScreen-CXTeujVG.js} +1 -1
- package/dist/assets/ReferralListScreen-CqI5boW4.js +5 -0
- package/dist/assets/ReimbursementApprovalRoutes-Dc6sDYHg.js +1 -0
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-5Esp-U8d.js +1 -0
- package/dist/assets/ReimbursementRoutes-CY2961Fe.js +68 -0
- package/dist/assets/ReportsRoutes-TBXM2ZQz.js +1 -0
- package/dist/assets/RewardsRoutes-CJTn-EO0.js +1 -0
- package/dist/assets/ScreenRoutes-BUZ0lv1o.js +2 -0
- package/dist/assets/SettingsRoutes-BMZiR5Vc.js +57 -0
- package/dist/assets/SetupPagesScreen-bl00HfFv.js +29 -0
- package/dist/assets/SignInScreen-BTpF51PT.js +1 -0
- package/dist/assets/SignOutScreen-MOLzSBjw.js +9 -0
- package/dist/assets/TaskListScreen-JPdOOWog.js +9 -0
- package/dist/assets/TaskRoutes-Djcnjgw5.js +9 -0
- package/dist/assets/TransactionDetailRoutes-BMsCd19f.js +1 -0
- package/dist/assets/TransactionDetailScreen-gJw3WUvU.js +5 -0
- package/dist/assets/TransactionListRoutes-ChCk4hBF.js +1 -0
- package/dist/assets/TreasuryRoutes-Ca5BkVST.js +37 -0
- package/dist/assets/{VendorsRoutes-B9MImqe6.js → VendorsRoutes-CyltCiYJ.js} +27 -27
- package/dist/assets/WiseConfirmationScreen-DMpCKDJS.js +12 -0
- package/dist/assets/ZeniAccountRoutes-BEni5Y6L.js +73 -0
- package/dist/assets/ZeniAccountStatementScreen-B7-2zysu.js +9 -0
- package/dist/assets/{accountMappingHelper-CorikaeJ.js → accountMappingHelper-nbq0Igjm.js} +1 -1
- package/dist/assets/{analytics-DItVpuCN.js → analytics-CJCMq6iU.js} +1 -1
- package/dist/assets/{analyticsHelper-Cb7scIT3.js → analyticsHelper-CcuWk6YF.js} +1 -1
- package/dist/assets/{core-D90o6K56.js → core-Cup6-Vv9.js} +2 -2
- package/dist/assets/{decodeURIComponentSafe-Ch0XZCRj.js → decodeURIComponentSafe-iZg-IViz.js} +1 -1
- package/dist/assets/dnd-NJKg6PM2.js +6 -0
- package/dist/assets/{empty-BUizPF-k.js → empty--R5ATb9a.js} +1 -1
- package/dist/assets/{index-CSWifQ8Z.js → empty-B56moX_z.js} +1 -1
- package/dist/assets/{emptyVideoElement-CUPuy7M8.js → emptyVideoElement-D-3D8tLA.js} +1 -1
- package/dist/assets/epic-Bw1bCMfS.js +2 -0
- package/dist/assets/getLocaleForTenant-BdSj96xh.js +1 -0
- package/dist/assets/index-8T_1NsKH.js +1 -0
- package/dist/assets/{index-R6GjjTB3.css → index-BUmr5maU.css} +1 -1
- package/dist/assets/{index-CRRKLoHo.js → index-BhBAWR6y.js} +1 -1
- package/dist/assets/{index-pVuG8Ftc.js → index-C7fAoQyw.js} +2 -2
- package/dist/assets/{index-BN8lsC_I.js → index-DPagvN_p.js} +55662 -50234
- package/dist/assets/{index-BMXPsN-K.js → index-DeGiRmIJ.js} +1 -1
- package/dist/assets/{index-pSv0efcK.js → index-Dwio534G.js} +1 -1
- package/dist/assets/{index-B4mbYsbJ.js → index-Dz97gy5D.js} +1 -1
- package/dist/assets/index-l5qsYlva.js +1 -0
- package/dist/assets/{lexical-CQ_Cdd4O.js → lexical-enPzRBRr.js} +1 -1
- package/dist/assets/{liveblocks-DAtg1ZyW.js → liveblocks-CS5BWhh3.js} +1 -1
- package/dist/assets/{lottie-CBQUFB53.js → lottie-DdOZ7-9e.js} +1 -1
- package/dist/assets/{mui-DYsfVzoC.js → mui-LoCcantR.js} +1 -1
- package/dist/assets/{pathToGoBack-Bm4B97m6.js → pathToGoBack-Dpw-DHzI.js} +1 -1
- package/dist/assets/{pdf-BcZTHJ1d.js → pdf-BqUsw-Gt.js} +3 -3
- package/dist/assets/{pdf-lib-B41MruAW.js → pdf-lib-BWN6TH-_.js} +1 -1
- package/dist/assets/{plaid-BPB0PlNL.js → plaid-DFwM1Utp.js} +1 -1
- package/dist/assets/{pusher-xRMkASzr.js → pusher-C7ZzwBkC.js} +1 -1
- package/dist/assets/{react-CbVATQa6.js → react-B85XT5jF.js} +1 -1
- package/dist/assets/{react-Dsp4lPMR.js → react-BB2zmFDX.js} +1 -1
- package/dist/assets/{react-CdB7qqCl.js → react-Bf0iombK.js} +1 -1
- package/dist/assets/{react-Ci72Z4_L.js → react-CJc3cl_D.js} +1 -1
- package/dist/assets/{react-DVDtCQ5p.js → react-DTN_ojoh.js} +1 -1
- package/dist/assets/{react-oqOJixm2.js → react-Dg0-Ly9v.js} +1 -1
- package/dist/assets/{recharts-Gwm6yruK.js → recharts-Dle8N8vU.js} +3 -3
- package/dist/assets/{routePaths-CN8vWrRy.js → routePaths-Dj0dWV1_.js} +1 -1
- package/dist/assets/{sentry-DZ8HzecE.js → sentry-C6Nz2b7l.js} +1 -1
- package/dist/assets/{url-egLjgb-q.js → url-Cn3jej7I.js} +1 -1
- package/dist/assets/{url-CXeUYgrQ.js → url-ZNKVFdHA.js} +1 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-D1kdP7ef.js +1 -0
- package/dist/assets/{useAskAiCfoHostNavButtonProps-BNHDQzq8.js → useAskAiCfoHostNavButtonProps-CN1jthh8.js} +1 -1
- package/dist/assets/useCashManagementBanner-B23nv_5L.js +1 -0
- package/dist/assets/useChargeCardPusherEvents-DpdbIGk0.js +1 -0
- package/dist/assets/{useDeviceId-Dhn0qLXr.js → useDeviceId-BABI5Pfv.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-DldO7YBc.js +1 -0
- package/dist/assets/useInitialThreadRequest-0lzTunrY.js +1 -0
- package/dist/assets/{utils-Chb8u76V.js → utils-CSqwFRZv.js} +2 -2
- package/dist/assets/withTransactionSidePanel-BWGcFSxf.js +21 -0
- package/dist/assets/zeni-epic-state-CjyX3VL3.js +13 -0
- package/dist/index.html +1 -1
- package/package.json +4 -4
- package/dist/assets/AddressRoutes-2_73Nhbe.js +0 -1
- package/dist/assets/AddressScreen-sEWDSVVU.js +0 -9
- package/dist/assets/AiCfoScreen-B6JjDtD3.js +0 -22
- package/dist/assets/BillPayApprovalRoutes-BzfQ4vAL.js +0 -1
- package/dist/assets/BillPayRoutes-CP7dw1y0.js +0 -119
- package/dist/assets/BusinessVerificationPageScreen-Dc3fLrbz.js +0 -9
- package/dist/assets/ChargeCardRoutes-ConMcpwZ.js +0 -71
- package/dist/assets/CompanyPassportScreen-BxAxCrb_.js +0 -1
- package/dist/assets/ConnectionAuthScreen-DID5ahc0.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-DPbl_0Vg.js +0 -1
- package/dist/assets/CustomerOnboardingRoutes-chdbAzd1.js +0 -23
- package/dist/assets/DefaultTenantHome-B89Crbdz.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DmA3mjjj.js +0 -18
- package/dist/assets/DrawerScreen-BVjL5ln9.js +0 -1
- package/dist/assets/EntityDetailRoutes-DRqXhYOy.js +0 -1
- package/dist/assets/ExpenseAutomationRoutes-BmNIZImC.js +0 -25
- package/dist/assets/FeaturePreviewScreen-DxZ_Fznj.js +0 -1
- package/dist/assets/HubSpotOAuthCallbackScreen-D43wj7uz.js +0 -1
- package/dist/assets/MagicLinkRoutes-DL2yPviw.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-DO9dzgaq.js +0 -12
- package/dist/assets/MobileAppDrawer-CTXIk3hR.js +0 -1
- package/dist/assets/NotFoundScreen-BJjKnw8O.js +0 -1
- package/dist/assets/NotificationRoutes-EnjCJjkk.js +0 -1
- package/dist/assets/OAuthConsentScreen-Cea0MXSn.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-CIdUBqs-.js +0 -1
- package/dist/assets/PeopleRoutes-DX_c5wKg.js +0 -22
- package/dist/assets/PerformanceRoutes-BMfW_gI6.js +0 -1
- package/dist/assets/ReferralListScreen-CNxkfy6T.js +0 -5
- package/dist/assets/ReimbursementApprovalRoutes-DNhlyNjh.js +0 -1
- package/dist/assets/ReimbursementApprovalRuleDetailScreen-zR_iLP0K.js +0 -1
- package/dist/assets/ReimbursementRoutes-CoFukhlR.js +0 -68
- package/dist/assets/ReportsRoutes-DrTh72ih.js +0 -1
- package/dist/assets/RewardsRoutes-micvXieM.js +0 -1
- package/dist/assets/ScreenRoutes-XTRV2aNW.js +0 -2
- package/dist/assets/SettingsRoutes-DxnGzLG7.js +0 -57
- package/dist/assets/SetupPagesScreen-DvTV7fNO.js +0 -29
- package/dist/assets/SignInScreen-BzTN6Vyt.js +0 -1
- package/dist/assets/SignOutScreen-gCdCpUSd.js +0 -9
- package/dist/assets/TaskListScreen-C1equT3x.js +0 -9
- package/dist/assets/TaskRoutes-BZ-DdVlU.js +0 -9
- package/dist/assets/TransactionDetailRoutes-9HFA0cp7.js +0 -1
- package/dist/assets/TransactionDetailScreen-Dl7O1rhZ.js +0 -5
- package/dist/assets/TransactionListRoutes-CIKy0UJt.js +0 -1
- package/dist/assets/TreasuryRoutes-D5Eg-_eC.js +0 -37
- package/dist/assets/WiseConfirmationScreen-D5AIA4g7.js +0 -12
- package/dist/assets/ZeniAccountRoutes-f8D3wqPQ.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-z1-bTO4s.js +0 -9
- package/dist/assets/dnd-ChHvtYg5.js +0 -6
- package/dist/assets/empty-BZWUcTDB.js +0 -1
- package/dist/assets/epic-DZ6uYuno.js +0 -2
- package/dist/assets/getLocaleForTenant-BB_-fahl.js +0 -1
- package/dist/assets/index-y5L6ZLZX.js +0 -1
- package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-nwZiGSy7.js +0 -1
- package/dist/assets/useInitialThreadRequest-b_H5FqBu.js +0 -1
- package/dist/assets/withTransactionSidePanel-CO1OQsG9.js +0 -21
- package/dist/assets/zeni-epic-state-D1WNQbgv.js +0 -13
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as e}from"./liveblocks-CS5BWhh3.js";import{A as d}from"./AddressScreen-DvRag0Iy.js";import i from"./NotFoundScreen-7PHlhgpl.js";import"./sentry-C6Nz2b7l.js";import{o as s,p as r}from"./core-Cup6-Vv9.js";import"./zeni-epic-state-CjyX3VL3.js";import"./recharts-Dle8N8vU.js";import"./index-DPagvN_p.js";import"./mui-LoCcantR.js";import"./analytics-CJCMq6iU.js";import"./plaid-DFwM1Utp.js";import"./dnd-NJKg6PM2.js";import"./stripe-DMRn4zHo.js";import"./lottie-DdOZ7-9e.js";import"./lexical-enPzRBRr.js";import"./pdf-BqUsw-Gt.js";import"./utils-CSqwFRZv.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new t.Error().stack;o&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[o]="cd0ff2b4-1e27-4329-addf-f475e5a9db34",t._sentryDebugIdIdentifier="sentry-dbid-cd0ff2b4-1e27-4329-addf-f475e5a9db34")}catch{}})();function _(){return e.jsxs(s,{children:[e.jsx(r,{path:"/edit/:addressType/:addressId",element:e.jsx(d,{})}),e.jsx(r,{path:"/new/:addressType",element:e.jsx(d,{})}),e.jsx(r,{path:"*",element:e.jsx(i,{})})]})}export{_ as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as r}from"./liveblocks-CS5BWhh3.js";import{a as h}from"./sentry-C6Nz2b7l.js";import{h as P,u as _,g as M,i as j,j as E,n as B}from"./core-Cup6-Vv9.js";import{Z as $,m as D,z as L,T as K,B as R,Y as U,d as C,f as S,R as z,k as b,q as F}from"./index-DPagvN_p.js";import{MH as I,hU as q,eW as G,MI as H,c6 as N,MJ as O,ld as V}from"./zeni-epic-state-CjyX3VL3.js";import{n as J}from"./mui-LoCcantR.js";import W from"./NotFoundScreen-7PHlhgpl.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]="ed4fc2b7-96d2-45c3-9363-5a61c280398b",e._sentryDebugIdIdentifier="sentry-dbid-ed4fc2b7-96d2-45c3-9363-5a61c280398b")}catch{}})();const Y=J.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
height: 100vh;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
9
|
+
`,Z=B(function(e,t){const{addressId:o,isSubPage:i,addressType:c}=t,l=G(e),a=t.roleMap!=null&&H(t.roleMap),d=i||c==="user_address"||N(l?.userRole??[])||a?void 0:"readonly";if(o==null){const s=O(c,e);return{addressToEdit:s?.addressToCreate,loadingState:s?.status?.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d,isSubPage:i,dontShowSaveConfirmationPopup:t.dontShowSaveConfirmation}}const n=I(e,o);return{addressToEdit:n.address,loadingState:n.fetchState,googleAPIKey:b.googleMapsAPIKey,isDisabled:d}},function(e,t){const{navigate:o,location:i,addressType:c}=t,l=a=>{if(a==="express-pay")o("../express-pay/add-wire");else{const d=i.state,n=F(d?.pathnameStackToGoBack);let s=n.poppedPathname??k();const u=d?.queryParams;if(u){const g=new URLSearchParams(u).toString();g&&(s=`${s}?${g}`)}o(s,{state:{pathnameStackToGoBack:n.newStack}})}};return{onSubmitHandler:a=>{const d=Q(a);e(V({addressType:c,addressToCreate:d})),C?.trackSaveAddressClicked(S.Event.saveAddressClicked,{street:a.street.addressString,city:a.city,state:a.state,country:a.country.selectedOption??"",postalCode:a.postalCode,suite:a.suite,secondaryInfo:a.secondaryInfo}),l(t.bankAccountContext)},onCancel:()=>{l(t.bankAccountContext)}}})(z);function re({isSubPage:e,hideAddressSubTitle:t=!1,hideAddressBackButton:o=!1,dontShowSaveConfirmation:i,accountContext:c,addressTypeParam:l}){const a=P(),d=_(),n=M(),{addressId:s,addressType:u}=j(),g=$(),w=D(),v=L.getSignedInUser(),[f,x]=h.useState(s==null),p=E(m=>s!=null?I(m,s).fetchState:"Not-Started"),A=K();if(v==null)throw Error("Can't access address page without signing in...");const T=m=>m.trackPageLoaded(s!=null?S.Event.editAddress:S.Event.addAddress),y=l??u;return h.useEffect(()=>{f||s==null||(x(!0),d(q(s,!1)))},[f,s,d]),y==null||y.match(/(user_address|company_address|company_registered_address|vendor_address|officer_([1-9]|10)_address)$/g)?!f&&p==="Not-Started"||f&&p==="In-Progress"?r.jsx(R,{fetchState:p,style:{backgroundColor:w.colors.grey5}}):s!=null&&p==="Error"?(a(`${k(1)}/new`,{replace:!0}),r.jsx(r.Fragment,{})):r.jsxs(r.Fragment,{children:[r.jsx(U,{analytics:C,onLoad:T}),r.jsx(Y,{windowSize:g,children:r.jsx(Z,{location:n,navigate:a,isSubPage:e===!0,hideAddressBackButton:o,hideAddressSubTitle:t,addressId:s,addressType:y,dontShowSaveConfirmation:i,bankAccountContext:c,roleMap:A?.loggedInUserRoleMap})})]}):r.jsx(W,{})}const k=(e=2)=>{let t="../";for(let o=0;o<e;o++)t=`${t}../`;return t},Q=e=>({street:[e.street.addressString,e.suite,e.secondaryInfo],city:e.city,state:e.state,country:e.country.selectedOption??"",countryCode:e.countryCode,postalCode:e.postalCode,latitude:e.street.addressValue?.locationLat,longitude:e.street.addressValue?.locationLng});export{re as A,Q as t};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import{j as c}from"./liveblocks-CS5BWhh3.js";import{a as r}from"./sentry-C6Nz2b7l.js";import{u as we,h as xe,g as Pe,j as Z,i as ye,n as Ee}from"./core-Cup6-Vv9.js";import{M as Te,db as ve,z as Ae,Z as Qe,dc as _e,dd as Oe,ba as J,de as ae,df as Ue,b9 as se,q as V,Y as B,d as I,dg as M,dh as je,di as Le,a1 as Fe,f as De,a7 as Be,dj as Me,dk as Re,a2 as Ve,dl as $e,dm as Ge,dn as qe,r as Ne,b5 as We,dp as ze}from"./index-DPagvN_p.js";import{gl as He,eV as oe,eW as Ye,iA as Ke,TT as Xe,fp as Ze,iK as Je,iG as et,eX as R,fw as tt,g6 as at,f$ as st,g3 as ee,g7 as ot,g8 as nt,g9 as it,ga as rt,gb as lt}from"./zeni-epic-state-CjyX3VL3.js";import{D as dt,n as k,S as ct,P as ut}from"./mui-LoCcantR.js";import{u as mt}from"./useAiCfoDashboardSuggestedQuestionsChips-D1kdP7ef.js";import{p as pt}from"./pathToGoBack-Dpw-DHzI.js";import"./recharts-Dle8N8vU.js";import"./analytics-CJCMq6iU.js";import"./plaid-DFwM1Utp.js";import"./dnd-NJKg6PM2.js";import"./stripe-DMRn4zHo.js";import"./lottie-DdOZ7-9e.js";import"./lexical-enPzRBRr.js";import"./pdf-BqUsw-Gt.js";import"./utils-CSqwFRZv.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]="8aca86dc-eec5-4c9c-ad3a-87cceee61787",e._sentryDebugIdIdentifier="sentry-dbid-8aca86dc-eec5-4c9c-ad3a-87cceee61787")}catch{}})();const ne="chat-response-generated",ht=Ee(function(e,o){const t=oe(e),u=o.isSubmitting,a=t.uiState?.currentChatSessionId,h=a!=null?tt(e.aiCfoState,a):[],S=Re(e,{allUsers:o.allUsers,onCardPolicyVendorSearchTextChange:o.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:o.sessionFromUrl==="explore"&&t.uiState.currentChatSessionId==null,aiCfoView:t,isSubmitting:u,isNewChatSession:o.sessionFromUrl==="new_chat"||o.sessionFromUrl==="explore",isFullView:!0,tableDownloadEndPoint:`${Ve}/tableDownload`,emailLinkQuestion:o.emailLinkQuestion,autoSubmitEmailLinkQuestion:o.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:o.onEmailLinkQuestionProcessed,routedInitialQuestionSource:o.routedInitialQuestionSource,routedInitialQuestionSuggestionIndex:o.routedInitialQuestionSuggestionIndex,exploreSuggestedPromptQuestions:o.exploreSuggestedPromptQuestions,exploreSuggestedPromptQuestionsLoading:o.exploreSuggestedPromptQuestionsLoading,isFileUploadEnabled:o.isFileUploadEnabled,isUploadPromoVisible:o.isUploadPromoVisible,onUploadPromoClose:o.onUploadPromoClose,syntheticAnswers:h,resolveSyntheticAnswerCardTile:Ge(e),resolveSyntheticAnswerPolicyTile:$e(e),...S}},function(e,o){const{location:t,currentTenant:u,userId:a,navigate:h,currentChatSessionId:S,allSessionsWithOrderedQuestionAnswers:w,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,setIsAiCfoOpen:b}=o,m=u.tenantEmailDomain;return{onEventReceived:(s,l)=>{if(s===ne&&typeof l.text=="string"&&typeof l.metadata=="object"){const d=l,g=nt(d.type),p=d.metadata.chat_session_id??null,{currentChatSession:n,currentQuestionAnswer:x,currentQuestionAnswerSummary:A}=se(w,p);g!=="answer"?I.trackAICFOChatResponseGenerated(g,x?.question.questionText??"",d.text,p,ze(A,n),d.metadata.message_id??null):I.trackAICFOChatAnswerGenerated(d.text,x?.question.questionText??"",(d.follow_up_questions?.length??0)>0,!!d.assumptions,!!d.insights,d.visualization!=null,it(d.visualization?.type??"")??null,p,d.summarized_title,d.metadata.message_id??null),e(rt({chatSessionId:d.metadata.chat_session_id,responseType:g,fetchState:{fetchState:"Completed",error:void 0}})),e(lt({chatSessionId:d.metadata.chat_session_id,answerPayload:d,userId:a}))}},onSubmit:(s,l,d,g)=>{s&&We(e,s,l,S,w,a,g,d)},updateCurrentInput:s=>{e(ee(s))},onStopSubmit:()=>{},onUpdateScrollYOffset:s=>{e(ot(s))},onSelectSampleQuestion:()=>{},onBackClick:()=>{h(-1)},onCloseClick:()=>{const s=V(t.state?.pathnameStackToGoBack),l=s.poppedPathname??pt(1);h(l,{state:{...t.state,pathnameStackToGoBack:s.newStack}}),e(ee(""))},togglePageView:()=>{const s=V(t.state?.pathnameStackToGoBack),l=s.poppedPathname??`/${u.tenantEmailDomain}/dashboard`;h(l,{state:{...ae(t.state),pathnameStackToGoBack:s.newStack,message:"open_ai_cfo_drawer"}}),b(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{h(-1)},onNewChatClick:()=>{S!=null&&e(st());const s=Ne(t.state?.pathnameStackToGoBack,t.pathname);h(`/${u.tenantEmailDomain}/ai-cfo/new_chat`,{state:{pathnameStackToGoBack:s.slice(0,-1),referrer:"Sidebar"}})},onToggleCotCollapsed:(s,l)=>{e(at({questionAnswerId:s,isCollapsed:l}))},onMenuClick:o.onMenuClick,...qe(e,{isAiCardCreationEnabled:T,isCardPolicyEnabled:v,currentChatSessionId:S,onAfterCardsCreationSubmit:()=>{b(!0),h(`/${m}/cards`,{state:{...t.state}})},onAfterCardPolicySubmit:()=>{b(!0),h(`/${m}/cards/policy`,{state:{...t.state}})}})}})(Be(Me)),Ft=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:o}=Te(),t=we(),u=xe(),a=Pe(),[h,S]=r.useState(!1),{allUsers:w,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,onCardPolicyVendorSearchTextChange:b}=ve();r.useEffect(()=>{t(He())},[t]);const m=Z(i=>oe(i)),s=Ae.getSignedInUser(),{session_id:l}=ye(),d=Qe(),g=Fe(d),p=Z(i=>Ye(i)),n=m.uiState.currentChatSessionId,x=p.tenantEmailDomain,{handleUploadPromoClose:A,isUploadPromoVisible:ie}=_e({isFileUploadEnabled:e,tenantEmailDomain:x}),Q=Oe({currentTenant:p,currentChatSessionId:n,aiCfoView:m}),{isSuggestedQuestionsLoading:re,suggestedPromptQuestions:le}=mt(),P=a.state,y=P?.aiCfoInitialQuestion,$=!!P?.aiCfoShouldSubmit;r.useEffect(()=>{const i=a.state;if(i?.[J]!==!0)return;S(!0);const f={...i};delete f[J],u(a,{replace:!0,state:f})},[a.pathname,a.search,a.state,u]);const[de,_]=r.useState(null),[ce,O]=r.useState(!1),[ue,U]=r.useState(void 0),[me,j]=r.useState(void 0),G=r.useRef(!1);r.useEffect(()=>{if(!G.current&&y!=null&&y!==""){const i=a.state;_(y),O($),U(i?.aiCfoInitialSubmissionSource!=null?i.aiCfoInitialSubmissionSource:void 0);const f=i?.aiCfoSuggestionIndex;j(typeof f=="number"?f:void 0),G.current=!0}},[y,$,a.state]);const pe=r.useCallback(()=>{_(null),O(!1),U(void 0),j(void 0),u(a.pathname,{replace:!0,state:ae(a.state)})},[a.pathname,a.state,u]),q=r.useMemo(()=>new URLSearchParams(a.search),[a.search]),N=q.get("ref")??P?.aiCfoRef,L=q.get("emailRefId")??P?.aiCfoEmailRefId,W=r.useRef(!1);r.useEffect(()=>{W.current||N!=="month-end-email"||L==null||n!=null||s==null||(t(Ke("controller",s.userId,L,"MONTH_END_EMAIL")),W.current=!0)},[N,L,n,t,s]);const E=m.uiState.lastContextMessage;r.useEffect(()=>{E!=null&&E!==""&&n!=null&&(_(E),O(!0),U(void 0),j(void 0),t(Xe()))},[E,n,t]);const he=p.masterTOSInfo,C=he?.isMasterTOSAccepted??!1,{visitedSessions:z}=Ue(n),F=m.fetchState,D=m.uiState.chatSessionsNextPageToken.hasMore||!m.uiState.chatSessionsFirstPageFetched,H=n!=null?m.fetchChatSessionHistoryByChatSessionId?.[n]?.fetchState??"Not-Started":"Not-Started",Y=n==null||(m.uiState.chatHistoryNextPageToken[n]?.hasMore??!0),K=m.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:Se}=se(K,n),ge=Se.length===0;r.useEffect(()=>{C||g||u("../dashboard",{state:{...a.state,message:"open_ai_cfo_drawer"}})},[C,g,u,a.state]);const fe=r.useCallback(()=>{const i=V(a.state?.pathnameStackToGoBack),f=p.tenantEmailDomain;u(i.poppedPathname??(f!=null?`/${f}/dashboard`:".."),{state:{...a.state,pathnameStackToGoBack:i.newStack}})},[p.tenantEmailDomain,a.state,u]);r.useEffect(()=>{n!=null&&l!==n&&u(`../ai-cfo/${n}`,{state:{...a.state}})},[n,l]),r.useEffect(()=>{l!=null&&n==null&&l!=="new_chat"&&l!=="explore"&&t(Ze({sessionId:l,agentId:"controller"}))},[]);const Ce=r.useMemo(()=>({events:z.map(i=>`private-encrypted-chat-${i}.${ne}`),eventCallback:(i,f,ke)=>ke.onEventReceived(i,f)}),[z]);r.useEffect(()=>{F!=="In-Progress"&&D&&t(Je())},[F,D,t]),r.useEffect(()=>{n!=null&&H!=="In-Progress"&&Y&&s!=null&&F==="Completed"&&!D&&t(et(n,s.userId))},[H,Y,n,s,t]);const X=i=>i.trackAICFOOnboardingScreenStateChanged("open","first_visit");if(s==null||l==null)throw Error("Can't access AI Controller page without signing in...");const be=n!=null&&m.responseStateByChatSessionId?.[n]?.answer?.fetchState==="In-Progress";if(!C&&g)return c.jsxs(gt,{children:[c.jsx(B,{analytics:I,onLoad:X}),Q.drawerElement,c.jsx(ft,{children:c.jsx(te,{children:c.jsx(M,{isTOSAccepted:!1,acceptMasterTOSState:m.masterTOSAcceptanceState,onCloseClick:fe,onCompleteClick:()=>{p.userRoleId!=null&&t(R(p.userRoleId))}})})})]});const Ie=c.jsxs(c.Fragment,{children:[h&&!C?c.jsx(B,{analytics:I,onLoad:X}):null,c.jsx(M,{isTOSAccepted:C,acceptMasterTOSState:m.masterTOSAcceptanceState,showHeader:!1,togglePageView:C?()=>S(!1):void 0,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||p.userRoleId==null||t(R(p.userRoleId)),S(!1)}})]});return c.jsxs(c.Fragment,{children:[c.jsxs(St,{children:[c.jsx(B,{analytics:I,onLoad:i=>i.trackPageLoaded(De.Event.aiCFOPage)}),g&&Q.drawerElement,c.jsx(ht,{...Ce,currentChatSessionId:n,allSessionsWithOrderedQuestionAnswers:K,allUsers:w,isAiCardCreationEnabled:T,isCardPolicyEnabled:v,openOnboardingPage:()=>S(!0),userId:s.userId,setIsAiCfoOpen:o,navigate:u,sessionFromUrl:l,location:a,isSubmitting:be,isEmptyChatWithSession:ge,currentTenant:p,emailLinkQuestion:de??void 0,autoSubmitEmailLinkQuestion:ce,onEmailLinkQuestionProcessed:pe,routedInitialQuestionSource:ue,routedInitialQuestionSuggestionIndex:me,onCardPolicyVendorSearchTextChange:b,onMenuClick:g?Q.open:void 0,isFileUploadEnabled:e,isUploadPromoVisible:ie,onUploadPromoClose:A,exploreSuggestedPromptQuestions:le,exploreSuggestedPromptQuestionsLoading:re}),h&&g?c.jsx(dt,{anchor:"right",open:h,transitionDuration:250,PaperProps:{component:Ct,style:{width:"100%"}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>S(!1),children:c.jsx(te,{onClick:i=>i.stopPropagation(),children:c.jsx(M,{isTOSAccepted:C,acceptMasterTOSState:m.masterTOSAcceptanceState,onCloseClick:()=>S(!1),onCompleteClick:()=>{C||p.userRoleId==null||t(R(p.userRoleId)),S(!1)}})})}):null]}),h&&!g?c.jsx(je,{open:h,onClose:()=>S(!1),children:c.jsx(Le,{children:Ie})}):null]})},te=k(ct)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,St=k.div`
|
|
6
|
+
height: 100vh;
|
|
7
|
+
width: 100%;
|
|
8
|
+
`,gt=k.div`
|
|
9
|
+
height: 100vh;
|
|
10
|
+
width: 100%;
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
min-height: 0;
|
|
14
|
+
`,ft=k.div`
|
|
15
|
+
flex: 1;
|
|
16
|
+
min-height: 0;
|
|
17
|
+
display: flex;
|
|
18
|
+
flex-direction: column;
|
|
19
|
+
`,Ct=k(ut)`
|
|
20
|
+
box-shadow: ${({theme:e})=>e.colors.elevation2};
|
|
21
|
+
color: ${({theme:e})=>e.colors.grey4};
|
|
22
|
+
`;export{Ft as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as c}from"./liveblocks-CS5BWhh3.js";import{a as v}from"./sentry-C6Nz2b7l.js";import{h as U,g as B,u as j,j as y,N as z,n as P,i as W,o as te,p as x}from"./core-Cup6-Vv9.js";import{eW as k,Q5 as A,PN as h,zp as E,zh as q,zl as R,za as K,PP as M,zr as ae,zd as Q,zu as G,zq as C}from"./zeni-epic-state-CjyX3VL3.js";import{z as V,a7 as H,bM as oe,af as O,bD as J,bN as le,m as X,B as Y,bO as pe,bP as se}from"./index-DPagvN_p.js";import"./mui-LoCcantR.js";import{u as Z,i as ne}from"./ReimbursementApprovalRuleDetailScreen-5Esp-U8d.js";import re from"./NotFoundScreen-7PHlhgpl.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},p=new e.Error().stack;p&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[p]="2cd06c90-de2a-4c52-8f1a-94d4e97ef1e5",e._sentryDebugIdIdentifier="sentry-dbid-2cd06c90-de2a-4c52-8f1a-94d4e97ef1e5")}catch{}})();const T="bill-approval-rule-update",ie=P(function(e){return{approvalView:A(e),billPaySetupApproverViewUpdateData:h(e).billPaySetupApproverViewUpdateData}},function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(T)&&e(M(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!1))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))}}})(H(oe)),ce=({isLoading:e})=>{const p=U(),t=B(),o=j(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y(s=>s.billPaySetupApproverViewState.fetchState),u=y(s=>k(s)),i=y(s=>A(s)),f=y(s=>h(s).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&o(E())},[f]),v.useEffect(()=>{a||l!=="Not-Started"||e||(r(!0),o(q(!0,!0,!1)))},[a,l,e,o]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))},[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${T}`]:[],eventCallback:(s,w,S)=>{s.endsWith(T)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(z,{to:"../../promo"}):c.jsx(ie,{currentTenant:u,location:t,navigate:p,...m})},_="bill-approval-rule-update",ue=P(function(e){const p=A(e),t=h(e).billPaySetupApproverViewUpdateData,o={};for(const r of Object.values(e.vendorState.vendorByID))r?.id!=null&&(o[r.id]=r.name);const a={};for(const r of Object.values(e.classState.classesByKey))r?.classId!=null&&(a[r.classId]=r.className);return{approvalView:p,billPaySetupApproverViewUpdateData:t,vendorNamesById:o,departmentNamesById:a}},function(e,p){const{navigate:t,location:o}=p;return{onApprovalRulesEventReceived:a=>{a.endsWith(_)&&e(M(!1))},onBackClick:()=>{O(o)?t("../../"):t("../../../bills/setup")},onDeleteRuleClick:a=>{e(K(a,!0))},onEditRuleClick:a=>{a!=null?(e(R(a)),t(`./${a}/edit`)):(e(R()),t("./new"))},onReorderRules:a=>{e(ae(a,!0))}}})(H(le)),de=()=>{const e=y(o=>k(o)),{isApprovalRulesV3Enabled:p,isLoading:t}=J(e?.tenantId);return p?c.jsx(ve,{isLoading:t}):c.jsx(ce,{isLoading:t})},ve=({isLoading:e})=>{const p=U(),t=B(),o=j(),[a,r]=v.useState(!1),[n,d]=v.useState(!1),l=y(s=>s.billPaySetupApproverViewState.fetchState),u=y(s=>k(s));Z();const i=y(s=>A(s)),f=y(s=>h(s).billPaySetupApproverViewUpdateData);if(v.useEffect(()=>{f?.updateStatus.fetchState==="Completed"&&o(E())},[f]),v.useEffect(()=>{a||l!=="Not-Started"||e||(r(!0),o(q(!0,!0,!0)))},[a,l,e,o]),V.getSignedInUser()==null)throw Error("Can't access billpay approval without signing in...");v.useEffect(()=>{i.allApprovalRules.length===0&&i.fetchState==="Completed"&&(n||(d(!0),o(R())),p("./new"))},[n,i,o]);const m={events:u.companyId!=null?[`private-encrypted-${u.companyId}.${_}`]:[],eventCallback:(s,w,S)=>{s.endsWith(_)&&S.onApprovalRulesEventReceived(s)}};return u?.companyBillPayInfo?.info?.isBillPayTOSAccepted===!1?c.jsx(z,{to:"../../promo"}):c.jsx(ue,{currentTenant:u,location:t,navigate:p,isLoading:e,...m})},fe=P(function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=o==="approval_create"&&t.allApprovalRules.length!==0;let r=t.allApprovalRules.length===0;return p.approvalRuleId&&(r=t.allApprovalRules.findIndex(n=>n.approvalRuleId===p.approvalRuleId)===0),{localData:t,hideUpperBoundField:a,isLowerBoundDisabled:r,approvalUpdateActionType:o}},function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=O(p.location);return{onApprovalRuleDataUpdated:l=>{const u=f=>{const m=[];return f.forEach(s=>{const w=s.actors.selectedUsers.map(b=>({type:"user",userId:b.userId,isImplicitActor:!1})),S=s.actors.selectedNonUsers.map(b=>{const I=!!ne(b.value);return{type:I?"attribute":"role",subType:b.value,userId:void 0,idType:void 0,isImplicitActor:!I}}),g=w.concat(S);m.push({action:s.stepType.selectedOption,actors:g,operator:g.length>1?s.stepType.selectedOption==="require_approval"?"or":"and":"is"})}),m},i={amount:{type:"amount",comparator:"range",min:{amount:l.lowerBound,currencyCode:"USD",currencySymbol:"$"},max:{amount:l.upperBound,currencyCode:"USD",currencySymbol:"$"}}};if(n==="approval_create"){const f={criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}else{const f={approvalRuleId:r,criteria:i,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(f))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G(!1))},onSaveRuleSuccess:()=>{t("../")}}})(pe);function ye(){const e=U(),p=j(),t=B(),{approvalRuleId:o}=W(),a=V.getSignedInUser(),r=X(),n=y(i=>h(i)),d=y(i=>A(i)),[l,u]=v.useState(!1);if(v.useEffect(()=>{l||(u(!0),p(Q(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")},[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(Y,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(fe,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t})}const ge=P(function(e,p){const t=h(e),o=t.billPaySetupApproverViewUpdateData?.type??"approval_create",a=[],r={};for(const n of Object.values(e.vendorState.vendorByID))n?.id!=null&&(a.push(n.id),r[n.id]=n.name);return{localData:t,approvalUpdateActionType:o,allVendorIds:a,vendorNamesById:r,editingRuleId:o==="approval_update"?p.approvalRuleId:void 0,allApprovalRulesWithUser:A(e).allApprovalRules}},function(e,p){const{navigate:t,approvalUpdateDataView:o,approverViewData:a,approvalRuleId:r}=p,n=o.billPaySetupApproverViewUpdateData?.type,d=O(p.location);return{onApprovalRuleDataUpdated:l=>{const u=g=>{const b=[];return g.forEach(I=>{const N=I.actorKind?.selectedOption,L=I.selectedRole?.selectedOption;let D=[];N==="role"&&L!=null?D=[{type:"attribute",subType:L,userId:void 0,idType:void 0,isImplicitActor:!1}]:N==="specific_person"&&(D=(I.persons?.selectedUsers??[]).map(ee=>({type:"user",userId:ee.userId,isImplicitActor:!1})));const F=I.action??"require_approval";b.push({action:F,actors:D,operator:D.length>1?F==="require_approval"?"or":"and":"is"})}),b},i=l.amountCriteria,f=l.vendorCriteria,m=l.departmentCriteria,s={};if(i!=null&&i.comparator.selectedOption!=null){const g=i.comparator.selectedOption;s.amount={type:"amount",comparator:g,min:g==="less_than"?void 0:i.min,max:g==="greater_than"?void 0:i.max}}const w=f?.selection.selectedOptions??[];w.length>0&&(s.vendor={type:"vendor",operator:f?.operator.selectedOption??"is",vendorIds:w});const S=m?.selection.selectedOptions??[];if(S.length>0&&(s.department={type:"department",operator:m?.operator.selectedOption??"is",departmentIds:S}),n==="approval_create"){const g={name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}else{const g={approvalRuleId:r,name:l.name,description:l.description,separationOfDuties:l.separationOfDuties,isFallback:l.isFallback,criteria:s,steps:u(l.steps),isApplicableOnPendingApprovalEntity:l.applyToExistingBills.includes("applyToExistingBills")};e(C(g))}},onResetClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onBackClick:()=>{e(E()),n==="approval_update"||d?t("../"):a.allApprovalRules.length===0&&a.fetchState==="Completed"?t("../../setup"):t("../")},onSaveRuleClick:()=>{e(G(!0))},onSaveRuleSuccess:()=>{t("../")},onEditExistingRule:l=>{e(R(l)),t(n==="approval_update"?`../../${l}/edit`:`../${l}/edit`)}}})(se);function $(){const e=y(t=>k(t)),{isApprovalRulesV3Enabled:p}=J(e?.tenantId);return p?c.jsx(me,{}):c.jsx(ye,{})}function me(){const e=U(),p=j(),t=B(),{approvalRuleId:o}=W(),a=V.getSignedInUser(),r=X(),n=y(i=>h(i)),d=y(i=>A(i)),[l,u]=v.useState(!1);if(Z(),v.useEffect(()=>{l||(u(!0),p(Q(!0)))}),v.useEffect(()=>{d.fetchState==="Not-Started"&&e(o!=null?"../../":"../")},[d,o]),a==null)throw Error("Can't access address page without signing in...");return n.approverListFetchStatus.fetchState=="Not-Started"||n.approverListFetchStatus.fetchState==="In-Progress"?c.jsx(Y,{fetchState:n.approverListFetchStatus.fetchState,style:{backgroundColor:r.colors.grey5}}):c.jsx(ge,{navigate:e,approvalUpdateDataView:n,approvalRuleId:o,approverViewData:d,location:t},o??"new")}function De(){return c.jsxs(te,{children:[c.jsx(x,{path:"/",element:c.jsx(de,{})}),c.jsx(x,{path:"/new",element:c.jsx($,{})}),c.jsx(x,{path:"/:approvalRuleId/edit",element:c.jsx($,{})}),c.jsx(x,{path:"*",element:c.jsx(re,{})})]})}export{De as B};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-CS5BWhh3.js";import{h as K,u as se,g as Y,i as ae,j as k,N as te,n as J,l as na,o as ia,p as S}from"./core-Cup6-Vv9.js";import{eW as Z,Pn as _e,bs as It,Kc as oa,bq as wt,bJ as pe,Po as At,yH as Ct,zW as $e,ze as la,bn as De,Pp as sa,Pq as ra,c6 as ca,Pr as da,kx as Bt,Ps as xt,Pt as Et,Av as Ge,yW as Be,Pu as ua,yv as tt,Pv as pa,EA as ma,yz as ba,yF as Dt,Pw as ve,Px as Me,zX as Oe,Py as ha,Pz as ga,z_ as Ne,PA as ya,Ab as Sa,PB as Pt,zH as at,zM as fa,PC as va,PD as ue,PE as jt,PF as Tt,PG as Ft,gp as ka,y$ as Le,cA as Rt,PH as Ia,fy as wa,PI as Aa,PJ as Ca,fD as Vt,fB as $t,PK as ze,PL as Ba,PM as xa,N6 as Ze,PN as Ea,N7 as oe,N8 as He,PO as Da,PP as Pa,PQ as ja,zO as nt,zL as Ta,PR as Fa,PS as Ra,PT as Va,zx as $a,PU as La,PV as Ua,PW as _a,co as Lt,cQ as Ut,kI as Ga,bP as Ma,bo as _t,bQ as Gt,xN as Oa,PX as Na,En as za,Et as Za,ub as Ha,zY as Wa,AC as qa,kV as fe,PY as Qa,PZ as Mt,ln as Ka,kP as Ot,l8 as Nt,l7 as it,bE as be,bO as Ya,P_ as Ja,P$ as ke,js as Xa,Q0 as ot,Q1 as en,jw as tn,jR as an,AQ as nn,Q2 as on,lg as ln,AG as sn,Q3 as lt,AK as rn,AP as cn,AM as dn,AE as un,Q4 as zt,yQ as pn,Q5 as mn,Q6 as bn,gh as hn,gg as gn,gf as yn,kY as Sn,le as st,lp as fn,rC as vn,l5 as kn,AI as In,jC as wn,lu as An,Q7 as Cn,ju as Bn,rt as xn,Q8 as En,zD as Dn,bK as Pn,bt as jn,LW as Tn,cS as Fn,cR as Rn,cz as Vn,cG as $n}from"./zeni-epic-state-CjyX3VL3.js";import{m as me,z as V,T as Ie,V as We,W as le,Q as y,aR as xe,B as re,o as x,Y as Pe,d as D,bi as Ln,q as z,a2 as qe,r as E,Z as we,bj as rt,bk as ct,bl as Un,ak as _n,A as Gn,aL as Mn,x as Zt,a as Qe,X as Ke,bm as On,at as Ht,bn as Nn,O as zn,f as Wt,a7 as Zn,bo as Hn,bp as Wn,bq as qn,br as Qn,bs as Kn,bt as Yn,bu as Jn,bv as Xn,bw as ei,$ as ti,bx as ai,bd as ni,by as ii,bz as oi,a9 as li}from"./index-DPagvN_p.js";import{n as U,S as si}from"./mui-LoCcantR.js";import{A as dt}from"./AddressScreen-DvRag0Iy.js";import{g as ie,a as je,i as qt,V as Ye,b as Je,c as ri,v as ci,d as di,A as he,D as ge}from"./DomesticWireDetailScreen-4iiJOmgC.js";import{a as f}from"./sentry-C6Nz2b7l.js";import{u as Xe}from"./useAskAiCfoHostNavButtonProps-CN1jthh8.js";import{u as Qt}from"./useInitialThreadRequest-0lzTunrY.js";import Ee from"./NotFoundScreen-7PHlhgpl.js";import{D as ui}from"./DrawerScreen-TcEyPR7p.js";import{M as Kt}from"./MobileAppDrawer-HA-p_xT8.js";import{F as Yt}from"./FeaturePreviewScreen-BhjGS-SQ.js";import{S as Te}from"./SetupPagesScreen-bl00HfFv.js";import{B as pi}from"./BillPayApprovalRoutes-CqQJw4lw.js";import{FallBackRoute as mi}from"./ScreenRoutes-BUZ0lv1o.js";import"./recharts-Dle8N8vU.js";import"./analytics-CJCMq6iU.js";import"./plaid-DFwM1Utp.js";import"./dnd-NJKg6PM2.js";import"./stripe-DMRn4zHo.js";import"./lottie-DdOZ7-9e.js";import"./lexical-enPzRBRr.js";import"./pdf-BqUsw-Gt.js";import"./utils-CSqwFRZv.js";import"./analyticsHelper-CcuWk6YF.js";import"./routePaths-Dj0dWV1_.js";import"./BusinessVerificationPageScreen-uYl0dcg3.js";import"./ReimbursementApprovalRuleDetailScreen-5Esp-U8d.js";import"./getLocaleForTenant-BdSj96xh.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]="672076d6-5d9d-4d93-aa52-a294005f2d11",e._sentryDebugIdIdentifier="sentry-dbid-672076d6-5d9d-4d93-aa52-a294005f2d11")}catch{}})();const bi=J(function(e,t){const l=_e(e,t.billId),n=V.getSignedInUser(),c=e.tenantState.currentTenantId,r={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:c??""},u=z(t.location.state?.pathnameStackToGoBack);let o=!0;u.poppedPathname?.includes("bills")===!0&&(o=!1);let s=`${l.createdBy?.firstName??"Zeni"} ${l.createdBy?.lastName??""}`;const i=De(n);i||!l.createdBy?.email?.includes("zeni.ai")||(s="Zeni");let d=!1,p=!1;if(l?.billActivities.length>0){const{isApprovalorRejectBtnVisible:g,isMarkAsPaidBtnVisible:b}=sa(l.billActivities,ra(t.currentTenant),n);d=g,p=b}const m=ca(t.currentTenant?.userRole??[]),h=l.transactionDetails!=null&&da(l.transactionDetails,m,n);return{billDetails:l,isAccountingClassesEnabled:Bt(e),createdBy:s,authParams:r,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,signedInUser:n,showBackButton:o,isAdmin:m,isRealTimeApprovalEnabled:t.isRealTimeApprovalEnabled,showApproveRejectBtns:d,showMarkAsPaidButtonToApprover:p,hasZeniAssistAccess:t.hasZeniAssistAccess,analytics:D,showMarkAsPaidButtonToCreator:h,isZeniUser:i}},function(e,t){const{billId:l,currentTenant:n,location:c,navigate:r}=t,{tenantEmailDomain:u}=n;return{redirectToBillsScreen:()=>{const o=ie(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);r(o,{state:{pathnameStackToGoBack:s}})},redirectToEditableBillScreen:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}})},discardBillDetailsFromLocalStore:()=>{e(ve({}))},deleteBill:o=>{D.trackBillPayDeleteBill(l,o),e(Dt(l))},cancelAndDeleteBill:(o,s)=>{s===!0?D.trackBillPayCancelAndDeleteBill(l,o):D.trackBillPayCancelBill(l),e(ba(l,s))},onSaveRealTimeApprovals:o=>{e(ma(l,"bill_pay",o))},updateEditRealTimeApproverClicked:o=>{e(pa({isEdit:o,entityId:l,entityType:"bill_pay"}))},approveOrRejectBill:o=>{o.type==="approved"?e(tt(l,o.type,"")):e(tt(l,o.type,o.description??""))},retryOrRefundBill:o=>{o.type==="retry"?e(Be(l,"retry")):e(Be(l,"refund"))},onAddNewRule:()=>{r("../../bills/approval-rules")},onAttachmentClick:(o,s)=>{const i=je(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);r(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{const o=z(t.location.state?.pathnameStackToGoBack),s=o.poppedPathname??ie(u);r(s,{state:{pathnameStackToGoBack:o.newStack}})},onRetryPaymentClick:()=>{const o=E(c.state?.pathnameStackToGoBack,c.pathname);r("./edit",{state:{pathnameStackToGoBack:o}}),e(ua({billId:t.billId}))},onRefundPaymentClick:()=>{e(Be(t.billId,"refund"))},saveBillDetails:(o,s,i)=>{o&&e(Et({data:i,billId:l})),e(Ge(o?"paid":"pending_approval",o,s,l))},discardOutsideZeniPaymentData:()=>{e(xt({billId:l}))}}})(Ln);function hi(){const e=K(),t=se(),l=Y(),{billId:n}=ae(),c=me(),r=V.getSignedInUser(),u=Ie(),o=k(O=>Z(O)),s=k(O=>_e(O,n??"")),i=s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1,d=Qt(o?.companyId,{clearParams:s.fetchState==="Completed"&&!i}),{isAiCfoAccessEnabled:p,onAskAiCfoClick:m}=Xe({mobileExploreReferrer:"Bill Details"});We({isDataReady:s.fetchState==="Completed"});const h=o?.userRole!=null&&It(o?.userRole),g=o?.company==null||o.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!h,[b,v]=f.useState(!1),[P,A]=f.useState(!1),[C,G]=f.useState(!1),{useFeatureGate:j,useDynamicConfig:_}=le(),{isFeatureEnabled:$}=j(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:I}=j(y.isBillPayCommentingEnabled),{isFeatureEnabled:H}=j(y.isBillPayDetectInsufficientFundsEnabled),{configValue:M}=_(xe.zeniAssistConfig),B=oa(o),q=wt(o.userRole),W=g&&pe(u?.loggedInUserRoleMap),L=M.user_ids!=null&&r?.userId!=null&&M.user_ids.includes(r?.userId),{isFeatureEnabled:Q}=j(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:X}=j(y.billPaySetupShowInternationalPaymentByWise);if(f.useEffect(()=>{$&&s.transactionDetails?.isDeleted===!0||o.isZeni===!0&&r?.userEmailDomain==="zeni.ai"&&B===!1?G(!1):G(s.billActivities[0]?.isRealTimeApprovalEnabled&&(q||W||s.allApprovers.find(O=>O.user.userId===r?.userId)!=null||s.transactionDetails?.lastUpdatedByUserId===r?.userId))},[s.billActivities[0]?.isRealTimeApprovalEnabled,s.allApprovers,s.transactionDetails?.lastUpdatedByUserId,q,W,o.isZeni,B,r]),f.useEffect(()=>{n!=null&&t(At(n))},[n]),f.useEffect(()=>{b||s.fetchState=="Completed"||s.fetchState=="In-Progress"||(v(!0),t(Ct(n??"",$,L,!1)))},[b,s,n,t]),f.useEffect(()=>{P||s.fetchState!="Completed"||s.transactionDetails?.billPayInfo.stage.code=="paid"||(A(!0),t($e(!1,$,L,X,n)),s.billActivities[0]?.isRealTimeApprovalEnabled===!0&&t(la()))},[P,s,n,t]),r==null)throw Error("Can't access address page without signing in...");return s.transactionDetails?.billPayInfo.stage.code==="draft"&&s.transactionDetails.isDeleted===!1?a.jsx(te,{to:`./edit${l.search}`}):s.deleteStatus.fetchState==="In-Progress"||s.cancelAndDeleteStatus.fetchState==="In-Progress"||s.cancelStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:s.deleteStatus.fetchState,style:{boxShadow:`0px 2px ${x.sp1} ${c.colors.dropShadowNormal}`}}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:O=>(ee=>{n!=null&&ee.trackBillPayBillDetails(n,s.isRecurring)})(O)}),a.jsx(bi,{initialOpenThreadRequest:d??void 0,isShowDeletedBillsEnabled:$,location:l,navigate:e,isBillPayCommentingEnabled:I,isRealTimeApprovalEnabled:C,currentTenant:o,billId:n??"",isInternationalPaymentShaVsOurEnabled:Q,hasZeniAssistAccess:L,isDetectInsufficientFundsEnabled:H,isAiCfoAccessEnabled:p,onAskAiCfoClick:m})]})}const ye=Qe.getLocalizedStrings().spendManagement.billPay.billDetails,gi={containerWidth:new Zt(100,58)},ut=J(function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=t.showActionButtons,u=r&&t.file==null;return{uploadInvoiceEndPoint:`${Ht.communicationAgentMicroServiceBaseUrl}`,authParams:c,billId:t.billId,file:t.file,showAutofill:t.showAutofill,analytics:D,entityId:t.billId,showTitlebarIcon:r,showTitlebar:r&&t?.file!=null,uploadStatus:t.uploadStatus,shouldNotShowAttachment:u,style:{paddingTop:x.sp10,paddingRight:x.sp3,paddingBottom:"15px",paddingLeft:x.sp5,...t.showAutofill?{}:{backgroundColor:t.backgroundColor,paddingBottom:"128px"}}}},function(e,t){const l=V.getSignedInUser();return{onInvoiceUpload:n=>{n!=null&&(t.file!=null||t.billId!=null||t.isInitialEdit?(t.setPayload(n),t.setShowConfirmationPopup(!0)):e(Ne(n,t.isVendorRecommendationEnabled,t.billId)))},updateInvoiceUploadFetchState:n=>{e(Sa({fetchState:{fetchState:n,error:void 0},billId:t.billId}))},onSkipAutofill:n=>{D?.trackBillPaySkipAutofill(),e(Oe(n))},onDeleteClick:()=>{e(ya({billId:t.billId})),D?.trackInvoiceActionClick(t.billStage??"","delete",l?.userEmail??"",null)}}})(Mn);function w({appContent:e}){const t=se(),l=K(),{billId:n}=ae(),c=Y(),r=c.pathname,u=r.includes("bill/new")||r.includes("/edit"),o=we(),s=me(),i=V.getSignedInUser(),{useFeatureGate:d,useDynamicConfig:p}=le(),{isFeatureEnabled:m}=d(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=d(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:g}=d(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=d(y.billPaySetupShowInternationalPaymentByWise),{configValue:v}=p(xe.zeniAssistConfig),P=v.user_ids!=null&&i?.userId!=null&&v.user_ids.includes(i?.userId),A=k(F=>Z(F)),[C,G]=f.useState(!1),[j,_]=f.useState(!1),[$,I]=f.useState(!1),[H,M]=f.useState(),B=k(F=>Me(F,m,g,n));let q=B.fetchState,W=B.file,L=B.showAutofill;const Q=k(F=>_e(F,n??""));u===!1&&(q=Q.fetchState,W=Q.transactionDetails?.attachments?.[0],L=!1);const X=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;f.useEffect(()=>{n==null&&t(Oe(!0))},[n,t]),f.useEffect(()=>{q==="Not-Started"&&(u&&j?_(!1):!u&&C&&G(!1))},[n]),f.useEffect(()=>{C||n==null||u||(G(!0),t(Ct(n,h,P,!1)),j||(_(!0),t($e(!1,h,P,b,n)))),u&&!j&&(_(!0),t($e(!1,h,P,b,n)))},[C,j,u,n,t]);const O={onOkClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,i?.userEmail??"","yes"),t(ga({replaceBillData:!0,billId:n})),t(Ne(H,m,n))},onCancelClick:()=>{if(I(!1),!H)return;const F=W!=null?"replace":"upload";D?.trackInvoiceActionClick(X??"",F,i?.userEmail??"","no"),t(ha({file:H,billId:n}))}},ee=f.useCallback(()=>{const F=z(c.state?.pathnameStackToGoBack),ce=F.poppedPathname??ie(A.tenantEmailDomain);t(ve({billId:n})),l(ce,{state:{pathnameStackToGoBack:F.newStack}})},[c.state,A.tenantEmailDomain,n,t,l]);if(i==null)throw Error("Can't access address page without signing in...");if(q==="Error"||Q.fetchState==="Error")return a.jsx(Ee,{});if(q!="Completed")return n==null&&o!=="small"?a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[a.jsx(mt,{}),a.jsx(Re,{}),a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:!0,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:void 0,setShowConfirmationPopup:I,setPayload:M,showActionButtons:!1,isInitialEdit:!!B.isInitialEdit,billStage:X}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:!0})})]})}):a.jsxs(Fe,{windowSize:o,children:[o==="small"||L?null:a.jsx(pt,{children:a.jsx(Jt,{onClick:ee,"data-testid":"nav-bar-back-click"})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(Un,{}),a.jsx(Ve,{windowSize:o,children:a.jsx(ct,{isNewBill:n==null})})]});{const F=B.billPayInfo!=null&&B.billPayInfo.stage.code==="pending_approval"?B.billPayInfo.billStatus.code:B.billStage;return a.jsx(rt,{fallback:ee,children:a.jsxs(Fe,{windowSize:o,children:[L&&o!=="small"?a.jsx(mt,{}):null,$?a.jsx(_n,{titleComponent:a.jsx(wi,{children:ye.overwriteTitle}),descriptionComponent:a.jsx(Ai,{children:ye.overwriteDescription}),primaryButtonText:ye.buttons.yes,secondaryButtonText:ye.buttons.no,action:O,isEditPopup:!0}):null,o==="small"||L?null:a.jsx(pt,{children:a.jsx(yi,{})}),o!=="small"?a.jsx(Re,{}):null,a.jsx(ut,{backgroundColor:s.colors.grey4,billId:n,file:W,showAutofill:L,uploadStatus:B.uploadStatus,isVendorRecommendationEnabled:m,attachmentTitle:Si(u,Q,B),setShowConfirmationPopup:I,setPayload:M,showActionButtons:fi(u,B),isInitialEdit:!!B.isInitialEdit,billStage:F}),a.jsx(Ve,{windowSize:o,children:e})]})})}}function yi(){const{triggerBack:e}=On();return a.jsx(Jt,{onClick:e,"data-testid":"nav-bar-back-click"})}function Si(e,t,l){let n,c;return e?(n=l.recurringConfig?.currentInstance,c=l.recurringConfig?.totalPaymentCycles):(n=t.transactionDetails?.recurringBillInstance,c=t.recurringBillConfigDetail?.totalPaymentCycles),t?.isRecurring===!0?a.jsxs(vi,{children:[a.jsx(ki,{children:`${ye.recurringBill.recurringCycle}
|
|
2
|
+
${n}/${c}`}),a.jsx(Ii,{})]}):void 0}function fi(e,t){const l=t.billActivities?.[0],n=t.billStage==="pending_approval"&&l?.areApprovalsSerialized===!0&&l?.currentPendingStepIndex===0;return e&&(t.billStage==="draft"||n)}const pt=U.div`
|
|
3
|
+
margin-bottom: 20px;
|
|
4
|
+
margin-top: 20px;
|
|
5
|
+
margin-left: ${x.sp5};
|
|
6
|
+
position: absolute;
|
|
7
|
+
display: flex;
|
|
8
|
+
align-items: center;
|
|
9
|
+
`,vi=U.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
13
|
+
padding-top: 9px;
|
|
14
|
+
gap: ${x.sp2};
|
|
15
|
+
margin-bottom: -${x.sp2};
|
|
16
|
+
`,ki=U(Ke.StandardMedium)``,Ii=U(e=>f.createElement("svg",{viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M3.35001 15L3.35001 10.125C3.35001 6.81129 6.0363 4.125 9.35001 4.125H16.475M16.475 4.125L13.85 1.5M16.475 4.125L13.85 6.75",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"}),f.createElement("path",{d:"M20.6 9V13.875C20.6 17.1887 17.9137 19.875 14.6 19.875H7.47501M7.47501 19.875L10.1 22.5M7.47501 19.875L10.1 17.25",stroke:"currentColor",strokeWidth:1.5,strokeLinecap:"round",strokeLinejoin:"round"})))`
|
|
17
|
+
color: ${e=>e.theme.colors.hero};
|
|
18
|
+
height: ${x.sp3};
|
|
19
|
+
width: ${x.sp3};
|
|
20
|
+
`,Jt=U(e=>f.createElement("svg",{viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",width:"1em",height:"1em",...e},f.createElement("path",{d:"M10 13L5 8L10 3",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})))`
|
|
21
|
+
width: ${x.sp3};
|
|
22
|
+
height: ${x.sp3};
|
|
23
|
+
cursor: pointer;
|
|
24
|
+
color: ${e=>e.theme.colors.champion};
|
|
25
|
+
&:hover {
|
|
26
|
+
color: ${e=>e.theme.colors.primary};
|
|
27
|
+
}
|
|
28
|
+
`,Fe=U.div`
|
|
29
|
+
display: flex;
|
|
30
|
+
height: 100vh;
|
|
31
|
+
flex-direction: ${e=>e.windowSize==="small"?"column":"row"};
|
|
32
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
33
|
+
position: relative;
|
|
34
|
+
&::after {
|
|
35
|
+
content: "";
|
|
36
|
+
position: absolute;
|
|
37
|
+
top: 57px;
|
|
38
|
+
left: 42%;
|
|
39
|
+
width: 1px;
|
|
40
|
+
height: calc(100% - 57px);
|
|
41
|
+
background-color: ${e=>e.theme.colors.grey2};
|
|
42
|
+
pointer-events: none;
|
|
43
|
+
z-index: 3;
|
|
44
|
+
display: ${e=>e.windowSize==="small"?"none":"block"};
|
|
45
|
+
}
|
|
46
|
+
`,Re=U.div`
|
|
47
|
+
position: absolute;
|
|
48
|
+
top: 56px;
|
|
49
|
+
left: 0;
|
|
50
|
+
width: 42%;
|
|
51
|
+
height: 1px;
|
|
52
|
+
background-color: ${e=>e.theme.colors.grey2};
|
|
53
|
+
z-index: 3;
|
|
54
|
+
`,mt=U.div`
|
|
55
|
+
position: fixed;
|
|
56
|
+
top: 0;
|
|
57
|
+
left: 0;
|
|
58
|
+
right: 0;
|
|
59
|
+
bottom: 0;
|
|
60
|
+
background-color: ${Gn.overlayBackgroundBlack};
|
|
61
|
+
z-index: 5;
|
|
62
|
+
`,Ve=U.div`
|
|
63
|
+
display: flex;
|
|
64
|
+
flex-direction: column;
|
|
65
|
+
width: ${e=>`${gi.containerWidth.value(e.windowSize)}%`};
|
|
66
|
+
${e=>e.windowSize!=="small"?"overflow: auto;":""}
|
|
67
|
+
`,wi=U(Ke.H6Regular)`
|
|
68
|
+
margin-top: ${x.sp7};
|
|
69
|
+
padding-left: ${x.sp8};
|
|
70
|
+
padding-right: ${x.sp8};
|
|
71
|
+
color: ${e=>e.theme.colors.primary};
|
|
72
|
+
word-break: break-word;
|
|
73
|
+
`,Ai=U(Ke.LargeRegularSp)`
|
|
74
|
+
color: ${e=>e.theme.colors.hero};
|
|
75
|
+
padding-left: ${x.sp8};
|
|
76
|
+
padding-right: ${x.sp8};
|
|
77
|
+
margin-bottom: 30px;
|
|
78
|
+
margin-top: ${x.sp4};
|
|
79
|
+
white-space: pre-line;
|
|
80
|
+
`,Ci=J(function(e,t){return{billsReviewView:Pt(e),analytics:t.analytics}},function(e,t){return{onCloseOverlay:()=>{t.navigate("./"),e(ue())},onCloseReviewItem:l=>{e(va(l))},onProceedForBulkActionClick:(l,n)=>{switch(l){case"send_for_approval":e(fa());break;case"approve":case"review":e(at("approved",n??""));break;case"reject":e(at("rejected",n??""))}}}})(Nn);function Bi(){const e=K(),t=k(n=>n.billsBulkActionViewState.bulkSubmissionFetchState.fetchState),{billsForReview:l}=k(n=>Pt(n));return f.useEffect(()=>{t!=="Completed"&&l.length!==0||e("./")},[t,l.length]),a.jsx(Ci,{navigate:e,analytics:D})}const ne=xa(),Xt="bulk-operation-update",Ue="bill-approval-rule-update",{spendManagement:xi,common:bt}=Qe.getLocalizedStrings(),ht=xi.billPay.bulkActions,Ei=U.div`
|
|
81
|
+
display: flex;
|
|
82
|
+
min-height: 100%;
|
|
83
|
+
width: 100%;
|
|
84
|
+
flex: 1 1 auto;
|
|
85
|
+
flex-direction: column;
|
|
86
|
+
align-items: center;
|
|
87
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
88
|
+
`,Di=J(function(e,t){const l=V.getSignedInUser(),n=De(l),c=Ft(e,ne,t.isBulkActionEnabled,l?.userId);let r=c.allSubTabs;t.isUserHasOnlyBillpayAccess&&t.roleMap&&c.currentTab==="pending_approval"&&(t.roleMap.bill_pay_analyst?r=r.filter(b=>b==="all"||b==="overdue"||b==="rejected"||b==="deleted"):t.roleMap.bill_pay_approver&&(r=r.filter(b=>b==="all"||b==="awaiting_my_approval"||b==="overdue"||b==="rejected"||b==="deleted"))),t.isShowDeletedBillsEnabled===!1&&(r=r.filter(b=>b!=="deleted"));const u=e.entityAutoCompleteState.autoCompleteText.common,o=Ze(e,"common"),s=e.tenantState.currentTenantId,i=Z(e),d=i?.companyName??"",p={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:s??""},m=e.billListState.downloadUIState.downloadState,h=c.fetchState,g=Ea(e);return{transactionList:t.isShowDeletedBillsEnabled?c.transactions:c.transactions.filter(b=>b.isDeleted===!1),currentTab:c.currentTab,currentSubTab:c.currentSubTab,approvalCount:c.approvalCount,allSubTabs:r,fetchState:h,analytics:D,botEmail:c.billPayBotEmail,searchText:c.searchText,filters:c.filters,vendorSearchAutoCompleteData:{autoCompleteText:u,entityAutoCompleteView:o},downloadParams:{authParams:p,companyName:d,timePeriod:ne,spendManagementEndPoint:`${qe}/spendManagement`,isShowDeletedBillsEnabled:t.isShowDeletedBillsEnabled,isShowDeletedReimbursementEnabled:t.isShowDeletedReimbursementEnabled},downloadState:m,isBulkActionAllowed:c.billListBulkActionInfo?.isBulkActionAllowed,transactionsSelectedForBulkAction:c.billListBulkActionInfo?.billsSelectedForBulkAction,allowedBulkActions:c.billListBulkActionInfo?.allowedBulkActions,isZeniUser:n,billPayApprovalRulesAffectedEntityIds:g.affectedEntityIds}},function(e,t){const{navigate:l,currentTenant:n,location:c,period:r}=t,{tenantEmailDomain:u}=n;return{updateTabToState:o=>{e(ue()),e(jt(o))},onSubtabChange:o=>{e(ue()),e(Tt(o))},onTransactionClick:(o,s)=>{const i=je(u,o,s),d=E(c.state?.pathnameStackToGoBack,c.pathname);l(i,{state:{pathnameStackToGoBack:d}})},onClickSetupIcon:()=>{const o=ji(u),s=E(c.state?.pathnameStackToGoBack,c.pathname);l(o,{state:{pathnameStackToGoBack:s}})},onAddTransactionClick:()=>{const{tenantEmailDomain:o}=t.currentTenant;D?.trackBillPayNewBill();const s=`/${o}/bill/new`,i=E(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(s,{state:{pathnameStackToGoBack:i}})},onSearchTextChanged:o=>{e(La(o))},onReloadTransactions:()=>{e(Le(r,!0,t.isShowDeletedBillsEnabled,t.isInternationalWireEnabled)),e($a(n.companyId,!0))},onNavigateToSettings:()=>{l("../bills/setup")},onBackClick:()=>{l("../",{relative:"path"})},onFiltersChange:o=>{e(Va({filters:o})),o.categories.every(s=>s.field!=null&&s.values?.length!==0)&&D.trackSpendManagmentFilterChange("bill_pay",o.categories.map(s=>`${s.field}-${JSON.stringify(s.values)}`))},updateDownloadStateHandler:o=>{o==="In-Progress"&&D.trackSpendManagementDownloadClick("bill_pay"),e(Ra({uiState:{downloadState:o}}))},updateBulkActionList:o=>{e(Fa(o))},removeAllTransactionsFromBulkActionList:()=>{e(ue())},onProceedForBulkActionClick:(o,s)=>{switch(o){case"delete":case"cancel":e(Ta(o,s??""));break;case"send_for_approval":e(nt("send_for_approval")),t.navigate("./bulk-review");break;case"approve":e(nt("approve")),t.navigate("./bulk-review");break;case"review":e(ja()),t.navigate("./bulk-review")}},onBillPayApprovalRulesEventReceived:o=>{o.endsWith(Ue)&&e(Pa(!1))},onEventReceived:o=>{o===Xt&&e(Da())},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:o=>{o.trim().length>=2?e(He({searchString:o,entityType:"vendor",searchOrigin:"common"})):o.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}}}})(Zn(Hn));function Pi(){const e=K(),t=se(),l=Y(),n=we(),c=l.state,r=Ie(),[u,o]=f.useState(!1),[s,i]=f.useState(null),d=na("/:tenantEmailDomain/bills/bulk-review")!=null;f.useEffect(()=>(c?.tab!=null&&c?.subTab!=null&&(t(jt(c?.tab)),t(Tt(c?.subTab))),()=>{t(ue())}),[]);const p=V.getSignedInUser(),m=k(T=>Z(T)),{areTenantIdsInSync:h}=zn(),[g,b]=f.useState(!1),{useFeatureGate:v}=le(),{isFeatureEnabled:P}=v(y.isShowDeletedBillsFeatureEnabled),{isFeatureEnabled:A}=v(y.isBillPayCommentingEnabled),{isFeatureEnabled:C}=v(y.isReimbursementCommentingEnabled),{isFeatureEnabled:G}=v(y.isShowDeletedReimbursementsFeatureEnabled),{isFeatureEnabled:j}=v(y.isBillPayBulkActionEnabled),{isFeatureEnabled:_}=v(y.billPaySetupShowInternationalPaymentByWise),{isFeatureEnabled:$}=v(y.isBillPayDetectInsufficientFundsEnabled),I=k(T=>Ft(T,ne,j,p?.userId)),{isFeatureEnabled:H}=v(y.isDebitCardFeatureEnabled),M=I.fetchState,{isAiCfoAccessEnabled:B,onAskAiCfoClick:q}=Xe({mobileExploreReferrer:"Bills List"});We({isDataReady:M==="Completed"});const W=!!m.companyBillPayInfo?.info?.isBillPayTOSAccepted,L=!!m.companyBillPayInfo?.info?.isBillPayEnabled,Q=k(T=>ka(T.companyState,m.companyId)),X=Q?.company.featuresActivationInfo.connectedAccountProvider;if(f.useEffect(()=>{!g&&L&&h&&(b(!0),t(Le(ne,!0,P,_)))},[g,ne,h,t]),p==null)throw Error("Can't access address page without signing in...");const O=(T,de)=>{t(Ba({uiState:{sortKey:T,sortOrder:de},period:ne}))},ee=Rt(r?.loggedInUserRoleMap),F=pe(r?.loggedInUserRoleMap),ce=T=>{o(T)},{billsProcessed:N,billsProcessing:Ae}=k(T=>Ia(T));f.useEffect(()=>{N===Ae&&s!=null&&(t(wa({messageSection:"bill_pay_bulk_processed",messageText:"success",type:"success",showStatusIcon:!0,variables:[{variableName:"_bill_",variableValue:N>1?ht.bills:ht.bill},{variableName:"_has_",variableValue:N>1?bt.texts.have:bt.texts.has},{variableName:"_action_",variableValue:Aa(s)}]})),t(Ca()),setTimeout(()=>{t(Le(ne,!0,P,!0,_))},3e3),i(null))},[N,Ae]);const ea={events:m.companyId!=null?[`private-encrypted-${m.companyId}.${Xt}`,`private-encrypted-${m.companyId}.${Ue}`]:[],eventCallback:(T,de,et)=>{T.endsWith(Ue)?et.onBillPayApprovalRulesEventReceived?.(T):de?.entity_type==="bill"&&(i(de.operation_type),et.onEventReceived(T))}},ta=Vt(H,m),aa=$t(m);return l.pathname.endsWith("/bills/")||l.pathname.endsWith("/bills")||l.pathname.endsWith("/bills/bulk-review")?ta===!0||aa===!0?a.jsx(Yt,{}):L?a.jsxs(a.Fragment,{children:[M==="Completed"?a.jsx(Pe,{analytics:D,onLoad:T=>(de=>de.trackPageLoaded(Wt.Event.billPayHome))(T)}):null,a.jsxs(Ei,{windowSize:n,children:[a.jsx(Kt,{isAppContentDrawerOpen:u,handleDrawerToggle:ce}),a.jsx(ui,{isOpen:d,drawerLeftMargin:new Zt(0,0,300,600),onClose:()=>{e("./"),t(ue())},children:a.jsx(Ti,{onClick:T=>T.stopPropagation(),children:a.jsx(Bi,{})})}),a.jsx(Di,{location:l,navigate:e,currentTenant:m,entity:"bill_pay",isBillPayCommentingEnabled:A,isReimbursementCommentingEnabled:C,period:ne,isAdmin:!1,uiState:I.uiState,onColumnSortConfigChanged:O,isUserHasOnlyBillpayAccess:ee,isShowDeletedBillsEnabled:P,isShowDeletedReimbursementEnabled:G,isBulkActionEnabled:j,roleMap:r?.loggedInUserRoleMap,onClickMenuIcon:()=>{ce(!0)},isDownloadEnabled:I.isDownloadEnabled,connectedAccountProvider:X,bulkSubmissionLimit:I.billBulkSubmissionLimit,bulkSubmissionFetchState:I.billListBulkActionInfo.bulkSubmissionFetchState,isRecurringBillInBulkActionList:I.billListBulkActionInfo.isRecurringBillInBulkActionList,isInternationalWireEnabled:_,isDetectInsufficientFundsEnabled:$,isAiCfoAccessEnabled:B,onAskAiCfoClick:q,...ea})]})]}):W===!0&&F===!0?a.jsx(te,{to:"../setup"}):r!=null&&ze(m,r.loggedInUserRoleMap)?a.jsx(te,{to:"../promo"}):a.jsx(re,{fetchState:M}):a.jsx(Ee,{})}const ji=e=>`/${e}/bills/setup`,Ti=U(si)`
|
|
89
|
+
display: flex;
|
|
90
|
+
min-height: 100%;
|
|
91
|
+
flex-direction: column;
|
|
92
|
+
`,{common:{currency:Se},spendManagement:{billPay:{billDetails:Fi}},appName:Ri}=Qe.getLocalizedStrings(),Vi=J(function(e,t){const l=V.getSignedInUser(),n=e.tenantState.currentTenantId,c={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:n??""},r=z(t.location.state?.pathnameStackToGoBack);let u=!0;r.poppedPathname?.includes("bills")===!0&&(u=!1);const o=e.entityAutoCompleteState.autoCompleteText.common,s=Ze(e,"common");let i=`${l?.firstName} ${l?.lastName}`;const d=De(l);t.billId!=null&&t.billDetailsView!=null&&(i=`${t.billDetailsView.createdBy?.firstName??Ri} ${t.billDetailsView.createdBy?.lastName??""}`),d||!t.billDetailsView.createdBy?.email?.includes("zeni.ai")||(i="Zeni");const p=t.billDetailsView.editBillInitialDetails?.totalAmount?.amount,m=Ma(t.billDetailsView.paymentDetailsSection?.paymentType?.method),h=t.currentTenant.createTime,g=_t(),b=t.sameDayAchDisablementConfig.newTenantTenureLimitMonths,v=h.add(b,"month").isAfter(g),P=!!(t.billDetailsView.billStage==="draft"&&m&&p!=null&&p>0)&&!Gt(p,t.billDetailsView.approvalRules.allApprovalRules,l,t.billDetailsView.vendor?.id,t.billDetailsView.classId),A=Z(e);return{billDetails:t.billDetailsView,isAccountingClassesEnabled:Bt(e),billId:t.billId,createdBy:i,createTime:t.billDetailsView?.createTime,authParams:c,transactionAttachmentEndpoint:`${qe}/transaction_attachment`,analytics:D,showBackButton:u,isAdmin:t.isBillPayAdmin,isSuperAdmin:t.isSuperAdmin,connectedAccountProvider:A.company?.featuresActivationInfo.connectedAccountProvider??"",customerSearchAutoCompleteData:{autoCompleteText:o,entityAutoCompleteView:s},showMarkAsPaidInfo:P,isZeniUser:d,isNewUser:v,sameDayAchDisablementConfig:t.sameDayAchDisablementConfig}},function(e,t){const{billId:l,companyId:n,currentTenant:c,location:r,navigate:u,billDetailsView:o}=t,{tenantEmailDomain:s}=c;return{editVendor:i=>{e(it(i));const d=yt(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},chooseNewVendor:i=>{const d=i??t.billDetailsView.addBillAutoFields.tentativeVendorName;d!=null&&e(Ot(d,!1)),e(Nt({localData:{vendorName:i??t.billDetailsView.addBillAutoFields.tentativeVendorName}})),e(it());const p=yt(s,void 0,l),m=E(r.state?.pathnameStackToGoBack,r.pathname);u(p,{state:{pathnameStackToGoBack:m}})},onInvoiceUpload:i=>{i!=null&&e(Ne(i,t.isVendorRecommendationEnabled))},updateShowAutofill:i=>{e(Oe(i))},onSaveChangesToLocalStore:(i,d,p,m,h)=>{const g=_i(t.billDetailsView,{...i,paymentDetails:{...i?.paymentDetails,paymentDate:h}},p,d,t.isInternationalPaymentShaVsOurEnabled,m,t.vendor);e(Ka({billDetailLocalData:g,billId:l}))},saveBillDetails:()=>{e(Ge("draft",!1,!1,l)),e(oe("common"))},updateBillDetailSaveBillCode:()=>{e(Mt("draft"))},reviewBillDetails:()=>{const i=$i(s,l),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d,message:"coming_from_edit_page"}})},discardBillDetailsFromLocalStore:({billId:i})=>{e(ve({billId:i}))},clearBillPayReviewLocalState:()=>e(Qa()),onClickDismiss:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},onClickDiscard:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);u(i,{state:{pathnameStackToGoBack:d}})},setBillDetailPageMode:i=>{if(i==="edit_bill"){let d=window.location.pathname;d=d.concat("/edit");const p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})}},redirectToACHScreen:i=>{e(fe(!1,i));const d=Li(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToWireScreen:i=>{e(fe(!1,i));const d=Ui(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToInternationalScreen:i=>{e(fe(!1,i));const d=qt(s,l,i),p=E(r.state?.pathnameStackToGoBack,r.pathname);u(d,{state:{pathnameStackToGoBack:p}})},redirectToBillsScreen:()=>{const i=ie(s),d=E(r.state?.pathnameStackToGoBack,r.pathname);e(ve({})),u(i,{state:{pathnameStackToGoBack:d}})},redirectToBillDetailPage:()=>{t.navigate("../")},deleteBill:()=>{l!=null&&e(Dt(l))},onAttachmentClick:(i,d)=>{const p=je(s,i,d);window.open(`${p}`,"_blank")},onBackClick:()=>{const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ie(s);u(d,{state:{pathnameStackToGoBack:i.newStack}})},customerSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},addVendorContactEmail(i,d){e(qa(i,d,l))},onWiseVerifyClick:()=>{let i="";i=Kn()?"https://sandbox.transferwise.tech":"https://wise.com";const d=`${i}/login`;window.open(d,"_blank")},onVendorSelected:i=>{e(Wa(!0,i,l))},onSignUpAccountClick:()=>{t.hasZeniAccountsAdminAccess?window.open(`/${s}/checking/promo`,"_blank"):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onMoveMoneyClick:()=>{t.isZeniAccountsUser?window.open(`/${s}/checking/transfer`):window.open("https://www.zeni.ai/product/business-checking-accounts","_blank")},onInternationalWireVerifyClick:()=>{window.open(`/${s}/bills/international-wire`)},onFetchLinkTokenClick:(i,d)=>{e(Ha("bill_pay_detail",i,d))},onEstablishConnectionClick:i=>{e(Za(i,n,"bill_pay_detail","bill_pay"))},onUpdatePaymentAccountStatus:(i,d,p)=>{e(za(i,d,"bill_pay","bill_pay_detail",p))},onEstablishConnectionSuccess:()=>{e(Oa("bill_pay","bill_pay_detail")),e(Na({billId:l,withdrawFromAccountId:o.newAddedBillPaymentAccountId,withdrawFromList:o.withdrawFromList}))}}})(Wn);function gt(){const e=K(),t=Y(),l=se(),{billId:n,tenantEmailDomain:c}=ae(),{useFeatureGate:r,useDynamicConfig:u}=le(),{isFeatureEnabled:o,isFeatureGateLoading:s}=r(y.isVendorMagicLinkFeatureEnabled),{isFeatureEnabled:i}=r(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:d}=r(y.isBillPayCommentingEnabled),{isFeatureEnabled:p}=r(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isRecurringBillsFeatureEnabled),{isFeatureEnabled:g}=r(y.isDepositAccountsFeatureEnabled),{isFeatureEnabled:b}=r(y.isShaDisabled),{isFeatureEnabled:v}=r(y.isOurDisabled),{isFeatureEnabled:P}=r(y.isBillPayDetectInsufficientFundsEnabled),{configValue:A}=u(xe.zeniAccountsConfig),C=Ua(A),{configValue:G}=u(xe.sameDayAchDisablementConfig),j=_a(G),_=V.getSignedInUser(),$=k(N=>Z(N)),I=k(N=>Me(N,m,g,n)),H=Qt($?.companyId,{clearParams:I.fetchState==="Completed"}),{isAiCfoAccessEnabled:M,onAskAiCfoClick:B}=Xe({mobileExploreReferrer:"Bill Details"});We({isDataReady:I.fetchState==="Completed"});const q=$.companyId??V.getSignedInUserTenant(c)?.companyId,W=!!$.companyZeniAccountInfo?.info?.isZeniAccountEnabled,L=Ie(),Q=Lt(L?.loggedInUserRoleMap),X=Ut(L?.loggedInUserRoleMap),O=pe(L?.loggedInUserRoleMap),ee=wt($.userRole);if(f.useEffect(()=>{n!=null&&l(At(n))},[n]),_==null)throw Error("Can't access address page without signing in...");const F=k(N=>Ga(N.accountState,N.accountListState,"billPayAccountList")),ce={pathname:"../",search:t.search};return I.isDeleted===!0||I.billStage=="paid"||I.fetchState=="Not-Started"?a.jsx(te,{to:ce}):I.deleteStatus.fetchState==="In-Progress"||s?a.jsx(re,{fetchState:I.deleteStatus.fetchState}):a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:N=>(Ae=>{n!=null&&I.deleteStatus.fetchState!=="Completed"&&Ae.trackBillPayEditBill(n,I.isRecurring)})(N)}),a.jsx(Vi,{initialOpenThreadRequest:H??void 0,location:t,navigate:e,currentTenant:$,billId:n,companyId:q,billDetailsView:I,isMagicLinkEnabled:o,isVendorRecommendationEnabled:m,isLocalCurrencyEnabled:p,uncategorizedAccounts:F,isInternationalPaymentShaVsOurEnabled:i,vendor:I.vendor,isBillPayCommentingEnabled:d,isShaDisabled:b,isOurDisabled:v,isRecurringBillsFeatureEnabled:h,isAccountsEnabled:W,hasZeniAccountsAdminAccess:Q,isZeniAccountsUser:X,isBillPayAdmin:O,isSuperAdmin:ee,accountsPromoConfig:C,isDetectInsufficientFundsEnabled:P,sameDayAchDisablementConfig:j,isAiCfoAccessEnabled:M,onAskAiCfoClick:B})]})}const yt=(e,t,l)=>{let n=`/${e}/bill/`;return l==null?n=t!=null?n.concat(`new/vendor/${encodeURIComponent(t)}/edit`):n.concat("new/vendor/create"):(n=n.concat(`${encodeURIComponent(l)}/edit/vendor/`),n=t!=null?n.concat(`${encodeURIComponent(t)}/edit`):n.concat("create")),n},$i=(e,t)=>{let l=`/${e}/bill/`;return l=t===void 0?l.concat("new/review"):l.concat(`${t}/edit/review`),l},Li=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/ach`),n},Ui=(e,t,l)=>{let n=`/${e}/bill/`;return n=l!=null?n.concat(`${encodeURIComponent(l)}/edit/`):n.concat("new/"),n=n.concat(`vendor/${encodeURIComponent(t)}/edit/domestic`),n},R="paymentDetails",_i=(e,t,l,n,c,r,u)=>{const o={invoiceNumber:t.whatFor.invoiceNumber,memo:t.whatFor.memo,invoiceDate:t.whatFor.invoiceDate?be(t.whatFor.invoiceDate.toString()):_t(),billDueDate:t.whatFor.billDueDate?be(t.whatFor.billDueDate.toString()):void 0,currencyCode:t.whatFor.currency,recipientCurrencyCode:t.whatFor.recipientCurrency,isInvoiceDateAutoUpdated:t.whatFor.isInvoiceDateAutoUpdated},s={paymentDate:t[R]?.paymentDate?be(t[R].paymentDate.toString()):void 0,paymentType:t[R]?.paymentType!=null?t[R]?.paymentType:void 0,paymentTo:r?.id,withdrawFrom:e.withdrawFromList.find(b=>b.id===t[R]?.withdrawFrom?.selectedOption),internationalTransferFeeBearerPaymentMethod:t[R]?.paymentType?.method!=null&&t[R].paymentType.method.includes(Ya)&&u?.vendorCurrencyCode===Se.currencyCode&&c?t[R]?.internationalTransferFeeBearerPaymentMethod:void 0,conversionRate:e.paymentDetailsSection?.conversionRate},i=r?.type==="Contact"?r?.email:void 0,d=!!i,p=t[R]?.recurringPaymentType?.selectedOption===Fi.recurringBill.paymentTypeOptions[1],m={isActive:e.recurringConfig?.isActive??!1,currentInstance:e.recurringConfig?.currentInstance,isApprovalRequired:t[R]?.recurringPaymentDetails?.requireApproval?.selectedOption==="all",frequency:Ja(t[R]?.recurringPaymentDetails?.frequency?.selectedOption),endDate:t[R]?.recurringPaymentDetails?.endDateSelector?.date!=null?be(t[R]?.recurringPaymentDetails?.endDateSelector.date.toString()):void 0,startDate:t[R]?.recurringPaymentDetails?.startDate?be(t[R]?.recurringPaymentDetails?.startDate.toString()):void 0,endDateSelectorOptionType:t[R]?.recurringPaymentDetails?.endDateSelector?.type,totalPaymentCycles:t[R]?.recurringPaymentDetails?.endDateSelector?.recurringCount??0,updateRecurringBills:t[R]?.recurringPaymentDetails?.updateRecurringBills},h=Gi(e.accountList.accounts,e.classList.classes,e.lineDetailSection,t.lineItems,n,l),g=Object.keys(h).length>0?qn(h):e.editBillInitialDetails?.recipientTotalAmount;return{showVendorGptRecommendationText:e.showVendorGptRecommendationText,vendor:u,whatForSection:o,paymentDetailsSection:s,isCancelled:e.isCancelled,totalAmount:g,recipientTotalAmount:g,file:e.file,updatesByLineId:h,toAccountVendorEmail:i,isCollectToAccountInfoFromVendorContact:d,isRecurring:p,recurringConfig:m}},Gi=(e,t,l,n,c,r)=>{const u={};return n.forEach(o=>{let s,i;o.account.selectedOption!=null&&(s=e.find(p=>p.qboId===o.account.selectedOption||p.accountId===o.account.selectedOption)),o.class?.selectedOption!=null&&(i=t.find(p=>p.classId===o.class.selectedOption));const d=Qn(l[o.lineId],o,c,r);u[o.lineId]={...l[o.lineId],...o,platformLineDetailType:l[o.lineId]?.platformLineDetailType??"account_based_expense_line_detail",amount:{amount:o.amount??0,currencyCode:o.currency?.currencyCode??Se.currencyCode,currencySymbol:o.currency?.currencySymbol??Se.currencySymbol},recipientAmount:{amount:o.recipientAmount??0,currencyCode:o.recipientCurrency?.currencyCode??Se.currencyCode,currencySymbol:o.recipientCurrency?.currencySymbol??Se.currencySymbol},id:o.lineId,lineDescription:o.lineDescription??"",account:s,class:i,billable:o.billable?.selectedOption??"not_billable",customer:{id:d?.id??"",name:d?.name??"",qboId:d?.qboId,logo:d?.logo},type:"journal_entry_transaction_line",isCategoryMiscategorized:!1,isClassMiscategorized:!1}}),u},Mi=U.div`
|
|
93
|
+
display: flex;
|
|
94
|
+
height: 100vh;
|
|
95
|
+
width: 100%;
|
|
96
|
+
flex: 1 1 auto;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
align-items: center;
|
|
99
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
100
|
+
box-shadow: ${e=>`0px 2px ${x.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
101
|
+
`,Oi=J(function(e,t){const{vendorId:l,billId:n}=t,c=ke(e,l),r=Me(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,n);return{billId:n,isDisabled:c.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:c,file:r.file,bankAccountContext:t.bankAccountContext}},function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onFetchBankNameBySwift:s=>{e(an(s))},onSaveHandler:()=>{e(tn(t.bankAccountContext,r))},onBankDetailsUpdated:s=>{const{internationalWireSwiftAccountSection:i}=s;e(en({data:i}))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),i=s.poppedPathname??St();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(ot())},onAddressClick:s=>{const i=Je(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(Xa({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??St(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(ot())}}})(Yn);function Ni(){const e=K(),t=Y(),l=we(),{vendorId:n,billId:c}=ae(),{useFeatureGate:r}=le(),u=me(),o=V.getSignedInUser(),s=k(g=>Z(g)),i=z(t.state?.pathnameStackToGoBack),d=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",p=k(g=>ke(g,n)),{isFeatureEnabled:m}=r(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:h}=r(y.isDepositAccountsFeatureEnabled);if(o==null)throw Error("Can't access address page without signing in...");return d==="billDetail"&&p.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:p.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${x.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(Mi,{windowSize:l,children:[a.jsx(Ye,{vendorId:n,billId:c}),a.jsx(Oi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:d,isVendorRecommendationEnabled:m,isZeniAccountsFeatureEnabled:h})]})}const St=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},zi=U.div`
|
|
102
|
+
display: flex;
|
|
103
|
+
height: 100vh;
|
|
104
|
+
width: 100%;
|
|
105
|
+
flex: 1 1 auto;
|
|
106
|
+
flex-direction: column;
|
|
107
|
+
align-items: center;
|
|
108
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
109
|
+
box-shadow: ${e=>`0px 2px ${x.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
110
|
+
`,Zi=J(function(e,t){const{vendorId:l}=t,n=ke(e,l),c=l!=null?n.editVendorState?.vendorDetailLocalData?.vendorType:n.newVendorState?.vendorDetailLocalData?.vendorType,r=on(e,c||"international_business",t.billId),u=n.editVendorState??n.newVendorState,o=t.billId!=null?e.editBillDetailViewState.editBillStateById[ln(t.billId)].billDetailLocalData.recipientTotalAmount?.amount:e.editBillDetailViewState.newBillState.billDetailLocalData.recipientTotalAmount?.amount;return{internationalWireView:r,vendorViewDetails:n,bankAccountContext:t.bankAccountContext,vendorType:c||"international_business",addressType:"vendor_address",addressToEdit:u?.vendorNewAddressStatus?.addressToCreate,mailingAddress:u?.vendorAddress,billAmount:o??0}},function(e,t){const{billId:l,navigate:n,location:c,vendorId:r,currentTenant:u}=t,{tenantEmailDomain:o}=u;return{onSaveHandler:()=>{e(un(t.bankAccountContext,r))},onAccountDetailsUpdated:(s,i,d,p)=>{e(cn(s)),p&&e(dn(i,d))},onCurrencyUpdated:(s,i,d)=>{e(rn(s,i,d,!1))},onCancel:()=>{(()=>{const s=z(c.state?.pathnameStackToGoBack),i=s.poppedPathname??ft();n(i,{state:{pathnameStackToGoBack:s.newStack}})})(),e(lt())},onAddressClick:s=>{const i=Je(o,s,l),d=E(c.state?.pathnameStackToGoBack,c.pathname);n(i,{state:{pathnameStackToGoBack:d}})},onBackClick:()=>{e(sn({fetchState:"Not-Started"}));const s=z(t.location.state?.pathnameStackToGoBack),i=s.poppedPathname??ft(0);t.navigate(i,{state:{pathnameStackToGoBack:s.newStack}}),e(lt())}}})(Jn);function Hi(){const e=K(),t=Y(),l=we(),{vendorId:n,billId:c}=ae(),r=se(),u=me(),o=V.getSignedInUser(),s=k(C=>Z(C)),i=z(t.state?.pathnameStackToGoBack),[d,p]=f.useState(!1),m=k(C=>C.vendorViewState.newVendorState.fetchStatus.fetchState),h=k(C=>n!=null?C.vendorViewState.editVendorStateById[n]?.fetchStatus.fetchState??"Not-Started":"Not-Started"),g=n!==void 0?h:m;f.useEffect(()=>{d===!1&&g==="Not-Started"&&n!=null&&(r(fe(!1,n)),p(!0))},[d,g,n]);const[b,v]=f.useState(!1);f.useEffect(()=>{b||g==="In-Progress"||(v(!0),r(nn(c,n)))},[b,g,r]);const P=i.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail",A=k(C=>ke(C,n));if(o==null)throw Error("Can't access international wire page without signing in...");return P==="billDetail"&&A.editVendorState?.saveStatus.fetchState==="In-Progress"?a.jsx(re,{fetchState:A.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:u.colors.grey5,boxShadow:`0px 2px ${x.sp1} ${u.colors.dropShadowNormal}`}}):a.jsxs(zi,{windowSize:l,children:[a.jsx(Ye,{vendorId:n,billId:c}),a.jsx(Zi,{location:t,navigate:e,billId:c,vendorId:n,currentTenant:s,bankAccountContext:P})]})}const ft=(e=2)=>{let t="../";for(let l=0;l<e;l++)t=`${t}../`;return t},vt=U.div`
|
|
111
|
+
display: flex;
|
|
112
|
+
height: 100vh;
|
|
113
|
+
width: 100%;
|
|
114
|
+
flex: 1 1 auto;
|
|
115
|
+
flex-direction: column;
|
|
116
|
+
align-items: center;
|
|
117
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
118
|
+
box-shadow: ${e=>`0px 2px ${x.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
119
|
+
`,Wi=J(function(e,t){const l=V.getSignedInUser(),n=zt(e,t.billId),c=mn(e),r=De(l),u=n.totalAmount.amount,o=n.billPayInfo?.stage.code!=="scheduled"&&c.allApprovalRules.length>0&&!Gt(u,c.allApprovalRules,l,n.vendor?.id,n.classId);return{billDetails:n,billId:t.billId,billpayApprovalView:c,analytics:D,isApprovalRequiredForMarkAsPaid:o,isZeniUser:r}},function(e,t){const{location:l,billId:n,currentTenant:c,navigate:r}=t,{tenantEmailDomain:u}=c;return{redirectToBillsScreen:()=>{const o=ie(c.tenantEmailDomain),s=E(l.state?.pathnameStackToGoBack,l.pathname);r(o,{state:{pathnameStackToGoBack:s}})},discardBillDetailsFromLocalStore:()=>{e(ve({}))},saveBillDetails:(o,s)=>{o&&e(Et({billId:n,data:s})),e(Ge(o?"paid":"pending_approval",o,!1,n))},discardOutsideZeniPaymentData:()=>{e(xt({billId:n}))},updateBillDetailSaveBillCode:()=>{e(Mt("pending_approval"))},onClickEdit:()=>{t.navigate("../",{relative:"path"})},onAttachmentClick:(o,s)=>{const i=je(u,o,s);window.open(`${i}`,"_blank")},retryPayment:()=>{t.billId!=null&&e(Be(t.billId,"retry"))}}})(ei);function kt(){const e=K(),t=se(),l=Y(),{billId:n}=ae(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isInternationalPaymentShaVsOurFeatureEnabled),{isFeatureEnabled:u}=c(y.isBillPayDetectInsufficientFundsEnabled),o=we(),s=V.getSignedInUser(),{isFeatureEnabled:i}=c(y.isBillPayLocalCurrencyFeatureEnabled),{isFeatureEnabled:d}=c(y.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:p}=c(y.isBillPayCommentingEnabled),m=z(l.state?.pathnameStackToGoBack),{poppedPathname:h}=m,{isFeatureEnabled:g}=c(y.isRecurringBillsFeatureEnabled),b=k(A=>Z(A)),v=k(A=>zt(A,n)),P=v.fetchState??"Not-Started";if(f.useEffect(()=>(window.onbeforeunload=function(){return e(l,{state:{message:""}}),!0},()=>{window.onbeforeunload=null}),[e]),f.useEffect(()=>{l.state?.message!=="coming_from_edit_page"&&e(`../${n}`)},[]),f.useEffect(()=>{const A=v.vendor?.name,C=v.vendor?.id,G=v.totalAmount.amount,j=v.recipientTotalAmount.amount,_=v.invoiceNumber;A&&C&&t(pn(A,C,G,j,_,n))},[]),h==null)return a.jsx(te,{to:`../${n}`});if(s==null)throw Error("Can't access address page without signing in...");return P==="In-Progress"?a.jsx(vt,{windowSize:o,children:a.jsx(Xn,{})}):a.jsx(vt,{windowSize:o,children:a.jsx(Wi,{location:l,navigate:e,currentTenant:b,billId:n,isBillPayCommentingEnabled:p,isLocalCurrencyEnabled:i,isVendorRecommendationEnabled:d,isInternationalPaymentShaVsOurEnabled:r,isRecurringBillsFeatureEnabled:g,isDetectInsufficientFundsEnabled:u})})}const qi=J(function(e,t){const{vendorId:l}=t,n=e.entityAutoCompleteState.autoCompleteText.common,c=Ze(e,"common"),r=l!=null?"edit":"create",u=Z(e),o=V.getSignedInUser(),s=u.tenantId,i={userId:o?.userId??"",sessionId:o?.zeniSessionId??"",tenantId:s??""};return{vendorViewDetails:t.vendorViewDetails,screenType:r,filesEndPoint:`${Ht.fileMicroServiceBaseUrl}`,authParams:i,analytics:D,vendorSearchAutoCompleteData:{autoCompleteText:n,entityAutoCompleteView:c}}},function(e,t){const{billId:l,currentTenant:n,navigate:c,location:r,vendorId:u,themeState:o}=t,{tenantEmailDomain:s}=n;return{onSaveVendor:i=>{e(Bn(u??void 0,t.billId)),i!=null&&e(xn(i))},saveVendorDetailLocalData:i=>{e(Nt({vendorId:u,localData:i}))},saveContactsInVendorDetailLocalData:i=>{e(Cn({vendorId:u,contacts:i}))},resetVendorDetailLocalData:()=>{e(st(u))},updateSelectedVendorForCreate:i=>{e(An(i))},navigateToBankDetailPage:(i,d)=>{let p;i==="wire"?p=d==="international"?qt(s,t.billId,u):di(s,t.billId,u):p=ci(s,t.billId,u);const m=E(r.state?.pathnameStackToGoBack,r.pathname);c(p,{state:{pathnameStackToGoBack:m}})},onRemoveBankAccount:(i,d)=>{e(d===!0?In(i,"vendor",u):wn(i,"vendor",u))},navigateToMailingAddressPage:i=>{const d=Je(s,i,l),p=E(r.state?.pathnameStackToGoBack,r.pathname);c(d,{state:{pathnameStackToGoBack:p}})},updateFilesEntity:i=>{e(kn({files:i}))},onEditFileName:(i,d)=>{e(vn(i,d.split(".")[0]))},handleZeniLogoClick:()=>{o.toggle()},updateSaveFetchState:()=>{u==null&&e(st(t.vendorViewDetails.newVendorState?.vendorBasic?.id)),e(fn("Not-Started",u))},onVendorSelected:i=>{i!=null&&e(Sn(i,!0))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,d)=>{i.trim().length>=2?e(He({searchString:i,entityType:d,searchOrigin:"common"})):i.trim().length===0&&e(oe("common"))},onCancelAutoComplete:()=>{e(oe("common"))}},onBackClick:()=>{e(oe("common"));const i=z(t.location.state?.pathnameStackToGoBack),d=i.poppedPathname??ri(n.tenantEmailDomain,t.billId);c(d,{state:{pathnameStackToGoBack:i.newStack}})},onGetOtp:i=>{e(yn(i,"BillPayVendor"))},onResendOtp:i=>{e(gn(i,"BillPayVendor"))},onVerifyOtp:(i,d)=>{e(hn(i,d,"BillPayVendor"))},onVerifyOtpSuccess:(i,d,p)=>{e(bn(i,d,p))},onFetchAndUpdateVendorRecommendations:i=>{e(Ot(i,!1))}}})(ii),Ce=()=>{const e=K(),t=se(),l=ti(),n=Y(),{billId:c,vendorId:r}=ae(),u=k(b=>Z(b)),{useFeatureGate:o}=le(),{isFeatureEnabled:s}=o(y.isBillPayLocalCurrencyFeatureEnabled),[i,d]=f.useState(!1),p=k(b=>b.vendorViewState.newVendorState.fetchStatus.fetchState),m=k(b=>ke(b,r)),h=k(b=>r!==void 0?b.vendorViewState.editVendorStateById[r]?.fetchStatus??"Not-Started":"Not-Started"),g=r!==void 0?h:p;return f.useEffect(()=>{i===!1&&g==="Not-Started"&&r!=null&&(t(fe(!1,r)),d(!0))},[i,g,r]),m.fetchState==="Not-Started"||m.fetchState==="In-Progress"?a.jsx(ai,{}):g==="Error"?a.jsx(ni,{onGoHome:()=>e("../",{replace:!0}),onReload:()=>window.location.reload()}):a.jsxs(a.Fragment,{children:[a.jsx(Ye,{vendorId:r,billId:c}),a.jsx(qi,{navigate:e,location:n,themeState:l,currentTenant:u,vendorId:r,billId:c,vendorViewDetails:m,isLocalCurrencyEnabled:s})]})},Qi=J(function(e,t){const{companyId:l}=t;return{billPaySetupView:En(e,l),analytics:D,meetingUrl:"https://meetings.hubspot.com/snehals/demo-bill-pay?embed=true",videoUrl:"https://player.vimeo.com/video/787873426?h=9d9389b1dc&badge=0&autopause=0&player_id=0&app_id=58479"}},function(e,t){const{companyId:l,navigate:n}=t;return{onButtonClick:()=>{e(Dn(l))},onBackClick:()=>{n("../..",{relative:"path"})},onSetupBillPaySuccess:()=>{n("../bills/setup",{relative:"path"})}}})(oi),Ki=()=>{const e=K(),t=Y(),{tenantEmailDomain:l}=ae(),[n,c]=f.useState(!1),r=me(),u=k(h=>Z(h)),o=u.companyId??V.getSignedInUserTenant(l)?.companyId,s=V.getSignedInUser(),i=Ie(),d=!!u.companyBillPayInfo?.info?.isBillPayTOSAccepted,p=pe(i?.loggedInUserRoleMap),m=h=>{c(h)};if(s==null)throw Error("Can't access bill pay promo page without signing in...");return u.companyBillPayInfo?.info?.isBillPayEnabled===!0?a.jsx(te,{to:"../../../bills"}):d===!0&&p===!0?a.jsx(te,{to:"../../bills/setup"}):d===!1||i!=null&&ze(u,i.loggedInUserRoleMap)?a.jsxs(a.Fragment,{children:[a.jsx(Pe,{analytics:D,onLoad:h=>(g=>g.trackPageLoaded(Wt.Event.billPayPromoPage))(h)}),a.jsx(Kt,{isAppContentDrawerOpen:n,handleDrawerToggle:m}),a.jsx(Qi,{companyId:o,navigate:e,location:t,onClickMenuIcon:()=>{m(!0)}})]}):a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:r.colors.grey5}})};function Do(){const e=k(M=>Z(M)),t=Ie(),l=pe(t?.loggedInUserRoleMap),n=me(),{useFeatureGate:c}=le(),{isFeatureEnabled:r}=c(y.isBillPayLocalCurrencyFeatureEnabled),u=r===!0?Hi:Ni,{isFeatureEnabled:o}=c(y.isDebitCardFeatureEnabled),s=Vt(o,e),i=$t(e),d=Y(),p=e?.userRole!=null&&It(e?.userRole),m=(e?.company==null||e.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!p)&&pe(t?.loggedInUserRoleMap),h=Rt(t?.loggedInUserRoleMap),g=(e?.company==null||e.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!p)&&Pn(t?.loggedInUserRoleMap),{isFeatureEnabled:b}=c(y.isDepositAccountsFeatureEnabled),v=b&&!p&&Lt(t?.loggedInUserRoleMap),{isFeatureEnabled:P}=c(y.isChargeCardFeatureEnabled),A=li(e,P,o)&&!p&&jn(t?.loggedInUserRoleMap),C=Tn(t?.loggedInUserRoleMap),G=Ut(t?.loggedInUserRoleMap),j=Fn(t?.loggedInUserRoleMap),_=Rn(t?.loggedInUserRoleMap),$=Vn(t?.loggedInUserRoleMap),I=$n(t?.loggedInUserRoleMap),{tenantEmailDomain:H}=ae();return a.jsxs(ia,{children:[d.pathname.includes("/bills")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"setup",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:C,productType:"bill_pay",type:"setup"})}),a.jsx(S,{path:"verification",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:C,productType:"bill_pay",type:"verification"})}),a.jsx(S,{path:"promo",element:a.jsx(Ki,{})}),a.jsx(S,{path:"approval-rules/*",element:m?a.jsx(pi,{}):a.jsx(mi,{isUserHasZeniAccountsAccess:G,isUserHasChargeCardAccess:_,isUserHasBillPayAccess:$,isUserHasReimbursementAccess:I,isUserHasTreasuryAccess:j,isTenantBankingOnly:s,tenantEmailDomain:H??""})}),a.jsx(S,{path:"international-wire",element:a.jsx(Te,{isBillPayAdminLevelAccess:m,isUserHasOnlyBillPayAccess:h,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:v,isChargeCardAdminLevelAccess:A,isUserHasOnlyCardAccess:C,productType:"bill_pay",type:"international-wire"})}),e.companyBillPayInfo?.info?.isBillPayEnabled===!0&&a.jsx(S,{path:"*",element:a.jsx(Pi,{})}),(s===!0||i===!0)&&a.jsx(S,{path:"/*",element:a.jsx(Yt,{})}),e.companyBillPayInfo?.info?.isBillPayTOSAccepted===!0&&l&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../setup"})}),t!=null&&ze(e,t.loggedInUserRoleMap)&&a.jsx(S,{path:"*",element:a.jsx(te,{to:"../promo"})})]}):d.pathname.includes("/bill")?a.jsxs(a.Fragment,{children:[a.jsx(S,{path:"new",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:":billId",element:a.jsx(w,{appContent:a.jsx(hi,{})})}),a.jsx(S,{path:":billId/edit",element:a.jsx(w,{appContent:a.jsx(gt,{})})}),a.jsx(S,{path:"new/review",element:a.jsx(w,{appContent:a.jsx(kt,{})})}),a.jsx(S,{path:":billId/edit/review",element:a.jsx(w,{appContent:a.jsx(kt,{})})}),a.jsx(S,{path:"/:billId/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"/new/:addressType",element:a.jsx(w,{appContent:a.jsx(dt,{isSubPage:!0})})}),a.jsx(S,{path:"new/vendor/create",element:a.jsx(w,{appContent:a.jsx(Ce,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Ce,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"new/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:"new/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:"new/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create",element:a.jsx(w,{appContent:a.jsx(Ce,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit",element:a.jsx(w,{appContent:a.jsx(Ce,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/:vendorId/edit/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/ach",element:a.jsx(w,{appContent:a.jsx(he,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/domestic",element:a.jsx(w,{appContent:a.jsx(ge,{})})}),a.jsx(S,{path:":billId/edit/vendor/create/international",element:a.jsx(w,{appContent:a.jsx(u,{})})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]}):a.jsx(S,{path:"*",element:a.jsx(re,{fetchState:"In-Progress",style:{backgroundColor:n.colors.grey5,boxShadow:`0px 2px ${x.sp1} ${n.colors.dropShadowNormal}`}})}),a.jsx(S,{path:"*",element:a.jsx(Ee,{})})]})}export{Do as default};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import{j as C}from"./liveblocks-CS5BWhh3.js";import{a as V}from"./sentry-C6Nz2b7l.js";import{h as ae,g as ne,u as se,i as oe,j as k,N as ie,n as re}from"./core-Cup6-Vv9.js";import{T as ce,W as ue,aR as de,z,Y as pe,d as B,af as x,f as E,bI as le,at as me,r as P,au as M}from"./index-DPagvN_p.js";import{PV as fe,eW as G,tC as ye,Kf as Se,zx as ge,CY as Ie,FJ as he,Gm as be,Hm as Te,Qg as De,Qh as Oe,Qi as Ce,Qj as ke,Qk as Ve,MI as we,Pi as Ae,MX as Ne,E0 as Fe,MY as _e,E4 as ve,ld as xe,gh as Ee,gg as ze,gf as Be,rC as Pe,rt as Me,rq as Re,l5 as Ue,tL as Le,tJ as R,bE as U,tX as L,cy as je}from"./zeni-epic-state-CjyX3VL3.js";import{n as Ge}from"./mui-LoCcantR.js";import{d as j}from"./routePaths-Dj0dWV1_.js";import{M as Qe}from"./MobileAppDrawer-HA-p_xT8.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},d=new t.Error().stack;d&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[d]="af32078e-0829-4275-ab48-8b753b574732",t._sentryDebugIdIdentifier="sentry-dbid-af32078e-0829-4275-ab48-8b753b574732")}catch{}})();const qe=Ge.div`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
width: 100%;
|
|
5
|
+
flex: 1 1 auto;
|
|
6
|
+
flex-direction: column;
|
|
7
|
+
align-items: center;
|
|
8
|
+
background-color: ${t=>t.theme.colors.grey4};
|
|
9
|
+
`,We=re(function(t,d){const{businessVerificationDetails:n}=d,r=G(t),y=z.getSignedInUser(),S=r.tenantId,l={userId:y?.userId??"",sessionId:y?.zeniSessionId??"",tenantId:S??""},b=we(d.roleMap)&&n.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=Ae(t.companyConfigState),s=Ne(t.userRoleConfigState);return{businessVerificationDetails:n,verficationDetailsFetchState:n.fetchState,isRefreshingViewInBackground:n.isRefreshingViewInBackground,allNationalityCountries:n.allNationalityCountries,filesEndPoint:`${me.fileMicroServiceBaseUrl}`,authParams:l,isDisabled:b,allIndustries:e.companyIndustries??[],companyTitles:s.companyTitles}},function(t,d){const{companyId:n,productType:r,currentTenant:y,navigate:S,location:l}=d,{tenantEmailDomain:b}=y;return{onCompanyDetailsChanged:e=>{const{companyDescription:s,companyIndustry:p,companyIndustryType:D,companyLegalName:O,companyTaxId:g,companyWebsite:m,companyPhone:I,primaryContactEmail:c,primaryContactName:o,primaryContactUserId:u,primaryContactSyncToken:T,syncToken:f,fileIds:a,incDate:i,typeOfIncorporation:w,stateOfIncorporation:A,sourceOfFunds:N,companySubIndustry:F,countriesOfOperations:h,companySourceOfFunds:Q,companySourceOfFundsDescription:q,transactionVolume:W,transactionVolumeDescription:Y,purposeOfAccount:J,purposeOfAccountDescription:X,regulatedStatus:Z,regulatedStatusDescription:$,usNexus:H,usNexusTypes:K}=e,_=D?.selectedOption,ee={companyId:n,companyDescription:s,companyIndustry:p.selectedOption,companyIndustryType:_==null||_===""?void 0:_,companyLegalName:O,taxIdOrEIN:g,website:m!=""&&m!=null?je(m):void 0,phone:I,syncToken:f,fileIds:a,incDate:i!=null?U(i?.toString()):i,typeOfIncorporation:w?.selectedOption??"",stateOfIncorporation:A?.selectedOption??"",sourceOfFunds:N?.selectedOption??"",companySubIndustry:F?.selectedOption??"",countriesOfOperations:h?.selectedOptions.map(v=>v.length===2?v:M(v))??[],companySourceOfFunds:Q?.selectedOption??"",companySourceOfFundsDescription:q,transactionVolume:W?.selectedOption??"",transactionVolumeDescription:Y,purposeOfAccount:J?.selectedOption??"",purposeOfAccountDescription:X,regulatedStatus:Z??"",regulatedStatusDescription:$,usNexus:H,usNexusTypes:K?.selectedOptions??[]},te={userId:u,firstName:o.firstName,lastName:o.lastName,email:c,syncToken:T};t(L({companyDetails:ee,primaryContactDetails:te}))},onCompanyOfficerUpdated:e=>{const s=e.map(p=>{const{officerType:D,userId:O,name:g,email:m,nationalityCountryCode:I,ssn:c,dob:o,phone:u,syncToken:T,selectDocument:f,role:a,ownership:i,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:F}=p;let h;return f.selectDocumentType==="driverLicense"?h="driving_license":f.selectDocumentType==="passport"?h="passport":f.selectDocumentType==="stateId"?h="id_document":f.selectDocumentType==="ssnCard"&&(h="social_security_card"),{officerType:D,userId:O,firstName:g.firstName,lastName:g.lastName,email:m,ssn:c,nationalityCountryCode:I?.selectedOption!=null?M(I.selectedOption):void 0,phone:u,birthday:o!=null?U(o?.toString()):o,syncToken:T,titleAtCompany:a.selectedOption,ownershipInCompany:i,documentTypeSelectedForVerification:h,isSelectedForVerification:w,userVerificationStatus:A,treasuryUserVerificationStatus:N,fileIds:F,additionalDocumentTypesRequestedForVerification:[],additionalSubmittedDocumentsForVerificationFileIds:[],areAdditionalDocumentsRequestedForVerification:!1,areAdditionalDocumentsSubmittedForVerification:!1}});t(L({officers:s}))},onSaveDetailsClick:e=>{t(R(n,e,r))},onSendForVerificationClick:e=>{t(R(n,e,r,!0))},onAddressClick:e=>{const s=j(b,e),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onRegisteredAddressClick:e=>{const s=j(b,e),p=P(l.state?.pathnameStackToGoBack,l.pathname);S(s,{state:{pathnameStackToGoBack:p}})},onBackClick:()=>{t(Le({companyId:n})),S("../setup")},updateFilesEntity:e=>{t(Ue({files:e}))},onDeleteFile:e=>{t(Re(e))},onDeleteFileList:e=>{t(Me(e))},onEditFileName:(e,s)=>{t(Pe(e,s.split(".")[0]))},onGetOtp:e=>{t(Be(e,"SpendManagementSetup"))},onResendOtp:e=>{t(ze(e,"SpendManagementSetup"))},onVerifyOtp:(e,s)=>{t(Ee(e,s,"SpendManagementSetup"))},saveNewAddressInLocalStore:(e,s)=>{t(xe({addressType:e,addressToCreate:s}))},onIdentityDocumentUploadedForAutofill:e=>{if(n==null)return;const s=_e(e.documentType);s!=null&&t(ve({target:"setup",companyId:n,officerType:e.officerType,fileId:e.fileId,documentType:s}))},onCompanyDocumentUploadedForAutofill:e=>{n!=null&&t(Fe({target:"setup",companyId:n,fileId:e.fileId,documentType:e.documentType}))}}})(le),tt=({productType:t})=>{const d=ae(),n=ne(),r=se(),[y,S]=V.useState(!1),[l,b]=V.useState(!1),{tenantEmailDomain:e}=oe(),s=ce(),{useDynamicConfig:p}=ue(),{configValue:D}=p(de.zeniAccountsConfig),O=fe(D),g=k(a=>{switch(t){case"zeni_accounts":return a.zeniAccountSetupViewState.fetchState;case"reimbursement":return a.remiSetupViewState.fetchState;case"charge_cards":return a.chargeCardSetupViewState.fetchState;case"zeni_treasury":return a.treasurySetupViewState.fetchState;default:return a.billPaySetupViewState.fetchState}}),m=k(a=>a.companyConfigState.fetchState),I=k(a=>a.userRoleConfigState.fetchState),c=k(a=>G(a)),o=c.companyId??z.getSignedInUserTenant(e)?.companyId;if(V.useEffect(()=>{m==="Not-Started"&&r(ye()),I==="Not-Started"&&r(Se(!0))},[m,I,r]),V.useEffect(()=>{if(!y&&g==="Not-Started"&&o!=null)switch(S(!0),t){case"zeni_accounts":r(Te(o,!0));break;case"zeni_treasury":r(be(o,!0));break;case"reimbursement":r(he(o,!0));break;case"charge_cards":r(Ie(o,!0));break;default:r(ge(o,!0))}},[y,g,o,r]),z.getSignedInUser()==null)throw Error("Can't access business verification without signing in...");let u;switch(t){case"zeni_accounts":u=c.companyZeniAccountInfo?.info?.isZeniAccountTOSAccepted;break;case"reimbursement":u=c.companyReimbursementInfo?.info?.isReimbursementTOSAccepted;break;case"charge_cards":u=c.companyChargeCardInfo?.info?.isChargeCardTOSAccepted===!0||c.companyDebitCardInfo?.info?.isDebitCardTOSAccepted;break;case"zeni_treasury":u=c.companyTreasuryInfo?.info?.isTreasuryTOSAccepted;break;default:u=c.companyBillPayInfo?.info?.isBillPayTOSAccepted}const T=a=>{b(a)},f=k(a=>{let i;switch(t){case"zeni_accounts":i=Ve(a,o);break;case"zeni_treasury":i=ke(a,o);break;case"charge_cards":i=Ce(a,o);break;case"reimbursement":i=Oe(a,o);break;default:i=De(a,o)}return i});return u===!1?C.jsx(ie,{to:"../promo"}):C.jsxs(qe,{children:[C.jsx(pe,{analytics:B,onLoad:a=>(i=>{switch(t){case"zeni_accounts":return i.trackPageLoaded(E.Event.zeniAccountsBusinessVerification);case"reimbursement":case"charge_cards":return i.trackPageLoaded(E.Event.reimbursementBusinessVerification);default:return i.trackPageLoaded(E.Event.billPayBusinessVerification,x(n)?"Settings":void 0)}})(a)}),x(n)?C.jsx(Qe,{isAppContentDrawerOpen:l,handleDrawerToggle:T}):null,C.jsx(We,{businessVerificationDetails:f,navigate:d,location:n,companyId:o,analytics:B,currentTenant:c,productType:t,isSettings:x(n),roleMap:s?.loggedInUserRoleMap??{},onClickMenuIcon:()=>{T(!0)},maxInsuredAmount:O.maxInsuredAmount})]})};export{tt as B};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import{j as g}from"./liveblocks-CS5BWhh3.js";import{a as l}from"./sentry-C6Nz2b7l.js";import{u as me,h as he,g as fe,j as R,i as Ce,n as Se}from"./core-Cup6-Vv9.js";import{M as ge,db as be,z as ye,dc as Pe,de as z,df as Ie,b9 as W,Y as we,d as $,dg as H,dq as Ee,a as ke,f as Ae,a7 as Te,dj as xe,dk as Ue,a2 as _e,dn as Oe,b5 as ve,dp as Qe}from"./index-DPagvN_p.js";import{gl as Fe,eV as G,eW as $e,fp as Ve,iK as De,iG as Le,eX as B,g6 as je,f$ as qe,g3 as N,g7 as Me,g8 as Re,g9 as He,ga as Be,gb as Ne}from"./zeni-epic-state-CjyX3VL3.js";import{D as ze,n as D,P as We,S as Ge}from"./mui-LoCcantR.js";import"./recharts-Dle8N8vU.js";import"./analytics-CJCMq6iU.js";import"./plaid-DFwM1Utp.js";import"./dnd-NJKg6PM2.js";import"./stripe-DMRn4zHo.js";import"./lottie-DdOZ7-9e.js";import"./lexical-enPzRBRr.js";import"./pdf-BqUsw-Gt.js";import"./utils-CSqwFRZv.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]="fff22b34-8399-45a4-9ed8-1be02e9c645d",e._sentryDebugIdIdentifier="sentry-dbid-fff22b34-8399-45a4-9ed8-1be02e9c645d")}catch{}})();const Y="chat-response-generated",K="cards/ask",X="card_policy_hero";function V(e){return`/${e}/cards`}function Z(e){return`/${e}/cards/policy`}const Ye=Se(function(e,a){const o=G(e),c=a.isSubmitting,d=Ue(e,{allUsers:a.allUsers,onCardPolicyVendorSearchTextChange:a.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:a.sessionFromUrl==="new_chat"&&o.uiState.currentChatSessionId==null,aiCfoView:o,isSubmitting:c,isNewChatSession:a.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,emailLinkQuestion:a.emailLinkQuestion,autoSubmitEmailLinkQuestion:a.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:a.onEmailLinkQuestionProcessed,isFileUploadEnabled:a.isFileUploadEnabled,isUploadPromoVisible:a.isUploadPromoVisible,onUploadPromoClose:a.onUploadPromoClose,...d}},function(e,a){const{location:o,currentTenant:c,userId:d,navigate:p,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:E,isAiCardCreationEnabled:T,isCardPolicyEnabled:x,cardPolicyPageContext:U}=a,i=c.tenantEmailDomain,f=o.state?.referrer,m=f===X?Z(i):V(i);return{onEventReceived:(n,t)=>{if(n===Y&&typeof t.text=="string"&&typeof t.metadata=="object"){const s=t,C=Re(s.type),b=s.metadata.chat_session_id??null,{currentChatSession:y,currentQuestionAnswer:u,currentQuestionAnswerSummary:P}=W(E,b);C!=="answer"?$.trackAICFOChatResponseGenerated(C,u?.question.questionText??"",s.text,b,Qe(P,y),s.metadata.message_id??null):$.trackAICFOChatAnswerGenerated(s.text,u?.question.questionText??"",(s.follow_up_questions?.length??0)>0,!!s.assumptions,!!s.insights,s.visualization!=null,He(s.visualization?.type??"")??null,b,s.summarized_title,s.metadata.message_id??null),e(Be({chatSessionId:s.metadata.chat_session_id,responseType:C,fetchState:{fetchState:"Completed",error:void 0}})),e(Ne({chatSessionId:s.metadata.chat_session_id,answerPayload:s,userId:d}))}},onSubmit:(n,t,s,C)=>{n&&ve(e,n,t,h,E,d,C,s,U)},updateCurrentInput:n=>{e(N(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{e(Me(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{p(m,{state:{...o.state}}),e(N(""))},togglePageView:()=>{p(m,{state:z(o.state)}),a.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{h!=null&&e(qe()),p(function(n){return`/${n}/${K}`}(i),{state:{...o.state}})},onToggleCotCollapsed:(n,t)=>{e(je({questionAnswerId:n,isCollapsed:t}))},...Oe(e,{isAiCardCreationEnabled:T,isCardPolicyEnabled:x,currentChatSessionId:h,onAfterCardsCreationSubmit:()=>{a.setIsAiCfoOpen(!0),p(V(i),{state:{...o.state}})},onAfterCardPolicySubmit:()=>{a.setIsAiCfoOpen(!0),p(`/${i}/cards/policy`,{state:{...o.state}})}})}})(Te(xe)),{spendManagement:{chargeCard:{cardsAiCfoHero:J,cardPolicyAiCfoHero:ee}}}=ke.getLocalizedStrings(),A=J.pageTitle,Ke=ee.pageTitle,Xe=J.chatHeaderSubtitle,Ze=ee.chatHeaderSubtitle,St=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:a}=ge(),o=me(),c=he(),d=fe(),[p,h]=l.useState(!1),{allUsers:E,isAiCardCreationEnabled:T,isCardPolicyEnabled:x,onCardPolicyVendorSearchTextChange:U}=be();l.useEffect(()=>{o(Fe())},[o]);const i=R(r=>G(r)),f=ye.getSignedInUser(),{session_id:m}=Ce(),n=R(r=>$e(r)),t=i.uiState.currentChatSessionId,s=n.tenantEmailDomain,{handleUploadPromoClose:C,isUploadPromoVisible:b}=Pe({isFileUploadEnabled:e,tenantEmailDomain:s}),y=d.state,u=y?.aiCfoInitialQuestion??null,P=!!y?.aiCfoShouldSubmit,I=y?.referrer===X,te=I?"card_policy":void 0,se=l.useMemo(()=>({title:I?Ke:A,subtitle:I?Ze:Xe}),[I]),[ae,_]=l.useState(null),[oe,O]=l.useState(!1),v=l.useRef(!1);l.useEffect(()=>{v.current||u==null||u===""||(_(u),O(P),v.current=!0)},[u,P]);const ne=l.useCallback(()=>{_(null),O(!1),c(d.pathname,{replace:!0,state:z(d.state)})},[d.pathname,d.state,c]),ie=n.masterTOSInfo,S=ie?.isMasterTOSAccepted??!1,k=l.useRef(null);l.useEffect(()=>{if(S&&k.current!=null){const{question:r,shouldSubmit:w}=k.current;k.current=null,_(r),O(w),v.current=!1}},[S]);const{visitedSessions:L}=Ie(t),Q=i.fetchState,F=i.uiState.chatSessionsNextPageToken.hasMore||!i.uiState.chatSessionsFirstPageFetched,j=t!=null?i.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",q=t==null||(i.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),M=i.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:re}=W(M,t),le=re.length===0;l.useEffect(()=>{t!=null&&m!==t&&c(function(r,w){return`/${r}/${K}/${w}`}(s,t),{state:{...d.state},replace:!0})},[t,m,s,c,d.state]),l.useEffect(()=>{m!=null&&t==null&&m!=="new_chat"&&o(Ve({sessionId:m,agentId:"controller"}))},[]);const de=l.useMemo(()=>({events:L.map(r=>`private-encrypted-chat-${r}.${Y}`),eventCallback:(r,w,pe)=>pe.onEventReceived(r,w)}),[L]);if(l.useEffect(()=>{Q!=="In-Progress"&&F&&o(De())},[Q,F,o]),l.useEffect(()=>{t!=null&&j!=="In-Progress"&&q&&f!=null&&Q==="Completed"&&!F&&o(Le(t,f.userId))},[j,q,t,f,o]),f==null)throw Error("Can't access Cards AI CFO page without signing in...");const ce=m??"new_chat",ue=t!=null&&i.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return g.jsxs(et,{children:[g.jsx(we,{analytics:$,onLoad:r=>r.trackPageLoaded(Ae.Event.aiCFOPage)}),S?g.jsx(Ye,{...de,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:M,allUsers:E,isAiCardCreationEnabled:T,isCardPolicyEnabled:x,openOnboardingPage:()=>h(!0),userId:f.userId,setIsAiCfoOpen:a,navigate:c,sessionFromUrl:ce,location:d,isSubmitting:ue,isEmptyChatWithSession:le,customPageTitle:A,chatHeader:se,currentTenant:n,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:oe,onEmailLinkQuestionProcessed:ne,isFileUploadEnabled:e,isUploadPromoVisible:b,onUploadPromoClose:C,onCardPolicyVendorSearchTextChange:U,cardPolicyPageContext:te}):g.jsx(H,{isTOSAccepted:S,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:A,onCloseClick:()=>{c(I?Z(s):V(s),{state:{...d.state}})},onCompleteClick:()=>{S||n.userRoleId==null||(u!=null&&u!==""&&(k.current={question:u,shouldSubmit:P}),o(B(n.userRoleId)))}}),g.jsx(ze,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:tt,style:{width:`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:g.jsx(Je,{onClick:r=>r.stopPropagation(),children:g.jsx(H,{isTOSAccepted:S,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:A,onCloseClick:()=>h(!1),onCompleteClick:()=>{S||n.userRoleId==null||o(B(n.userRoleId)),h(!1)}})})})]})},Je=D(Ge)`
|
|
2
|
+
display: flex;
|
|
3
|
+
min-height: 100%;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
`,et=D.div`
|
|
6
|
+
flex: 1 1 auto;
|
|
7
|
+
display: flex;
|
|
8
|
+
flex-direction: column;
|
|
9
|
+
min-height: 0;
|
|
10
|
+
width: 100%;
|
|
11
|
+
`,tt=D(We)`
|
|
12
|
+
box-shadow: ${({theme:e})=>e.colors.elevation2};
|
|
13
|
+
color: ${({theme:e})=>e.colors.grey4};
|
|
14
|
+
`;export{St as default};
|