@zeniai/web-app-ui 5.3.38-qa → 5.3.39-dev
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{AccountMappingScreen-CrS7Kdhn.js → AccountMappingScreen-FWj5nDCB.js} +2 -2
- package/dist/assets/AddressRoutes-dITHyqGL.js +1 -0
- package/dist/assets/{AddressScreen-FiUJPHkQ.js → AddressScreen-BIEQJvnM.js} +1 -1
- package/dist/assets/{AiCfoScreen-q_7YX_nM.js → AiCfoScreen-Cz0j_M5z.js} +1 -1
- package/dist/assets/AppDrawer-BuP9gKqv.js +10 -0
- package/dist/assets/{BillPayApprovalRoutes-BfVotXG7.js → BillPayApprovalRoutes-qxr0yuTv.js} +1 -1
- package/dist/assets/BillPayRoutes-ttvWs4tK.js +119 -0
- package/dist/assets/{BusinessVerificationPageScreen-BbEcHB5F.js → BusinessVerificationPageScreen-CLz9Vhow.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-B5HD60oM.js → CardsAiCfoScreen-DHb-4cGz.js} +1 -1
- package/dist/assets/{ChargeCardRoutes-BHltIna0.js → ChargeCardRoutes-DeuDoclT.js} +1 -1
- package/dist/assets/CompanyPassportScreen-j7OCjtB_.js +1 -0
- package/dist/assets/{ConnectionAuthScreen-PqiWgpgl.js → ConnectionAuthScreen-Bt13WQgM.js} +2 -2
- package/dist/assets/CustomerOnboardingAuthScreen-op0Bb-DP.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-cRAk7rF8.js → CustomerOnboardingRoutes-CBVh4ilH.js} +1 -1
- package/dist/assets/{DashboardRoutes-BXnean8e.js → DashboardRoutes-BrF1lo9A.js} +1 -1
- package/dist/assets/{DefaultTenantHome-BUpeXXFg.js → DefaultTenantHome-2ECnohy5.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-DVTNWHf6.js +18 -0
- package/dist/assets/{DrawerScreen-CfBaFUKA.js → DrawerScreen-DkSWP8ho.js} +1 -1
- package/dist/assets/{EntityDetailRoutes-CxGDk0UB.js → EntityDetailRoutes-Cm53bHLv.js} +1 -1
- package/dist/assets/{ExpenseAutomationRoutes-DaMemxd2.js → ExpenseAutomationRoutes-D2vZzdqI.js} +1 -1
- package/dist/assets/FeaturePreviewScreen-DjxhsBnU.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-OFmJvPcA.js → HubSpotOAuthCallbackScreen-D50cHVg9.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-BSgZT9XB.js → InboxNotificationsProvider-8Zmc_gz4.js} +1 -1
- package/dist/assets/{InvoicingRoutes-Bw8uyf_X.js → InvoicingRoutes-D9GR_W5o.js} +1 -1
- package/dist/assets/{MagicLinkRoutes-D3Bpse1r.js → MagicLinkRoutes-j2CEjUSl.js} +18 -18
- package/dist/assets/{MagicLinkSignInScreen-74RUTSaI.js → MagicLinkSignInScreen-B0BIotEJ.js} +1 -1
- package/dist/assets/MobileAppDrawer-k5UN-ZVo.js +1 -0
- package/dist/assets/NotFoundScreen-DsHUR7rB.js +1 -0
- package/dist/assets/{NotificationRoutes-B86tRrCv.js → NotificationRoutes-NcOHp3Rt.js} +1 -1
- package/dist/assets/{OAuthConsentScreen-CQT6ZRIz.js → OAuthConsentScreen-CeflpTfa.js} +1 -1
- package/dist/assets/PandLWithForecastRoutes-7gkjqDl7.js +1 -0
- package/dist/assets/PaymentLinkScreen-DTV-Pj9Z.js +21 -0
- package/dist/assets/PeopleRoutes-B8cAEqrr.js +22 -0
- package/dist/assets/{PerformanceRoutes-U2KpwSXR.js → PerformanceRoutes-B8bQPf4Z.js} +1 -1
- package/dist/assets/{Preview-BowrR3Lc.js → Preview-DWkLgR2o.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-DpBki0yd.js → QBOConnectionScreen-D_CvuPpu.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-CDiE4oCm.js → ReimbursementApprovalRoutes-BuNkcrV5.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-Cr-o3b5d.js → ReimbursementApprovalRuleDetailScreen-BjlM_mON.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-DTF60Z_6.js → ReimbursementRoutes-i4PYSWi1.js} +1 -1
- package/dist/assets/{ReportsRoutes-Ky-HWwEx.js → ReportsRoutes-0G-HMg8l.js} +1 -1
- package/dist/assets/RewardsRoutes-CsB0ZcvU.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-Sv3ki1z7.js → ScheduleDetailsPrepaidExpensesScreen-0OK7ToFy.js} +4 -4
- package/dist/assets/{ScreenRoutes-D-c6C0zC.js → ScreenRoutes-vlNTU8kU.js} +2 -2
- package/dist/assets/{SettingsRoutes-BPnYMW-X.js → SettingsRoutes-Bt4-uRzg.js} +1 -1
- package/dist/assets/{SetupPagesScreen-D-xfgaAT.js → SetupPagesScreen-f0SRzJjQ.js} +5 -5
- package/dist/assets/{SignInScreen-Dydn9CFH.js → SignInScreen-CtB5-K2A.js} +1 -1
- package/dist/assets/{SignOutScreen-CU7CgvpO.js → SignOutScreen-G2jd57YT.js} +1 -1
- package/dist/assets/{TaskListScreen-lSA8hF_F.js → TaskListScreen-CdQh3lN1.js} +2 -2
- package/dist/assets/{TaskRoutes-Bq4tzQOr.js → TaskRoutes-DdHB85T2.js} +1 -1
- package/dist/assets/TransactionDetailRoutes-CV_cfeg-.js +1 -0
- package/dist/assets/{TransactionDetailScreen-ChIu7aYA.js → TransactionDetailScreen-42QtBhCQ.js} +2 -2
- package/dist/assets/{TransactionListRoutes-CGI1oWmx.js → TransactionListRoutes-B2bsdM-b.js} +1 -1
- package/dist/assets/{TreasuryRoutes-BeboHVes.js → TreasuryRoutes-vIX4VvXk.js} +5 -5
- package/dist/assets/{VendorsRoutes-Ba5yfHiE.js → VendorsRoutes-CTCv940U.js} +1 -1
- package/dist/assets/{WiseConfirmationScreen-BXeU-_Jp.js → WiseConfirmationScreen-IVMtqt-F.js} +1 -1
- package/dist/assets/{ZeniAccountRoutes-dATmiEff.js → ZeniAccountRoutes-zMcMqczO.js} +7 -7
- package/dist/assets/{ZeniAccountStatementScreen-Dz5DmZUw.js → ZeniAccountStatementScreen-g-TFof3Y.js} +1 -1
- package/dist/assets/{accountMappingHelper-D1ooT5ik.js → accountMappingHelper-65Fk5KmX.js} +1 -1
- package/dist/assets/{analytics-B-TvIB4L.js → analytics-MT8j1Arr.js} +1 -1
- package/dist/assets/{analyticsHelper-h8-gsFza.js → analyticsHelper-CPeGk6N0.js} +1 -1
- package/dist/assets/{core-DCcrGtvx.js → core-DHfFJrfH.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-DRhUPcmy.js → decodeURIComponentSafe-DnV8TwS0.js} +1 -1
- package/dist/assets/{dnd-2zpntaNq.js → dnd-DG4Q4PBR.js} +1 -1
- package/dist/assets/{empty-B19z0k-e.js → empty-C4nhKt0e.js} +1 -1
- package/dist/assets/{empty-Dxu9O_8o.js → empty-Hx6SHn8J.js} +1 -1
- package/dist/assets/{emptyVideoElement-CnRa5yg_.js → emptyVideoElement-CC_ubHbs.js} +1 -1
- package/dist/assets/{epic-BY-2iLAv.js → epic-DB3K9lI8.js} +1 -1
- package/dist/assets/{expenseAutomationHelper-f_QoLd6I.js → expenseAutomationHelper-_DN5nYaA.js} +1 -1
- package/dist/assets/{getLocaleForTenant-D5JM1AN5.js → getLocaleForTenant-D_V8_IAs.js} +1 -1
- package/dist/assets/{index-BZiRU33w.js → index-Bhv9wCBS.js} +2 -2
- package/dist/assets/{index-Bw4k26Lh.js → index-BxJdVany.js} +24843 -24851
- package/dist/assets/{index-aKBWBndf.js → index-DvBr-xKR.js} +1 -1
- package/dist/assets/{index-B-oucDGH.js → index-_NjLBS-r.js} +1 -1
- package/dist/assets/{index-CIXC3jYt.js → index-dAj1V_OM.js} +1 -1
- package/dist/assets/{index-CInKAei6.js → index-jFW7Wxrg.js} +1 -1
- package/dist/assets/{index-C08EGy81.js → index-scA92wXl.js} +1 -1
- package/dist/assets/{index-_CCFU0py.js → index-x4bVdiy8.js} +1 -1
- package/dist/assets/{lexical-YhB7nNuN.js → lexical-Ds-L3Ehk.js} +1 -1
- package/dist/assets/{liveblocks-CyXsV56c.js → liveblocks-CPy_3T4M.js} +1 -1
- package/dist/assets/{lottie-ZAIvsM-R.js → lottie-CPIsfbGQ.js} +1 -1
- package/dist/assets/{mui-ezTHtwEe.js → mui-BCtxe7Uc.js} +1 -1
- package/dist/assets/{pathToGoBack-DjwL7c1l.js → pathToGoBack-XPlRz7Jt.js} +1 -1
- package/dist/assets/{pdf-D6N9uxwe.js → pdf-BNLZqB1A.js} +3 -3
- package/dist/assets/{pdf-lib-CWh0RHiG.js → pdf-lib-Dl0EkJKh.js} +1 -1
- package/dist/assets/{plaid-5PXB6whD.js → plaid-BSrnBML8.js} +1 -1
- package/dist/assets/{pusher-BrWux37o.js → pusher-D9fNEiyx.js} +1 -1
- package/dist/assets/{react-jjljLSIT.js → react-B1T-uU2u.js} +1 -1
- package/dist/assets/{react-B_u4EDFn.js → react-C71wZa-Q.js} +1 -1
- package/dist/assets/{react-BPaY-v1j.js → react-C9cd30B-.js} +1 -1
- package/dist/assets/{react-CuxyhjyV.js → react-D09h339w.js} +1 -1
- package/dist/assets/{react-DMw0lXKh.js → react-DQcNWoQy.js} +1 -1
- package/dist/assets/{react-C_d_o6Oe.js → react-pCiX7yPg.js} +1 -1
- package/dist/assets/{recharts-Chyhxc02.js → recharts-B2QzdJEJ.js} +1 -1
- package/dist/assets/{routePaths-Bd9tk_bd.js → routePaths-T6NVNRXw.js} +1 -1
- package/dist/assets/{sentry-T7AA_ij8.js → sentry-B8WE62R1.js} +1 -1
- package/dist/assets/{url-BYMzLIWK.js → url-Bh2rmQ6M.js} +1 -1
- package/dist/assets/{url-C0mgG0pG.js → url-Cgny8pWv.js} +1 -1
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-99a1ae26.js → useAiCfoDashboardSuggestedQuestionsChips-ByuEaj9g.js} +1 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-BjFaoyi3.js +1 -0
- package/dist/assets/{useChargeCardPusherEvents-BhhLoHJr.js → useChargeCardPusherEvents-DwnR999Q.js} +1 -1
- package/dist/assets/{useDeviceId-DwxriMvh.js → useDeviceId-E6nWdXlP.js} +1 -1
- package/dist/assets/{useEmailConnectResultRefresh-bG2MR1TT.js → useEmailConnectResultRefresh-CgnDEvXl.js} +1 -1
- package/dist/assets/{useInitialThreadRequest-CLczj5aZ.js → useInitialThreadRequest-CYNlLID-.js} +1 -1
- package/dist/assets/useTaskManagerAccess-D10G2ni1.js +1 -0
- package/dist/assets/{utils-oeHkWTt8.js → utils-BAMwHjCz.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-Mm6xVtPH.js → withTransactionSidePanel-BVm7iKO9.js} +2 -2
- package/dist/assets/{zeni-epic-state-B9l_W9RQ.js → zeni-epic-state-CgS-13Rp.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +2 -2
- package/dist/assets/AddressRoutes-CnuQ5eOb.js +0 -1
- package/dist/assets/AppDrawer-Dxyb3J5C.js +0 -10
- package/dist/assets/BillPayRoutes-C8UQhVLe.js +0 -119
- package/dist/assets/CompanyPassportScreen-BxZDXrE5.js +0 -1
- package/dist/assets/CustomerOnboardingAuthScreen-9EZl2Oqz.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-DpUYXmlE.js +0 -18
- package/dist/assets/FeaturePreviewScreen-DS5Xpxt9.js +0 -1
- package/dist/assets/MobileAppDrawer-NUU2GCIb.js +0 -1
- package/dist/assets/NotFoundScreen-BjZ5T-Ms.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BjMY7Xav.js +0 -1
- package/dist/assets/PaymentLinkScreen-DqUkmI8r.js +0 -21
- package/dist/assets/PeopleRoutes-D20wm9nB.js +0 -22
- package/dist/assets/RewardsRoutes-Dio-zanl.js +0 -1
- package/dist/assets/TransactionDetailRoutes-OBP39QoV.js +0 -1
- package/dist/assets/useAskAiCfoHostNavButtonProps-C0OwLWSS.js +0 -1
- package/dist/assets/useTaskManagerAccess-JxICb6EI.js +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as S}from"./liveblocks-
|
|
1
|
+
import{j as S}from"./liveblocks-CPy_3T4M.js";import{a as l}from"./sentry-B8WE62R1.js";import{u as me,h as he,g as Ce,j as M,i as fe,l as ge}from"./core-DHfFJrfH.js";import{a as Se,e5 as be,z as ye,e7 as Pe,e9 as N,ea as Ie,bn as W,a8 as we,j as F,eb as H,el as Ee,G as ke,U as xe,w as Ae,ee as Te,ef as Ue,av as _e,ei as ve,ej as Oe,bk as Qe,ek as je}from"./index-BxJdVany.js";import{gJ as Fe,fD as G,fE as De,g7 as $e,jg as Le,jc as Ve,fF as z,gt as Re,gn as qe,gp as B,gv as Me,gw as He,gx as ze,gy as Be,gz as Ne}from"./zeni-epic-state-CgS-13Rp.js";import{D as We,n as $,P as Ge,S as Je}from"./mui-BCtxe7Uc.js";import"./recharts-B2QzdJEJ.js";import"./analytics-MT8j1Arr.js";import"./plaid-BSrnBML8.js";import"./dnd-DG4Q4PBR.js";import"./stripe-cKAAJElX.js";import"./lottie-CPIsfbGQ.js";import"./lexical-Ds-L3Ehk.js";import"./pdf-BNLZqB1A.js";import"./utils-BAMwHjCz.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]="c81e1f3c-c7bb-4824-a886-425340d046e5",e._sentryDebugIdIdentifier="sentry-dbid-c81e1f3c-c7bb-4824-a886-425340d046e5")}catch{}})();const J="chat-response-generated",Y="cards/ask",K="card_policy_hero";function D(e){return`/${e}/cards`}function X(e){return`/${e}/cards/policy`}const Ye=ge((function(e,a){const o=G(e),d=a.isSubmitting,c=Ue(e,{allUsers:a.allUsers,onCardPolicyVendorSearchTextChange:a.onCardPolicyVendorSearchTextChange});return{showSampleQuestions:a.sessionFromUrl==="new_chat"&&o.uiState.currentChatSessionId==null,aiCfoView:o,isSubmitting:d,isNewChatSession:a.sessionFromUrl==="new_chat",isFullView:!0,tableDownloadEndPoint:`${_e}/tableDownload`,exportDownloadEndPoint:ve(),emailLinkQuestion:a.emailLinkQuestion,autoSubmitEmailLinkQuestion:a.autoSubmitEmailLinkQuestion,onEmailLinkQuestionProcessed:a.onEmailLinkQuestionProcessed,isFileUploadEnabled:a.isFileUploadEnabled,isUploadPromoVisible:a.isUploadPromoVisible,onUploadPromoClose:a.onUploadPromoClose,...c}}),(function(e,a){const{location:o,currentTenant:d,userId:c,navigate:p,currentChatSessionId:h,allSessionsWithOrderedQuestionAnswers:E,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,cardPolicyPageContext:U}=a,i=d.tenantEmailDomain,C=o.state?.referrer,m=C===K?X(i):D(i);return{onEventReceived:(n,t)=>{if(n===J&&typeof t.text=="string"&&typeof t.metadata=="object"){const s=t,f=He(s.type),b=s.metadata.chat_session_id??null,{currentChatSession:y,currentQuestionAnswer:u,currentQuestionAnswerSummary:P}=W(E,b);f!=="answer"?F.trackAICFOChatResponseGenerated(f,u?.question.questionText??"",s.text,b,je(P,y),s.metadata.message_id??null):F.trackAICFOChatAnswerGenerated(s.text,u?.question.questionText??"",(s.follow_up_questions?.length??0)>0,!!s.assumptions,!!s.insights,s.visualization!=null,ze(s.visualization?.type??"")??null,b,s.summarized_title,s.metadata.message_id??null),e(Be({chatSessionId:s.metadata.chat_session_id,responseType:f,fetchState:{fetchState:"Completed",error:void 0}})),e(Ne({chatSessionId:s.metadata.chat_session_id,answerPayload:s,userId:c}))}},onSubmit:(n,t,s,f)=>{n&&Qe(e,n,t,h,E,c,f,s,U)},updateCurrentInput:n=>{e(B(n))},onStopSubmit:()=>{},onUpdateScrollYOffset:n=>{e(Me(n))},onSelectSampleQuestion:()=>{},onBackClick:()=>{p(-1)},onCloseClick:()=>{p(m,{state:{...o.state}}),e(B(""))},togglePageView:()=>{p(m,{state:N(o.state)}),a.setIsAiCfoOpen(!0)},onCopy:()=>{},onThumbsUp:()=>{},onThumbsDown:()=>{},onTogglePageView:()=>{p(-1)},onNewChatClick:()=>{h!=null&&e(qe()),p((function(n){return`/${n}/${Y}`})(i),{state:{...o.state}})},onToggleCotCollapsed:(n,t)=>{e(Re({questionAnswerId:n,isCollapsed:t}))},...Oe(e,{isAiCardCreationEnabled:A,isCardPolicyEnabled:T,currentChatSessionId:h,onAfterCardsCreationSubmit:()=>{a.setIsAiCfoOpen(!0),p(D(i),{state:{...o.state}})},onAfterCardPolicySubmit:()=>{a.setIsAiCfoOpen(!0),p(`/${i}/cards/policy`,{state:{...o.state}})}})}}))(Ae(Te)),{spendManagement:{chargeCard:{cardsAiCfoHero:Z,cardPolicyAiCfoHero:ee}}}=ke.getLocalizedStrings(),x=Z.pageTitle,Ke=ee.pageTitle,Xe=Z.chatHeaderSubtitle,Ze=ee.chatHeaderSubtitle,St=({isFileUploadEnabled:e})=>{const{setIsAiCfoOpen:a}=Se(),o=me(),d=he(),c=Ce(),[p,h]=l.useState(!1),{allUsers:E,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,onCardPolicyVendorSearchTextChange:U}=be();l.useEffect((()=>{o(Fe())}),[o]);const i=M((r=>G(r))),C=ye.getSignedInUser(),{session_id:m}=fe(),n=M((r=>De(r))),t=i.uiState.currentChatSessionId,s=n.tenantEmailDomain,{handleUploadPromoClose:f,isUploadPromoVisible:b}=Pe({isFileUploadEnabled:e,tenantEmailDomain:s}),y=c.state,u=y?.aiCfoInitialQuestion??null,P=!!y?.aiCfoShouldSubmit,I=y?.referrer===K,te=I?"card_policy":void 0,se=l.useMemo((()=>({title:I?Ke:x,subtitle:I?Ze:Xe})),[I]),[ae,_]=l.useState(null),[oe,v]=l.useState(!1),O=l.useRef(!1);l.useEffect((()=>{O.current||u==null||u===""||(_(u),v(P),O.current=!0)}),[u,P]);const ne=l.useCallback((()=>{_(null),v(!1),d(c.pathname,{replace:!0,state:N(c.state)})}),[c.pathname,c.state,d]),ie=n.masterTOSInfo,g=ie?.isMasterTOSAccepted??!1,k=l.useRef(null);l.useEffect((()=>{if(g&&k.current!=null){const{question:r,shouldSubmit:w}=k.current;k.current=null,_(r),v(w),O.current=!1}}),[g]);const{visitedSessions:L}=Ie(t),Q=i.fetchState,j=i.uiState.chatSessionsNextPageToken.hasMore||!i.uiState.chatSessionsFirstPageFetched,V=t!=null?i.fetchChatSessionHistoryByChatSessionId?.[t]?.fetchState??"Not-Started":"Not-Started",R=t==null||(i.uiState.chatHistoryNextPageToken[t]?.hasMore??!0),q=i.allSessionsWithOrderedQuestionAnswers,{currentSessionQuestionAnswers:re}=W(q,t),le=re.length===0;l.useEffect((()=>{t!=null&&m!==t&&d((function(r,w){return`/${r}/${Y}/${w}`})(s,t),{state:{...c.state},replace:!0})}),[t,m,s,d,c.state]),l.useEffect((()=>{m!=null&&t==null&&m!=="new_chat"&&o($e({sessionId:m,agentId:"controller"}))}),[]);const ce=l.useMemo((()=>({events:L.map((r=>`private-encrypted-chat-${r}.${J}`)),eventCallback:(r,w,pe)=>pe.onEventReceived(r,w)})),[L]);if(l.useEffect((()=>{Q!=="In-Progress"&&j&&o(Le())}),[Q,j,o]),l.useEffect((()=>{t!=null&&V!=="In-Progress"&&R&&C!=null&&Q==="Completed"&&!j&&o(Ve(t,C.userId))}),[V,R,t,C,o]),C==null)throw Error("Can't access Cards AI CFO page without signing in...");const de=m??"new_chat",ue=t!=null&&i.responseStateByChatSessionId?.[t]?.answer?.fetchState==="In-Progress";return S.jsxs(tt,{children:[S.jsx(we,{analytics:F,onLoad:r=>r.trackPageLoaded(xe.Event.aiCFOPage)}),g?S.jsx(Ye,{...ce,currentChatSessionId:t,allSessionsWithOrderedQuestionAnswers:q,allUsers:E,isAiCardCreationEnabled:A,isCardPolicyEnabled:T,openOnboardingPage:()=>h(!0),userId:C.userId,setIsAiCfoOpen:a,navigate:d,sessionFromUrl:de,location:c,isSubmitting:ue,isEmptyChatWithSession:le,customPageTitle:x,chatHeader:se,currentTenant:n,emailLinkQuestion:ae??void 0,autoSubmitEmailLinkQuestion:oe,onEmailLinkQuestionProcessed:ne,isFileUploadEnabled:e,isUploadPromoVisible:b,onUploadPromoClose:f,onCardPolicyVendorSearchTextChange:U,cardPolicyPageContext:te}):S.jsx(H,{isTOSAccepted:g,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:x,onCloseClick:()=>{d(I?X(s):D(s),{state:{...c.state}})},onCompleteClick:()=>{g||n.userRoleId==null||(u!=null&&u!==""&&(k.current={question:u,shouldSubmit:P}),o(z(n.userRoleId)))}}),S.jsx(We,{anchor:"right",open:p,transitionDuration:250,PaperProps:{component:st,style:{width:`${Ee}vw`}},slotProps:{backdrop:{style:{backgroundColor:"transparent",cursor:"pointer"}}},onClose:()=>h(!1),children:S.jsx(et,{onClick:r=>r.stopPropagation(),children:S.jsx(H,{isTOSAccepted:g,acceptMasterTOSState:i.masterTOSAcceptanceState,customPageTitle:x,onCloseClick:()=>h(!1),onCompleteClick:()=>{g||n.userRoleId==null||o(z(n.userRoleId)),h(!1)}})})})]})},et=$(Je)`
|
|
2
2
|
display: flex;
|
|
3
3
|
min-height: 100%;
|
|
4
4
|
flex-direction: column;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as o}from"./liveblocks-CyXsV56c.js";import{u as me,j as d,h as de,g as he,i as Me,N as Je,s as _t,l as Pe,t as _n,n as cs,o as ne}from"./core-DCcrGtvx.js";import{fR as Pt,$9 as is,g1 as wt,bt as ve,$a as ds,$b as ls,fG as fn,$c as Pn,fP as wn,$d as Tn,$e as vn,$f as Fn,$g as xn,fQ as Bn,g0 as Ln,$h as Rn,$i as us,fW as ms,fV as Cs,$j as ps,Jm as On,g3 as ia,$k as hs,$l as fs,fI as gs,fH as bs,gg as ze,fY as Un,fX as jn,$m as Ss,fZ as ys,IU as Is,IT as ks,IX as Es,IZ as As,g9 as Ds,fD as $n,$n as _s,$o as Ps,ge as Mn,$p as ws,gf as yt,J3 as Ts,J0 as vs,fE as fe,$q as qa,dX as Fe,dh as xe,dY as Be,gZ as da,cB as la,$r as ua,$s as Tt,Ch as Ga,m6 as Ka,$t as za,JC as ka,g4 as qe,JE as vt,lY as Nn,$u as ma,Jq as _a,$v as Fs,$w as xs,Jt as Ja,$x as Bs,Yk as Qa,f$ as Vn,Jz as ba,ip as Ls,$y as Hn,fS as Ca,br as Rs,$z as Os,gF as Xa,gE as et,K6 as Us,gD as at,$A as Gn,cu as Kn,d9 as js,Yj as wa,KH as zn,$B as gn,Kh as Pa,$C as Yn,KI as $s,YJ as Ms,KJ as Ns,LO as Vs,Bx as Hs,LI as Gs,$D as Ks,JD as oa,$E as zs,$F as Ys,$G as Ws,$H as Zs,$I as qs,$J as Ft,$K as Js,JT as Wn,JM as Qs,$L as Xs,g$ as eo,$M as Zn,K0 as qn,K4 as Jn,g_ as ao,$N as to,Kt as Qn,$O as no,$P as ro,$Q as so,K2 as Xn,JP as er,Jw as ar,JY as tr,JW as nr,J_ as oo,$R as rr,$S as co,gb as io,gc as lo,gd as uo,$T as tt,g5 as sr,db as xt,$U as mo,$V as Co,$W as po,$X as ho,Kc as It,KA as fo,Kw as go,K8 as bo,Ky as So,Ko as yo,Kq as Io,$Y as or,KG as Ha,Rx as ko,$Z as Eo,$_ as Ao,$$ as Do,a00 as cr,a01 as _o,L1 as Po,Kg as ir,Kb as $e,Kf as wo,a02 as To,a03 as vo,Jn as Fo,a04 as dr,f_ as lr,a05 as xo,Jp as Bo,Jo as bn,a06 as Lo,a07 as Ro,a08 as Oo,UE as Uo,a09 as Bt,a0a as jo,Fo as ur,mG as $o,id as Mo,L6 as No,a0b as mr,fM as Vo,fN as Ho,a0c as Go,dM as Ko,g2 as zo,KY as Yo,KS as Ze,bq as Wo,bJ as Zo,cG as qo,bK as Jo,Tw as Qo}from"./zeni-epic-state-B9l_W9RQ.js";import{V as Le,dd as Cr,a4 as we,de as pr,df as hr,dg as Xo,G as ea,as as Lt,dh as ec,di as ac,a as fr,e as gr,ar as br,p as ke,O as le,c as W,l as ya,dj as Sr,dk as tc,dl as nc,z as te,a7 as Ta,d2 as nt,dm as rc,dn as sc,dp as oc,a1 as va,bi as Qe,bE as Rt,dq as cc,ab as Fa,Z as rt,E as Ot,j as ae,w as st,dr as ic,bQ as Sa,ds as kt,dt as dc,a8 as Ut,du as lc,ae as yr,av as Et,dv as uc,aq as Ir,Q as kr,U as Er,dw as mc,dx as Cc,dy as pc,dz as hc,dA as fc,dB as gc,dC as bc,M as Ya,dD as Sc,dE as yc,k as ht,K as Ic,dF as kc,dG as Ec,dH as Ac,ai as Dc,dI as _c,dJ as Pc,g as wc}from"./index-Bw4k26Lh.js";import{n as Ne,D as Ar,S as Tc}from"./mui-ezTHtwEe.js";import{a as r}from"./sentry-T7AA_ij8.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-C0OwLWSS.js";import{M as Ee}from"./MobileAppDrawer-NUU2GCIb.js";import{d as jt}from"./recharts-Chyhxc02.js";import{g as _e,a as Ba,b as Dr,c as Re,d as Oe,e as Xe,f as aa,h as ta,A as vc,i as $t,P as Fc,j as Mt,s as Ia,k as _r,l as ca,m as Pr,n as xc,o as wr,p as Bc,S as Sn}from"./SetupPagesScreen-D-xfgaAT.js";import{u as Tr}from"./useInitialThreadRequest-CLczj5aZ.js";import ot from"./NotFoundScreen-BjZ5T-Ms.js";import{u as Nt}from"./useChargeCardPusherEvents-BhhLoHJr.js";import{n as yn}from"./utils-oeHkWTt8.js";import{t as Lc}from"./AddressScreen-FiUJPHkQ.js";import"./analytics-B-TvIB4L.js";import"./plaid-5PXB6whD.js";import"./dnd-2zpntaNq.js";import"./stripe-cKAAJElX.js";import"./lottie-ZAIvsM-R.js";import"./lexical-YhB7nNuN.js";import"./pdf-D6N9uxwe.js";import"./InboxNotificationsProvider-BSgZT9XB.js";import"./useTaskManagerAccess-JxICb6EI.js";import"./BusinessVerificationPageScreen-BbEcHB5F.js";import"./routePaths-Bd9tk_bd.js";import"./analyticsHelper-h8-gsFza.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]="519db9ed-5e3b-4549-ac39-84b81e776e7a",e._sentryDebugIdIdentifier="sentry-dbid-519db9ed-5e3b-4549-ac39-84b81e776e7a")}catch{}})();const Rc=e=>{const a=e.cardHolderUser,n=`${a.firstName??""} ${a.lastName??""}`.trim()||a.email||a.userId;return{userId:a.userId,displayName:n,roleLabel:e.cardHolderRoles?.titleAtCompany}},vr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:Rc(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function Fr(){const e=me(),a=d((t=>Pt(t.cardPolicyState))),n=d((t=>is(t.cardPolicyState)));r.useEffect((()=>{n!==""||a==="Completed"&&n===""||a==="In-Progress"||e(wt())}),[e,a,n])}const{spendManagement:{chargeCard:{cardPolicyPage:In}}}=ea.getLocalizedStrings(),Oc=e=>Un(e,!1),Uc=e=>jn(e.name,!1);function jc(){const e=de(),a=he(),{tenantEmailDomain:n}=Me(),t=me(),s=Le(),g=ve(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((O=>{h(O)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:F}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect((()=>()=>{t(ds()),t(ls()),t(fn())}),[t]);const w=d((O=>Pn(O.cardPolicyState))),p=d((O=>wn(O.cardPolicyState))),v=d((O=>Tn(O.cardPolicyState))),L=d((O=>vn(O.cardPolicyState))),S=d((O=>Fn(O.cardPolicyState))),l=d((O=>xn(O.cardPolicyState))),C=d((O=>Bn(O.cardPolicyState))),B=d((O=>Pt(O.cardPolicyState))),k=d((O=>O.chargeCardConfigState.receiptRequiredAboveAmount.amount)),_=d((O=>O.chargeCardConfigState.fetchState));r.useEffect((()=>{w!=="Completed"&&w!=="In-Progress"&&t(Ln())}),[t,w]),Fr();const D=d((O=>Rn(O.createCardPolicyState))),$=d((O=>us(O.createCardPolicyState))),E=d((O=>ms(O.cardPolicyState))),y=d((O=>Cs(O.cardPolicyState))),R=d((O=>ps(O.createCardPolicyState))),i=d((O=>On(O)));r.useEffect((()=>{i.fetchState==="Not-Started"&&t(ia(!1,!1,!1))}),[i.fetchState,t]);const f=r.useMemo((()=>p.map(Oc)),[p]),j=r.useMemo((()=>C.map(Uc)),[C]),G=r.useMemo((()=>i.cards.filter((O=>!Cr(O.status.code))).map(vr)),[i.cards]),U=w==="Completed"&&i.fetchState==="Completed"&&_==="Completed";r.useEffect((()=>{U&&R==null&&t(hs({cardsMasterList:G,defaultRequireReceiptAmount:k,suggestedAllowMerchants:v,suggestedBlockMerchants:L,suggestedAllowCategories:S,suggestedBlockCategories:l}))}),[_,t,U,R,G,k,v,L,S,l]);const x=r.useMemo((()=>jt((O=>{t(wt(O))}),250)),[t]);r.useEffect((()=>()=>{x.cancel()}),[x]);const z=r.useCallback((O=>{x(O)}),[x]),V=D.fetchState,T=n!=null?`/${n}/cards/policy`:"..",P=r.useCallback((()=>{const O=we(a.state?.pathnameStackToGoBack),q=O.poppedPathname??T;e(q,{state:{pathnameStackToGoBack:O.newStack}})}),[a.state,e,T]),K=r.useCallback((()=>{e(T)}),[e,T]),Z=r.useCallback((O=>{t(fs(O))}),[t]),I=r.useCallback((O=>{const q=pr(O);t(gs({templates:[q]}))}),[t]),M=r.useCallback((O=>{O.length!==0&&t(bs(O))}),[t]),N=r.useCallback((()=>{t(fn())}),[t]),Q=r.useRef(V);r.useEffect((()=>{const O=Q.current;Q.current=V,V==="Completed"&&O!=="Completed"&&$!=null&&(t(ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(T))}),[t,V,$,e,T]);const c=V==="Error"?D.error?.message??In.createPolicyGenericErrorMessage:void 0;return g&&n!=null?R==null?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(hr,{showUploadDocumentSection:!0,navBarTitle:In.createPageTitle,onBackClick:P,onClickMenuIcon:u,isAiCfoAccessEnabled:m,onAskAiCfoClick:F})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(Xo,{formDraft:R,vendorSearchOptions:j,categorySearchOptions:f,isVendorSearchLoading:B==="In-Progress",onVendorSearchTextChange:z,submitState:V,submitErrorMessage:c,documentUploadState:E,uploadedFileName:y,isAiCfoAccessEnabled:m,onAskAiCfoClick:F,onBackClick:P,onCancelClick:K,onClickMenuIcon:u,onFormChange:Z,onSubmit:I,onUploadDocument:M,onRemoveDocument:N})]}):o.jsx(Je,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:$c}}}=ea.getLocalizedStrings(),Mc=e=>Un(e,!1),Nc=e=>jn(e.name,!1);function Vc(){const e=de(),a=he(),{tenantEmailDomain:n,templateId:t}=Me(),s=me(),g=Le(),b=ve(g?.loggedInUserRoleMap),[h,A]=r.useState(!1),u=r.useCallback((c=>{A(c)}),[]),m=r.useCallback((()=>{u(!0)}),[u]),{isAiCfoAccessEnabled:F,onAskAiCfoClick:w}=xa({mobileExploreReferrer:"Card Policy"}),p=d((c=>Ss(c))),v=d((c=>Pn(c.cardPolicyState))),L=d((c=>wn(c.cardPolicyState))),S=d((c=>Tn(c.cardPolicyState))),l=d((c=>vn(c.cardPolicyState))),C=d((c=>Fn(c.cardPolicyState))),B=d((c=>xn(c.cardPolicyState))),k=d((c=>Bn(c.cardPolicyState))),_=d((c=>Pt(c.cardPolicyState))),D=d((c=>On(c))),$=d((c=>t!=null?ys(c.cardPolicyState,t):void 0)),E=r.useMemo((()=>p.templateId===t&&p.formDraft!=null?p.formDraft:$!=null?Is($):void 0),[p.templateId,p.formDraft,$,t]);r.useEffect((()=>{if(t==null)return;const c=p.detailFetchState.fetchState;p.templateId===t&&(c==="Completed"||c==="In-Progress")||$!=null||s(ks(t))}),[s,t,p.templateId,p.detailFetchState.fetchState,$]),r.useEffect((()=>{v!=="Completed"&&v!=="In-Progress"&&s(Ln())}),[s,v]),Fr();const y=d((c=>c.chargeCardConfigState.receiptRequiredAboveAmount.amount));r.useEffect((()=>{D.fetchState==="Not-Started"&&s(ia(!1,!1,!1))}),[D.fetchState,s]);const R=r.useMemo((()=>L.map(Mc)),[L]),i=r.useMemo((()=>k.map(Nc)),[k]),f=r.useMemo((()=>D.cards.filter((c=>!Cr(c.status.code))).map(vr)),[D.cards]);Lt({isDataReady:E!=null});const j=r.useMemo((()=>{if(E!=null)return ec({draft:E,cardRows:f,categorySearchOptions:R,vendorSearchOptions:i,defaultRequireReceiptAmount:y,suggestedAllowMerchants:S,suggestedBlockMerchants:l,suggestedAllowCategories:C,suggestedBlockCategories:B})}),[E,f,R,i,y,S,l,C,B]),[G,U]=r.useState(void 0),x=r.useRef(!1);r.useEffect((()=>{x.current||G!=null||j==null||(x.current=!0,U(j))}),[G,j]);const z=r.useCallback((c=>{U(c)}),[]),V=r.useMemo((()=>jt((c=>{s(wt(c))}),250)),[s]);r.useEffect((()=>()=>{V.cancel()}),[V]);const T=r.useCallback((c=>{V(c)}),[V]),P=p.updateFetchState.fetchState,K=n!=null?`/${n}/cards/policy`:"..",Z=r.useCallback((()=>{const c=we(a.state?.pathnameStackToGoBack),O=c.poppedPathname??K;e(O,{state:{pathnameStackToGoBack:c.newStack}})}),[a.state,e,K]),I=r.useCallback((()=>{e(K)}),[e,K]),M=r.useCallback((c=>{if(t==null)return;const O=pr(c);s(Es(O)),s(As(t))}),[s,t]),N=r.useRef(P);r.useEffect((()=>{const c=N.current;N.current=P,P==="Completed"&&c!=="Completed"&&(s(ze({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(K))}),[s,P,e,K]);const Q=P==="Error"?p.updateFetchState.error?.message??$c.updatePolicyGenericErrorMessage:void 0;return!b||n==null||t==null?o.jsx(Je,{to:"..",replace:!0}):G!=null&&v==="Completed"&&D.fetchState==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(ac,{templateName:p.template?.name??"",formDraft:G,vendorSearchOptions:i,categorySearchOptions:R,isVendorSearchLoading:_==="In-Progress",onVendorSearchTextChange:T,submitState:P,submitErrorMessage:Q,isAiCfoAccessEnabled:F,onAskAiCfoClick:w,onBackClick:Z,onCancelClick:I,onClickMenuIcon:m,onFormChange:z,onSubmit:M})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(hr,{showUploadDocumentSection:!1,navBarTitle:p.template?.name,onBackClick:Z,onClickMenuIcon:m,isAiCfoAccessEnabled:F,onAskAiCfoClick:w})]})}function xr(e,a,n){return a?e.filter((t=>t!=null&&t.trim().length>0)).slice(0,n):[]}function Br(e){return d((a=>e==null||e===""?{chips:ft,isResolved:!1}:(function(n){const t=n?.fetchState,s=t==="Completed"||t==="Error";return{chips:t==="Completed"?n?.suggestedQuestions??ft:ft,isResolved:s}})(Ds(a,e))),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Hc,subheadline:Gc,pageTitle:Kc}}}}=ea.getLocalizedStrings(),zc=e=>{const a=e.cardsCount>0?e.cardsCount:e.appliedCards.length,n=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,t=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:a,vendorRestrictionsCount:n,categoryRestrictionsCount:t}};function Yc(){const e=de(),a=he(),{tenantEmailDomain:n}=Me(),t=me(),s=Le(),g=ve(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((T=>{h(T)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{useFeatureGate:m}=le(),{isFeatureEnabled:F}=m(W.isAiCfoFileUploadEnabled),{isFeatureEnabled:w}=m(W.isCardPolicyEnabled),{isAiCfoAccessEnabled:p,onAskAiCfoClick:v}=xa({mobileExploreReferrer:"Card Policy"}),L=d((T=>_s(T))),S=d((T=>Rn(T.createCardPolicyState))),l=d((T=>Ps(T.createCardPolicyState))),C=d((T=>l==null?[]:Mn(T.aiCfoState,l).filter((P=>P.kind==="creating_policy"))),_t),B=S.fetchState==="In-Progress"?Math.max(C.length,1):0,k=d((T=>ws(T.createCardPolicyState))),_=ya(S.fetchState);r.useEffect((()=>{if(_==="In-Progress"&&S.fetchState==="Completed"&&l!=null)C.forEach((T=>{t(yt({chatSessionId:l,id:T.id,entityIds:k,kind:"created_policy"}))}));else if(_==="In-Progress"&&S.fetchState==="Error"&&l!=null){C.forEach((P=>{t(yt({chatSessionId:l,id:P.id,kind:"errored_policy"}))}));const T=S.error?.message!=null&&S.error.message.length>0?S.error.message:ea.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;t(ze({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:T}]}))}}),[S.error?.message,S.fetchState,t,l,k,C,_]);const D=L.fetchState.fetchState;r.useEffect((()=>{D!=="Not-Started"&&D!=="Error"||t(Ts())}),[t,D]);const $=L.archiveFetchState.fetchState,E=ya($);r.useEffect((()=>{E==="In-Progress"&&$==="Completed"&&t(ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))}),[$,t,E]);const y=r.useMemo((()=>L.templates.map(zc)),[L.templates]);Lt({isDataReady:L.fetchState.fetchState==="Completed"});const R=y.length>0||B>0,i=(function(T){const{hasAnyPolicies:P,isChargeCardAdmin:K,isFileUploadEnabled:Z}=T,I=de(),M=he(),{tenantEmailDomain:N}=Me(),{isAiCfoOpen:Q,setIsAiCfoOpen:c}=fr(),O=gr(),q=br(),se=d((J=>$n(J))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:X,isResolved:Ve}=Br("card_policy"),Ae=r.useMemo((()=>xr(X,Ve,3)),[X,Ve]),[ge,re]=r.useState(""),be=q&&O&&N!=null&&!Q,ue=r.useCallback((J=>{if(N==null)return;const fa=ke(M.state?.pathnameStackToGoBack,M.pathname);I(`/${N}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:J,aiCfoShouldSubmit:J!=null&&J.trim().length>0}})}),[M.pathname,M.state,I,N]),oe=r.useCallback((J=>{J.trim().length!==0&&(re(""),ue(J))}),[ue]),Se=r.useCallback((()=>{const J=ge.trim();J.length!==0&&(re(""),ue(J))}),[ge,ue]),ee=r.useCallback((()=>{}),[]),De=r.useCallback((J=>{re(J)}),[]),Te=r.useCallback((()=>{c(!0)}),[c]),Ce=r.useCallback((()=>{ue(void 0)}),[ue]);return r.useMemo((()=>{if(be&&!P&&K)return{aiAgentName:Kc,headline:Hc,subheadline:Gc,promptChips:Ae,composer:{currentInput:ge,isSubmitting:se,isFileUploadEnabled:Z,onInputChange:De,onSubmit:Se,onStopSubmit:ee},onPromptClick:oe,onOpenSidePanel:Te,onOpenFullView:Ce,dataTestIdPrefix:"card-policy-ai-cfo-hero"}}),[ge,P,be,K,Z,se,De,Ce,Te,oe,ee,Se,Ae])})({hasAnyPolicies:R,isChargeCardAdmin:g,isFileUploadEnabled:F}),f=w&&i!=null?o.jsx(Sr,{...i}):null,j=p&&f==null,G=r.useCallback((()=>{const T=we(a.state?.pathnameStackToGoBack),P=T.poppedPathname??"..";e(P,{state:{pathnameStackToGoBack:T.newStack}})}),[a.state,e]),U=r.useCallback((()=>{n!=null&&e(`/${n}/cards/policy/new`)}),[e,n]),x=r.useCallback((T=>{n!=null&&e(`/${n}/cards/policy/${T}/edit`)}),[e,n]),z=r.useCallback((T=>{t(vs(T))}),[t]),V=L.fetchState.fetchState;return!R&&V!=="Completed"&&V!=="Error"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(tc,{onBackClick:G,onNewPolicyClick:U,onClickMenuIcon:u,isAiCfoAccessEnabled:p,onAskAiCfoClick:v})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(nc,{policies:y,archivingTemplateId:L.archiveTargetTemplateId,pendingCreationCount:B,onBackClick:G,onNewPolicyClick:U,onEditPolicyClick:x,onArchivePolicyClick:z,onClickMenuIcon:u,policyAiCfoHero:f,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})]})}function Wc(){const e=de(),{cardId:a}=Me(),n=me(),t=te.getSignedInUser(),s=d((X=>fe(X))),g=Le(),b=ve(g?.loggedInUserRoleMap),{useFeatureGate:h}=le();if(t==null)throw Error("Can't access Add To Wallet Page without signing in...");const[A,u]=r.useState(!1),m=d((X=>qa(X).firstViewAfterActivation));if(a==null)throw Error("Empty card id is not valid...");const F=s.userRole.includes("charge_card_user"),{isFeatureEnabled:w}=h(W.isChargeCardFeatureEnabled),p=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:v}=h(W.isDebitCardFeatureEnabled),L=Fe(s),S=xe(s),l=Be(v,s),C=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,B=Re({isDebitCardFeatureEnabled:v,isBankingOnlyTenant:l}),k=Oe({isCardsOnlyTenant:L,isChargeCardFeatureEnabled:w,isBookKeepingTenant:S,isDebitCardProductVisible:B,chargeCardsCreditAccountLimit:C}),_=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,D=d((X=>da(X,s.companyId))),$=la(D.controllers),{creditAccount:E,creditAccountRepayment:y}=d((X=>ua(X))),R=d((X=>X.classListState.fetchState)),i=!F&&k&&p,f=d((X=>Tt(X,a,i,k))),[j,G]=r.useState(!1),U=f.chargeCard,x=U?.cardCreatedByUser?.userId,z=d((X=>x!=null?Ga(X.userRoleState,x):void 0)),V=z?.accountingClassIDs[0],T=d((X=>V!=null?Ka(X.classState,{classId:V,reportId:"class_list"}):void 0)),P=U?.cardHolderUser?.userId,K=d((X=>P!=null?Ga(X.userRoleState,P):void 0)),Z=K?.accountingClassIDs[0],I=d((X=>Z!=null?Ka(X.classState,{classId:Z,reportId:"class_list"}):void 0)),M=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",N=U?.type.code==="business_physical_debit_card";r.useEffect((()=>{m&&A===!1&&M&&(u(!0),setTimeout((()=>{n(za()),N&&n(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[m,A,M,N]),r.useEffect((()=>{j||f.fetchState==="Completed"||f.fetchState==="In-Progress"||a==null||(G(!0),n(ka(a,i,!1)))}),[j,f,a,n]),r.useEffect((()=>{if(f.fetchState==="Completed"&&(M===!1||M&&U?.status?.code!=="active"||U?.cardHolderUserId!==t.userId||m===!1&&A===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=_e(s.tenantEmailDomain,a,t,U,m);e(X)}}),[f.fetchState,m,M]),r.useEffect((()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&k&&p&&b&&n(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&k&&p&&b&&n(vt()),R!=="Completed"&&R!=="In-Progress"&&n(Nn())}),[E.fetchState,y.fetchState,n,k,p,b,R]);const Q=()=>{if(t!=null&&a!=null){n(za());const X=_e(s.tenantEmailDomain,a,t);e(X)}},c=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",O=Xe(k,B,_,p),q=Ba(k,p,b,E,y),se=Dr(c,f);return f.fetchState!=="Completed"?o.jsx(Ta,{fetchState:"In-Progress"}):o.jsxs(o.Fragment,{children:[o.jsx(nt,{showConfetti:m}),o.jsx(rc,{onGotItClick:Q,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:$,isChargeCardFeatureEnabled:k,isDebitCardFeatureEnabled:B,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:p,productInformation:O,creditAccountInformation:q,debitAccountInformation:se,chargeCardDetailView:f,creditAccount:E,classListFetchState:R,creditAccountRepayment:y,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:T?.className,cardHolderRoles:K?.userRoles,cardHolderDepartmentName:I?.className})]})}const Lr="charge-card-transaction-update",Rr="charge-card-transaction-created",Or="charge-card-transaction-declined",Ur="charge-card-transaction-updated",jr="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Vt="charge-card-spending-updated",ct="credit-account-balance-updated",it="charge-card-created",Ht="charge-card-limit-updated",Gt="charge-card-limit-reset",Kt="charge-card-renamed",Zc="charge-card-department-updated",$r="charge-card-repayment-completed",Mr="charge-card-payment-date-updated",La="charge-card-cashback-redeemed",Ra="charge-card-cashback-earned",ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),qc=[Ra,La],Jc=Pe((function(e){const a=ma(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}}),(function(e){return{onColumnSortConfigChanged:(a,n)=>{e(Fs({uiState:{sortKey:a,sortOrder:n}}))}}}))(oc);function Qc(){const e=de(),a=me(),n=he(),t=te.getSignedInUser(),s=d((v=>fe(v))),{useFeatureGate:g}=le(),{isFeatureEnabled:b}=g(W.isCardsCommentingEnabled),[h,A]=r.useState(!1),u=d((v=>ma(v))),m=Tr(s.companyId,{clearParams:u.fetchState==="Completed"}),F=r.useCallback((()=>{const v=we(n.state?.pathnameStackToGoBack),L=v.poppedPathname??Xc(s.tenantEmailDomain);e(L,{state:{pathnameStackToGoBack:v.newStack}})}),[e,n,s.tenantEmailDomain]),w=aa(s);if(Nt({events:ha(w,qc),onEvent:v=>{switch(v){case Ra:case La:return void a(_a(!0))}},onSubscribed:()=>{a(_a(!0))}}),r.useEffect((()=>{h||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(A(!0),a(_a()))}),[h,u,a]),t==null)throw Error("Can't access cashback detail page without signing in...");const p=u.cashbackSummary?.cashbackEarned?.amount!=null&&u.fetchState!=="Not-Started";return u.fetchState!=="In-Progress"||p?(u.cashbackSummary?.cashbackEarned?.amount??0)===0&&u.fetchState==="Completed"?o.jsx(ot,{}):o.jsx(Jc,{onBackClick:F,isCardsCommentingEnabled:b,initialOpenThreadRequest:m}):o.jsx(sc,{onBackClick:F})}const Xc=e=>`/${e}/cards`,ei={containerWidth:new Fa(100,58)},ai=({appContent:e})=>{const a=va(),n=me(),t=de(),{cardId:s}=Me(),g=he(),{useDynamicConfig:b}=le(),[h,A]=r.useState(!1),[u,m]=r.useState(!1),[F,w]=r.useState(!1),[p,v]=r.useState(!1),L=te.getSignedInUser();if(L==null)throw Error("Can't access onboarding card page without signing in...");const S=d((I=>fe(I)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:l}=b(Qe.zeniCardsConfig),C=l.max_charge_card_activation_attempts_by_card_id,B=d((I=>xs(I,s))),k=B.chargeCard,_=d((I=>I.chargeCardConfigState.fetchState)),{useFeatureGate:D}=le(),{isFeatureEnabled:$}=D(W.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=D(W.isDebitCardFeatureEnabled),y=Be(E,S),R=Re({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:y}),i=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,f=S.userRole.includes("charge_card_user"),j=Fe(S),G=xe(S),U=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,x=Oe({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:$,isBookKeepingTenant:G,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:U}),z=!f&&x&&i;r.useEffect((()=>{h===!1&&_!=="In-Progress"&&_!=="Completed"&&(n(Ja()),A(!0)),u===!1&&B.fetchState==="Not-Started"&&(m(!0),n(ka(s,z,x)))}),[u,B.fetchState,h,_]);const V=k?.type.code==="business_physical_credit_card"||k?.type.code==="business_physical_debit_card";r.useEffect((()=>{if(B.fetchState==="Completed"){if(F===!1&&(V===!1||V&&k?.status?.code!=="inactive"||k?.cardHolderUserId!==L.userId)){const I=_e(S.tenantEmailDomain,s,L,k,!0),M=ke(g.state?.pathnameStackToGoBack,g.pathname);t(I,{state:{pathnameStackToGoBack:M}})}else if(F&&B.isRefreshingViewInBackground===!1&&k?.status?.code==="active"){n(Bs({chargeCardId:s}));const I=_e(S.tenantEmailDomain,s,L,k,!0),M=ke(g.state?.pathnameStackToGoBack,g.pathname);n(Qa()),t(I,{state:{pathnameStackToGoBack:M}})}}}),[B.fetchState,k?.type.code,F,B.isRefreshingViewInBackground]);const T=te.getZeniOtpTokenForCardHolder(s),P=d((I=>Vn(I.userState,L.userId))),K=()=>{k?.status?.code!=="active"&&n(ba(s,!0))};r.useEffect((()=>{B.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&k?.cardActivationAttemptHistory.some((I=>I.statusCode==="success"))===!0&&F===!1&&(setTimeout(K,3e3),w(!0))}),[B.updatePhysicalChargeCardAttemptFetchState.fetchState,k?.cardActivationAttemptHistory]);const Z=I=>{v(I)};if(_!=="Completed"||k==null)return o.jsx(Ta,{fetchState:"In-Progress"});if(k.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return o.jsxs(ri,{children:[o.jsx(Ee,{isAppContentDrawerOpen:p,handleDrawerToggle:Z}),o.jsx(ti,{cardId:s,card:k,shippingAddressId:k.shippingAddressId,phone:P.phone,signedInUser:L,isSandboxEnv:Rt(),chargeCardDetailState:B,signedInUserToken:T,navigate:t,currentTenant:S,location:g,maxChargeCardActivationAttempts:C[s]!=null?C[s]:l.default_max_charge_card_activation_attempts!=null?l.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:l.charge_card_cashback_rate_per_transaction!=null?l.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Z(!0)}}),e!=null?o.jsx(ni,{windowSize:a,children:e}):null]})},ti=Pe((function(e,{chargeCardDetailState:a,shippingAddressId:n,location:t,cardId:s}){const g=Ls(e.addressState,n);if(g==null)throw Error("Can't access shippingAddress.");const b=Hn(e,s),h=a.updateStatus,A=Ca(e,!1,!1,!1);let u=!1;A.fetchState==="Completed"&&A.cards.length<=1&&(u=!0);const m=t.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Rs())||m,showMenuIcon:u,shippingAddress:g,vgsVaultId:rt.cardVaultId,twoFAView:b,activationWaitStatus:h,isRefreshingViewInBackground:a.isRefreshingViewInBackground}}),(function(e,a){const{navigate:n,cardId:t,location:s,currentTenant:g,chargeCardDetailState:b}=a,h=b.chargeCard?.cardProviderID,{tenantEmailDomain:A}=g;return{onGetOtp:u=>{h!=null&&e(at(u,"ChargeCardHolder",t))},onUpdatePhysicalChargeCardAttempt:u=>{e(Us(t,u))},onResendOtp:u=>{h!=null&&e(et(u,"ChargeCardHolder",t))},onVerifyOtp:(u,m)=>{h!=null&&e(Xa(u,m,"ChargeCardHolder",t))},onVerifyOtpSuccess:u=>{u!=null&&te.saveZeniOtpTokenForCardHolder(u,t)},onCVVActivateSuccess:()=>{e(Os({chargeCardId:t}))},onBackClick:()=>{const u=we(s.state?.pathnameStackToGoBack),m=u.poppedPathname==null||u.poppedPathname.includes("onboard")===!0?ta(A):u.poppedPathname;n(m,{state:{pathnameStackToGoBack:u.newStack}})}}}))(cc),ni=Ne.div`
|
|
1
|
+
import{j as o}from"./liveblocks-CPy_3T4M.js";import{u as me,j as d,h as de,g as he,i as Me,N as Je,s as _t,l as Pe,t as _n,n as cs,o as ne}from"./core-DHfFJrfH.js";import{fR as Pt,$9 as is,g1 as wt,bt as ve,$a as ds,$b as ls,fG as fn,$c as Pn,fP as wn,$d as Tn,$e as vn,$f as Fn,$g as xn,fQ as Bn,g0 as Ln,$h as Rn,$i as us,fW as ms,fV as Cs,$j as ps,Jm as On,g3 as ia,$k as hs,$l as fs,fI as gs,fH as bs,gg as ze,fY as Un,fX as jn,$m as Ss,fZ as ys,IU as Is,IT as ks,IX as Es,IZ as As,g9 as Ds,fD as $n,$n as _s,$o as Ps,ge as Mn,$p as ws,gf as yt,J3 as Ts,J0 as vs,fE as fe,$q as qa,dX as Fe,dh as xe,dY as Be,gZ as da,cB as la,$r as ua,$s as Tt,Ch as Ga,m6 as Ka,$t as za,JC as ka,g4 as qe,JE as vt,lY as Nn,$u as ma,Jq as _a,$v as Fs,$w as xs,Jt as Ja,$x as Bs,Yk as Qa,f$ as Vn,Jz as ba,ip as Ls,$y as Hn,fS as Ca,br as Rs,$z as Os,gF as Xa,gE as et,K6 as Us,gD as at,$A as Gn,cu as Kn,d9 as js,Yj as wa,KH as zn,$B as gn,Kh as Pa,$C as Yn,KI as $s,YJ as Ms,KJ as Ns,LO as Vs,Bx as Hs,LI as Gs,$D as Ks,JD as oa,$E as zs,$F as Ys,$G as Ws,$H as Zs,$I as qs,$J as Ft,$K as Js,JT as Wn,JM as Qs,$L as Xs,g$ as eo,$M as Zn,K0 as qn,K4 as Jn,g_ as ao,$N as to,Kt as Qn,$O as no,$P as ro,$Q as so,K2 as Xn,JP as er,Jw as ar,JY as tr,JW as nr,J_ as oo,$R as rr,$S as co,gb as io,gc as lo,gd as uo,$T as tt,g5 as sr,db as xt,$U as mo,$V as Co,$W as po,$X as ho,Kc as It,KA as fo,Kw as go,K8 as bo,Ky as So,Ko as yo,Kq as Io,$Y as or,KG as Ha,Rx as ko,$Z as Eo,$_ as Ao,$$ as Do,a00 as cr,a01 as _o,L1 as Po,Kg as ir,Kb as $e,Kf as wo,a02 as To,a03 as vo,Jn as Fo,a04 as dr,f_ as lr,a05 as xo,Jp as Bo,Jo as bn,a06 as Lo,a07 as Ro,a08 as Oo,UE as Uo,a09 as Bt,a0a as jo,Fo as ur,mG as $o,id as Mo,L6 as No,a0b as mr,fM as Vo,fN as Ho,a0c as Go,dM as Ko,g2 as zo,KY as Yo,KS as Ze,bq as Wo,bJ as Zo,cG as qo,bK as Jo,Tw as Qo}from"./zeni-epic-state-CgS-13Rp.js";import{V as Le,dd as Cr,a4 as we,de as pr,df as hr,dg as Xo,G as ea,as as Lt,dh as ec,di as ac,a as fr,d as gr,ar as br,k as ke,M as le,y as W,l as ya,dj as Sr,dk as tc,dl as nc,z as te,a7 as Ta,d2 as nt,dm as rc,dn as sc,dp as oc,a1 as va,bi as Qe,bE as Rt,dq as cc,ab as Fa,Z as rt,E as Ot,j as ae,w as st,dr as ic,bQ as Sa,ds as kt,dt as dc,a8 as Ut,du as lc,ae as yr,av as Et,dv as uc,aq as Ir,Q as kr,U as Er,dw as mc,dx as Cc,dy as pc,dz as hc,dA as fc,dB as gc,dC as bc,N as Ya,dD as Sc,dE as yc,m as ht,K as Ic,dF as kc,dG as Ec,dH as Ac,ai as Dc,dI as _c,dJ as Pc,f as wc}from"./index-BxJdVany.js";import{n as Ne,D as Ar,S as Tc}from"./mui-BCtxe7Uc.js";import{a as r}from"./sentry-B8WE62R1.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-BjFaoyi3.js";import{M as Ee}from"./MobileAppDrawer-k5UN-ZVo.js";import{d as jt}from"./recharts-B2QzdJEJ.js";import{g as _e,a as Ba,b as Dr,c as Re,d as Oe,e as Xe,f as aa,h as ta,A as vc,i as $t,P as Fc,j as Mt,s as Ia,k as _r,l as ca,m as Pr,n as xc,o as wr,p as Bc,S as Sn}from"./SetupPagesScreen-f0SRzJjQ.js";import{u as Tr}from"./useInitialThreadRequest-CYNlLID-.js";import ot from"./NotFoundScreen-DsHUR7rB.js";import{u as Nt}from"./useChargeCardPusherEvents-DwnR999Q.js";import{n as yn}from"./utils-BAMwHjCz.js";import{t as Lc}from"./AddressScreen-BIEQJvnM.js";import"./analytics-MT8j1Arr.js";import"./plaid-BSrnBML8.js";import"./dnd-DG4Q4PBR.js";import"./stripe-cKAAJElX.js";import"./lottie-CPIsfbGQ.js";import"./lexical-Ds-L3Ehk.js";import"./pdf-BNLZqB1A.js";import"./InboxNotificationsProvider-8Zmc_gz4.js";import"./useTaskManagerAccess-D10G2ni1.js";import"./BusinessVerificationPageScreen-CLz9Vhow.js";import"./routePaths-T6NVNRXw.js";import"./analyticsHelper-CPeGk6N0.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]="bd16dfe0-4619-4dd8-abf9-c5135fdff6b1",e._sentryDebugIdIdentifier="sentry-dbid-bd16dfe0-4619-4dd8-abf9-c5135fdff6b1")}catch{}})();const Rc=e=>{const a=e.cardHolderUser,n=`${a.firstName??""} ${a.lastName??""}`.trim()||a.email||a.userId;return{userId:a.userId,displayName:n,roleLabel:e.cardHolderRoles?.titleAtCompany}},vr=e=>({id:e.id,isChecked:!1,cardName:e.cardName,last4:e.accountLast4,limitAmount:e.limit?.amount??0,limitCadence:e.creditLimitFrequency?.code,owner:Rc(e),utilizationAmount:(e.limit?.amount??0)-(e.available?.amount??0)});function Fr(){const e=me(),a=d((t=>Pt(t.cardPolicyState))),n=d((t=>is(t.cardPolicyState)));r.useEffect((()=>{n!==""||a==="Completed"&&n===""||a==="In-Progress"||e(wt())}),[e,a,n])}const{spendManagement:{chargeCard:{cardPolicyPage:In}}}=ea.getLocalizedStrings(),Oc=e=>Un(e,!1),Uc=e=>jn(e.name,!1);function jc(){const e=de(),a=he(),{tenantEmailDomain:n}=Me(),t=me(),s=Le(),g=ve(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((O=>{h(O)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{isAiCfoAccessEnabled:m,onAskAiCfoClick:F}=xa({mobileExploreReferrer:"Card Policy"});r.useEffect((()=>()=>{t(ds()),t(ls()),t(fn())}),[t]);const w=d((O=>Pn(O.cardPolicyState))),p=d((O=>wn(O.cardPolicyState))),v=d((O=>Tn(O.cardPolicyState))),L=d((O=>vn(O.cardPolicyState))),S=d((O=>Fn(O.cardPolicyState))),l=d((O=>xn(O.cardPolicyState))),C=d((O=>Bn(O.cardPolicyState))),B=d((O=>Pt(O.cardPolicyState))),k=d((O=>O.chargeCardConfigState.receiptRequiredAboveAmount.amount)),_=d((O=>O.chargeCardConfigState.fetchState));r.useEffect((()=>{w!=="Completed"&&w!=="In-Progress"&&t(Ln())}),[t,w]),Fr();const D=d((O=>Rn(O.createCardPolicyState))),$=d((O=>us(O.createCardPolicyState))),E=d((O=>ms(O.cardPolicyState))),y=d((O=>Cs(O.cardPolicyState))),R=d((O=>ps(O.createCardPolicyState))),i=d((O=>On(O)));r.useEffect((()=>{i.fetchState==="Not-Started"&&t(ia(!1,!1,!1))}),[i.fetchState,t]);const f=r.useMemo((()=>p.map(Oc)),[p]),j=r.useMemo((()=>C.map(Uc)),[C]),G=r.useMemo((()=>i.cards.filter((O=>!Cr(O.status.code))).map(vr)),[i.cards]),U=w==="Completed"&&i.fetchState==="Completed"&&_==="Completed";r.useEffect((()=>{U&&R==null&&t(hs({cardsMasterList:G,defaultRequireReceiptAmount:k,suggestedAllowMerchants:v,suggestedBlockMerchants:L,suggestedAllowCategories:S,suggestedBlockCategories:l}))}),[_,t,U,R,G,k,v,L,S,l]);const x=r.useMemo((()=>jt((O=>{t(wt(O))}),250)),[t]);r.useEffect((()=>()=>{x.cancel()}),[x]);const z=r.useCallback((O=>{x(O)}),[x]),V=D.fetchState,T=n!=null?`/${n}/cards/policy`:"..",P=r.useCallback((()=>{const O=we(a.state?.pathnameStackToGoBack),q=O.poppedPathname??T;e(q,{state:{pathnameStackToGoBack:O.newStack}})}),[a.state,e,T]),K=r.useCallback((()=>{e(T)}),[e,T]),Z=r.useCallback((O=>{t(fs(O))}),[t]),I=r.useCallback((O=>{const q=pr(O);t(gs({templates:[q]}))}),[t]),M=r.useCallback((O=>{O.length!==0&&t(bs(O))}),[t]),N=r.useCallback((()=>{t(fn())}),[t]),Q=r.useRef(V);r.useEffect((()=>{const O=Q.current;Q.current=V,V==="Completed"&&O!=="Completed"&&$!=null&&(t(ze({messageSection:"card_policy_created",messageText:"success",type:"success"})),e(T))}),[t,V,$,e,T]);const c=V==="Error"?D.error?.message??In.createPolicyGenericErrorMessage:void 0;return g&&n!=null?R==null?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(hr,{showUploadDocumentSection:!0,navBarTitle:In.createPageTitle,onBackClick:P,onClickMenuIcon:u,isAiCfoAccessEnabled:m,onAskAiCfoClick:F})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(Xo,{formDraft:R,vendorSearchOptions:j,categorySearchOptions:f,isVendorSearchLoading:B==="In-Progress",onVendorSearchTextChange:z,submitState:V,submitErrorMessage:c,documentUploadState:E,uploadedFileName:y,isAiCfoAccessEnabled:m,onAskAiCfoClick:F,onBackClick:P,onCancelClick:K,onClickMenuIcon:u,onFormChange:Z,onSubmit:I,onUploadDocument:M,onRemoveDocument:N})]}):o.jsx(Je,{to:"..",replace:!0})}const{spendManagement:{chargeCard:{cardPolicyPage:$c}}}=ea.getLocalizedStrings(),Mc=e=>Un(e,!1),Nc=e=>jn(e.name,!1);function Vc(){const e=de(),a=he(),{tenantEmailDomain:n,templateId:t}=Me(),s=me(),g=Le(),b=ve(g?.loggedInUserRoleMap),[h,A]=r.useState(!1),u=r.useCallback((c=>{A(c)}),[]),m=r.useCallback((()=>{u(!0)}),[u]),{isAiCfoAccessEnabled:F,onAskAiCfoClick:w}=xa({mobileExploreReferrer:"Card Policy"}),p=d((c=>Ss(c))),v=d((c=>Pn(c.cardPolicyState))),L=d((c=>wn(c.cardPolicyState))),S=d((c=>Tn(c.cardPolicyState))),l=d((c=>vn(c.cardPolicyState))),C=d((c=>Fn(c.cardPolicyState))),B=d((c=>xn(c.cardPolicyState))),k=d((c=>Bn(c.cardPolicyState))),_=d((c=>Pt(c.cardPolicyState))),D=d((c=>On(c))),$=d((c=>t!=null?ys(c.cardPolicyState,t):void 0)),E=r.useMemo((()=>p.templateId===t&&p.formDraft!=null?p.formDraft:$!=null?Is($):void 0),[p.templateId,p.formDraft,$,t]);r.useEffect((()=>{if(t==null)return;const c=p.detailFetchState.fetchState;p.templateId===t&&(c==="Completed"||c==="In-Progress")||$!=null||s(ks(t))}),[s,t,p.templateId,p.detailFetchState.fetchState,$]),r.useEffect((()=>{v!=="Completed"&&v!=="In-Progress"&&s(Ln())}),[s,v]),Fr();const y=d((c=>c.chargeCardConfigState.receiptRequiredAboveAmount.amount));r.useEffect((()=>{D.fetchState==="Not-Started"&&s(ia(!1,!1,!1))}),[D.fetchState,s]);const R=r.useMemo((()=>L.map(Mc)),[L]),i=r.useMemo((()=>k.map(Nc)),[k]),f=r.useMemo((()=>D.cards.filter((c=>!Cr(c.status.code))).map(vr)),[D.cards]);Lt({isDataReady:E!=null});const j=r.useMemo((()=>{if(E!=null)return ec({draft:E,cardRows:f,categorySearchOptions:R,vendorSearchOptions:i,defaultRequireReceiptAmount:y,suggestedAllowMerchants:S,suggestedBlockMerchants:l,suggestedAllowCategories:C,suggestedBlockCategories:B})}),[E,f,R,i,y,S,l,C,B]),[G,U]=r.useState(void 0),x=r.useRef(!1);r.useEffect((()=>{x.current||G!=null||j==null||(x.current=!0,U(j))}),[G,j]);const z=r.useCallback((c=>{U(c)}),[]),V=r.useMemo((()=>jt((c=>{s(wt(c))}),250)),[s]);r.useEffect((()=>()=>{V.cancel()}),[V]);const T=r.useCallback((c=>{V(c)}),[V]),P=p.updateFetchState.fetchState,K=n!=null?`/${n}/cards/policy`:"..",Z=r.useCallback((()=>{const c=we(a.state?.pathnameStackToGoBack),O=c.poppedPathname??K;e(O,{state:{pathnameStackToGoBack:c.newStack}})}),[a.state,e,K]),I=r.useCallback((()=>{e(K)}),[e,K]),M=r.useCallback((c=>{if(t==null)return;const O=pr(c);s(Es(O)),s(As(t))}),[s,t]),N=r.useRef(P);r.useEffect((()=>{const c=N.current;N.current=P,P==="Completed"&&c!=="Completed"&&(s(ze({messageSection:"card_policy_updated",messageText:"success",type:"success"})),e(K))}),[s,P,e,K]);const Q=P==="Error"?p.updateFetchState.error?.message??$c.updatePolicyGenericErrorMessage:void 0;return!b||n==null||t==null?o.jsx(Je,{to:"..",replace:!0}):G!=null&&v==="Completed"&&D.fetchState==="Completed"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(ac,{templateName:p.template?.name??"",formDraft:G,vendorSearchOptions:i,categorySearchOptions:R,isVendorSearchLoading:_==="In-Progress",onVendorSearchTextChange:T,submitState:P,submitErrorMessage:Q,isAiCfoAccessEnabled:F,onAskAiCfoClick:w,onBackClick:Z,onCancelClick:I,onClickMenuIcon:m,onFormChange:z,onSubmit:M})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:h,handleDrawerToggle:u}),o.jsx(hr,{showUploadDocumentSection:!1,navBarTitle:p.template?.name,onBackClick:Z,onClickMenuIcon:m,isAiCfoAccessEnabled:F,onAskAiCfoClick:w})]})}function xr(e,a,n){return a?e.filter((t=>t!=null&&t.trim().length>0)).slice(0,n):[]}function Br(e){return d((a=>e==null||e===""?{chips:ft,isResolved:!1}:(function(n){const t=n?.fetchState,s=t==="Completed"||t==="Error";return{chips:t==="Completed"?n?.suggestedQuestions??ft:ft,isResolved:s}})(Ds(a,e))),_t)}const ft=[],{spendManagement:{chargeCard:{cardPolicyAiCfoHero:{headline:Hc,subheadline:Gc,pageTitle:Kc}}}}=ea.getLocalizedStrings(),zc=e=>{const a=e.cardsCount>0?e.cardsCount:e.appliedCards.length,n=e.allowedEntity.merchantNames.length+e.blockedEntity.merchantNames.length,t=e.allowedEntity.categoryCodes.length+e.blockedEntity.categoryCodes.length;return{templateId:e.templateId,name:e.name,description:e.description,mode:e.mode==="flexible"?"flexible":"strict",createdAtFormatted:e.createdAt.format("ll"),cardsCount:a,vendorRestrictionsCount:n,categoryRestrictionsCount:t}};function Yc(){const e=de(),a=he(),{tenantEmailDomain:n}=Me(),t=me(),s=Le(),g=ve(s?.loggedInUserRoleMap),[b,h]=r.useState(!1),A=r.useCallback((T=>{h(T)}),[]),u=r.useCallback((()=>{A(!0)}),[A]),{useFeatureGate:m}=le(),{isFeatureEnabled:F}=m(W.isAiCfoFileUploadEnabled),{isFeatureEnabled:w}=m(W.isCardPolicyEnabled),{isAiCfoAccessEnabled:p,onAskAiCfoClick:v}=xa({mobileExploreReferrer:"Card Policy"}),L=d((T=>_s(T))),S=d((T=>Rn(T.createCardPolicyState))),l=d((T=>Ps(T.createCardPolicyState))),C=d((T=>l==null?[]:Mn(T.aiCfoState,l).filter((P=>P.kind==="creating_policy"))),_t),B=S.fetchState==="In-Progress"?Math.max(C.length,1):0,k=d((T=>ws(T.createCardPolicyState))),_=ya(S.fetchState);r.useEffect((()=>{if(_==="In-Progress"&&S.fetchState==="Completed"&&l!=null)C.forEach((T=>{t(yt({chatSessionId:l,id:T.id,entityIds:k,kind:"created_policy"}))}));else if(_==="In-Progress"&&S.fetchState==="Error"&&l!=null){C.forEach((P=>{t(yt({chatSessionId:l,id:P.id,kind:"errored_policy"}))}));const T=S.error?.message!=null&&S.error.message.length>0?S.error.message:ea.getLocalizedStrings().common.errorMessage.somethingWentWrongPleaseTryAgain;t(ze({messageSection:"card_policy_created",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"_api-error_",variableValue:T}]}))}}),[S.error?.message,S.fetchState,t,l,k,C,_]);const D=L.fetchState.fetchState;r.useEffect((()=>{D!=="Not-Started"&&D!=="Error"||t(Ts())}),[t,D]);const $=L.archiveFetchState.fetchState,E=ya($);r.useEffect((()=>{E==="In-Progress"&&$==="Completed"&&t(ze({messageSection:"card_policy_deleted",messageText:"success",type:"success"}))}),[$,t,E]);const y=r.useMemo((()=>L.templates.map(zc)),[L.templates]);Lt({isDataReady:L.fetchState.fetchState==="Completed"});const R=y.length>0||B>0,i=(function(T){const{hasAnyPolicies:P,isChargeCardAdmin:K,isFileUploadEnabled:Z}=T,I=de(),M=he(),{tenantEmailDomain:N}=Me(),{isAiCfoOpen:Q,setIsAiCfoOpen:c}=fr(),O=gr(),q=br(),se=d((J=>$n(J))).createSessionAndSubmitState.fetchState==="In-Progress",{chips:X,isResolved:Ve}=Br("card_policy"),Ae=r.useMemo((()=>xr(X,Ve,3)),[X,Ve]),[ge,re]=r.useState(""),be=q&&O&&N!=null&&!Q,ue=r.useCallback((J=>{if(N==null)return;const fa=ke(M.state?.pathnameStackToGoBack,M.pathname);I(`/${N}/cards/ask`,{state:{message:"",origin:"",pathnameStackToGoBack:fa,referrer:"card_policy_hero",aiCfoInitialQuestion:J,aiCfoShouldSubmit:J!=null&&J.trim().length>0}})}),[M.pathname,M.state,I,N]),oe=r.useCallback((J=>{J.trim().length!==0&&(re(""),ue(J))}),[ue]),Se=r.useCallback((()=>{const J=ge.trim();J.length!==0&&(re(""),ue(J))}),[ge,ue]),ee=r.useCallback((()=>{}),[]),De=r.useCallback((J=>{re(J)}),[]),Te=r.useCallback((()=>{c(!0)}),[c]),Ce=r.useCallback((()=>{ue(void 0)}),[ue]);return r.useMemo((()=>{if(be&&!P&&K)return{aiAgentName:Kc,headline:Hc,subheadline:Gc,promptChips:Ae,composer:{currentInput:ge,isSubmitting:se,isFileUploadEnabled:Z,onInputChange:De,onSubmit:Se,onStopSubmit:ee},onPromptClick:oe,onOpenSidePanel:Te,onOpenFullView:Ce,dataTestIdPrefix:"card-policy-ai-cfo-hero"}}),[ge,P,be,K,Z,se,De,Ce,Te,oe,ee,Se,Ae])})({hasAnyPolicies:R,isChargeCardAdmin:g,isFileUploadEnabled:F}),f=w&&i!=null?o.jsx(Sr,{...i}):null,j=p&&f==null,G=r.useCallback((()=>{const T=we(a.state?.pathnameStackToGoBack),P=T.poppedPathname??"..";e(P,{state:{pathnameStackToGoBack:T.newStack}})}),[a.state,e]),U=r.useCallback((()=>{n!=null&&e(`/${n}/cards/policy/new`)}),[e,n]),x=r.useCallback((T=>{n!=null&&e(`/${n}/cards/policy/${T}/edit`)}),[e,n]),z=r.useCallback((T=>{t(vs(T))}),[t]),V=L.fetchState.fetchState;return!R&&V!=="Completed"&&V!=="Error"?o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(tc,{onBackClick:G,onNewPolicyClick:U,onClickMenuIcon:u,isAiCfoAccessEnabled:p,onAskAiCfoClick:v})]}):o.jsxs(o.Fragment,{children:[o.jsx(Ee,{isAppContentDrawerOpen:b,handleDrawerToggle:A}),o.jsx(nc,{policies:y,archivingTemplateId:L.archiveTargetTemplateId,pendingCreationCount:B,onBackClick:G,onNewPolicyClick:U,onEditPolicyClick:x,onArchivePolicyClick:z,onClickMenuIcon:u,policyAiCfoHero:f,isAiCfoAccessEnabled:j,onAskAiCfoClick:v})]})}function Wc(){const e=de(),{cardId:a}=Me(),n=me(),t=te.getSignedInUser(),s=d((X=>fe(X))),g=Le(),b=ve(g?.loggedInUserRoleMap),{useFeatureGate:h}=le();if(t==null)throw Error("Can't access Add To Wallet Page without signing in...");const[A,u]=r.useState(!1),m=d((X=>qa(X).firstViewAfterActivation));if(a==null)throw Error("Empty card id is not valid...");const F=s.userRole.includes("charge_card_user"),{isFeatureEnabled:w}=h(W.isChargeCardFeatureEnabled),p=!!s.companyChargeCardInfo?.info?.isChargeCardEnabled,{isFeatureEnabled:v}=h(W.isDebitCardFeatureEnabled),L=Fe(s),S=xe(s),l=Be(v,s),C=s.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,B=Re({isDebitCardFeatureEnabled:v,isBankingOnlyTenant:l}),k=Oe({isCardsOnlyTenant:L,isChargeCardFeatureEnabled:w,isBookKeepingTenant:S,isDebitCardProductVisible:B,chargeCardsCreditAccountLimit:C}),_=!!s.companyDebitCardInfo?.info?.isDebitCardEnabled,D=d((X=>da(X,s.companyId))),$=la(D.controllers),{creditAccount:E,creditAccountRepayment:y}=d((X=>ua(X))),R=d((X=>X.classListState.fetchState)),i=!F&&k&&p,f=d((X=>Tt(X,a,i,k))),[j,G]=r.useState(!1),U=f.chargeCard,x=U?.cardCreatedByUser?.userId,z=d((X=>x!=null?Ga(X.userRoleState,x):void 0)),V=z?.accountingClassIDs[0],T=d((X=>V!=null?Ka(X.classState,{classId:V,reportId:"class_list"}):void 0)),P=U?.cardHolderUser?.userId,K=d((X=>P!=null?Ga(X.userRoleState,P):void 0)),Z=K?.accountingClassIDs[0],I=d((X=>Z!=null?Ka(X.classState,{classId:Z,reportId:"class_list"}):void 0)),M=U?.type.code==="business_physical_credit_card"||U?.type.code==="business_physical_debit_card",N=U?.type.code==="business_physical_debit_card";r.useEffect((()=>{m&&A===!1&&M&&(u(!0),setTimeout((()=>{n(za()),N&&n(ze({messageSection:"set_debit_card_pin",messageText:"success",type:"success",showStatusIcon:!0}))}),5e3))}),[m,A,M,N]),r.useEffect((()=>{j||f.fetchState==="Completed"||f.fetchState==="In-Progress"||a==null||(G(!0),n(ka(a,i,!1)))}),[j,f,a,n]),r.useEffect((()=>{if(f.fetchState==="Completed"&&(M===!1||M&&U?.status?.code!=="active"||U?.cardHolderUserId!==t.userId||m===!1&&A===!1||U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card")){const X=_e(s.tenantEmailDomain,a,t,U,m);e(X)}}),[f.fetchState,m,M]),r.useEffect((()=>{E.fetchState!=="Completed"&&E.fetchState!=="In-Progress"&&k&&p&&b&&n(qe()),y.fetchState!=="Completed"&&y.fetchState!=="In-Progress"&&k&&p&&b&&n(vt()),R!=="Completed"&&R!=="In-Progress"&&n(Nn())}),[E.fetchState,y.fetchState,n,k,p,b,R]);const Q=()=>{if(t!=null&&a!=null){n(za());const X=_e(s.tenantEmailDomain,a,t);e(X)}},c=U?.type.code==="business_physical_debit_card"||U?.type.code==="business_virtual_debit_card",O=Xe(k,B,_,p),q=Ba(k,p,b,E,y),se=Dr(c,f);return f.fetchState!=="Completed"?o.jsx(Ta,{fetchState:"In-Progress"}):o.jsxs(o.Fragment,{children:[o.jsx(nt,{showConfetti:m}),o.jsx(rc,{onGotItClick:Q,isDebitCard:U?.type.code==="business_physical_debit_card",controllerEmails:$,isChargeCardFeatureEnabled:k,isDebitCardFeatureEnabled:B,isDebitCardSetupEnabled:_,isChargeCardSetupEnabled:p,productInformation:O,creditAccountInformation:q,debitAccountInformation:se,chargeCardDetailView:f,creditAccount:E,classListFetchState:R,creditAccountRepayment:y,cardIssuedByRoles:z?.userRoles,cardIssuedByDepartmentName:T?.className,cardHolderRoles:K?.userRoles,cardHolderDepartmentName:I?.className})]})}const Lr="charge-card-transaction-update",Rr="charge-card-transaction-created",Or="charge-card-transaction-declined",Ur="charge-card-transaction-updated",jr="charge-card-transaction-receipt-uploaded",pa="charge-card-status-update",Vt="charge-card-spending-updated",ct="credit-account-balance-updated",it="charge-card-created",Ht="charge-card-limit-updated",Gt="charge-card-limit-reset",Kt="charge-card-renamed",Zc="charge-card-department-updated",$r="charge-card-repayment-completed",Mr="charge-card-payment-date-updated",La="charge-card-cashback-redeemed",Ra="charge-card-cashback-earned",ha=(e,a)=>e==null||e===""?[]:a.map((n=>`private-encrypted-${e}.${n}`)),qc=[Ra,La],Jc=Pe((function(e){const a=ma(e);return{insightsData:a.insight,cashbackByPeriod:a.cashbackByPeriod,uiState:a.uiState,cashbackSummary:a.cashbackSummary}}),(function(e){return{onColumnSortConfigChanged:(a,n)=>{e(Fs({uiState:{sortKey:a,sortOrder:n}}))}}}))(oc);function Qc(){const e=de(),a=me(),n=he(),t=te.getSignedInUser(),s=d((v=>fe(v))),{useFeatureGate:g}=le(),{isFeatureEnabled:b}=g(W.isCardsCommentingEnabled),[h,A]=r.useState(!1),u=d((v=>ma(v))),m=Tr(s.companyId,{clearParams:u.fetchState==="Completed"}),F=r.useCallback((()=>{const v=we(n.state?.pathnameStackToGoBack),L=v.poppedPathname??Xc(s.tenantEmailDomain);e(L,{state:{pathnameStackToGoBack:v.newStack}})}),[e,n,s.tenantEmailDomain]),w=aa(s);if(Nt({events:ha(w,qc),onEvent:v=>{switch(v){case Ra:case La:return void a(_a(!0))}},onSubscribed:()=>{a(_a(!0))}}),r.useEffect((()=>{h||u.fetchState==="Completed"||u.fetchState==="In-Progress"||(A(!0),a(_a()))}),[h,u,a]),t==null)throw Error("Can't access cashback detail page without signing in...");const p=u.cashbackSummary?.cashbackEarned?.amount!=null&&u.fetchState!=="Not-Started";return u.fetchState!=="In-Progress"||p?(u.cashbackSummary?.cashbackEarned?.amount??0)===0&&u.fetchState==="Completed"?o.jsx(ot,{}):o.jsx(Jc,{onBackClick:F,isCardsCommentingEnabled:b,initialOpenThreadRequest:m}):o.jsx(sc,{onBackClick:F})}const Xc=e=>`/${e}/cards`,ei={containerWidth:new Fa(100,58)},ai=({appContent:e})=>{const a=va(),n=me(),t=de(),{cardId:s}=Me(),g=he(),{useDynamicConfig:b}=le(),[h,A]=r.useState(!1),[u,m]=r.useState(!1),[F,w]=r.useState(!1),[p,v]=r.useState(!1),L=te.getSignedInUser();if(L==null)throw Error("Can't access onboarding card page without signing in...");const S=d((I=>fe(I)));if(s==null)throw Error("Empty card id is not valid...");const{configValue:l}=b(Qe.zeniCardsConfig),C=l.max_charge_card_activation_attempts_by_card_id,B=d((I=>xs(I,s))),k=B.chargeCard,_=d((I=>I.chargeCardConfigState.fetchState)),{useFeatureGate:D}=le(),{isFeatureEnabled:$}=D(W.isChargeCardFeatureEnabled),{isFeatureEnabled:E}=D(W.isDebitCardFeatureEnabled),y=Be(E,S),R=Re({isDebitCardFeatureEnabled:E,isBankingOnlyTenant:y}),i=!!S.companyChargeCardInfo?.info?.isChargeCardEnabled,f=S.userRole.includes("charge_card_user"),j=Fe(S),G=xe(S),U=S.companyChargeCardInfo?.info?.chargeCardsCreditAccountLimit??0,x=Oe({isCardsOnlyTenant:j,isChargeCardFeatureEnabled:$,isBookKeepingTenant:G,isDebitCardProductVisible:R,chargeCardsCreditAccountLimit:U}),z=!f&&x&&i;r.useEffect((()=>{h===!1&&_!=="In-Progress"&&_!=="Completed"&&(n(Ja()),A(!0)),u===!1&&B.fetchState==="Not-Started"&&(m(!0),n(ka(s,z,x)))}),[u,B.fetchState,h,_]);const V=k?.type.code==="business_physical_credit_card"||k?.type.code==="business_physical_debit_card";r.useEffect((()=>{if(B.fetchState==="Completed"){if(F===!1&&(V===!1||V&&k?.status?.code!=="inactive"||k?.cardHolderUserId!==L.userId)){const I=_e(S.tenantEmailDomain,s,L,k,!0),M=ke(g.state?.pathnameStackToGoBack,g.pathname);t(I,{state:{pathnameStackToGoBack:M}})}else if(F&&B.isRefreshingViewInBackground===!1&&k?.status?.code==="active"){n(Bs({chargeCardId:s}));const I=_e(S.tenantEmailDomain,s,L,k,!0),M=ke(g.state?.pathnameStackToGoBack,g.pathname);n(Qa()),t(I,{state:{pathnameStackToGoBack:M}})}}}),[B.fetchState,k?.type.code,F,B.isRefreshingViewInBackground]);const T=te.getZeniOtpTokenForCardHolder(s),P=d((I=>Vn(I.userState,L.userId))),K=()=>{k?.status?.code!=="active"&&n(ba(s,!0))};r.useEffect((()=>{B.updatePhysicalChargeCardAttemptFetchState.fetchState==="Completed"&&k?.cardActivationAttemptHistory.some((I=>I.statusCode==="success"))===!0&&F===!1&&(setTimeout(K,3e3),w(!0))}),[B.updatePhysicalChargeCardAttemptFetchState.fetchState,k?.cardActivationAttemptHistory]);const Z=I=>{v(I)};if(_!=="Completed"||k==null)return o.jsx(Ta,{fetchState:"In-Progress"});if(k.shippingAddressId==null)throw Error("Can't access shippingAddressId.");if(P?.phone==null)throw Error("Can't access user phone number.");return o.jsxs(ri,{children:[o.jsx(Ee,{isAppContentDrawerOpen:p,handleDrawerToggle:Z}),o.jsx(ti,{cardId:s,card:k,shippingAddressId:k.shippingAddressId,phone:P.phone,signedInUser:L,isSandboxEnv:Rt(),chargeCardDetailState:B,signedInUserToken:T,navigate:t,currentTenant:S,location:g,maxChargeCardActivationAttempts:C[s]!=null?C[s]:l.default_max_charge_card_activation_attempts!=null?l.default_max_charge_card_activation_attempts:3,chargeCardCashbackRatePerTransaction:l.charge_card_cashback_rate_per_transaction!=null?l.charge_card_cashback_rate_per_transaction:.0175,onClickMenuIcon:()=>{Z(!0)}}),e!=null?o.jsx(ni,{windowSize:a,children:e}):null]})},ti=Pe((function(e,{chargeCardDetailState:a,shippingAddressId:n,location:t,cardId:s}){const g=Ls(e.addressState,n);if(g==null)throw Error("Can't access shippingAddress.");const b=Hn(e,s),h=a.updateStatus,A=Ca(e,!1,!1,!1);let u=!1;A.fetchState==="Completed"&&A.cards.length<=1&&(u=!0);const m=t.state?.message==="comingFromV2UrlPath";return{showActivatePage:a.chargeCard?.providerCardCreateTime!=null&&a.chargeCard.providerCardCreateTime.add(24,"h").isBefore(Rs())||m,showMenuIcon:u,shippingAddress:g,vgsVaultId:rt.cardVaultId,twoFAView:b,activationWaitStatus:h,isRefreshingViewInBackground:a.isRefreshingViewInBackground}}),(function(e,a){const{navigate:n,cardId:t,location:s,currentTenant:g,chargeCardDetailState:b}=a,h=b.chargeCard?.cardProviderID,{tenantEmailDomain:A}=g;return{onGetOtp:u=>{h!=null&&e(at(u,"ChargeCardHolder",t))},onUpdatePhysicalChargeCardAttempt:u=>{e(Us(t,u))},onResendOtp:u=>{h!=null&&e(et(u,"ChargeCardHolder",t))},onVerifyOtp:(u,m)=>{h!=null&&e(Xa(u,m,"ChargeCardHolder",t))},onVerifyOtpSuccess:u=>{u!=null&&te.saveZeniOtpTokenForCardHolder(u,t)},onCVVActivateSuccess:()=>{e(Os({chargeCardId:t}))},onBackClick:()=>{const u=we(s.state?.pathnameStackToGoBack),m=u.poppedPathname==null||u.poppedPathname.includes("onboard")===!0?ta(A):u.poppedPathname;n(m,{state:{pathnameStackToGoBack:u.newStack}})}}}))(cc),ni=Ne.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: ${e=>`${ei.containerWidth.value(e.windowSize)}%`};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as m}from"./liveblocks-CPy_3T4M.js";import{a as g}from"./sentry-B8WE62R1.js";import{h as w,u as k,g as x,i as T,j as O,l as E}from"./core-DHfFJrfH.js";import{z as N,br as F,a8 as P,j as V,U as j,r as b,bs as A,ae as L,aG as U,k as B}from"./index-BxJdVany.js";import{fE as D,gH as M,AY as _,gC as G,c8 as R,Xt as z,bn as Y,ul as H,u9 as X,my as Z,o7 as S,Xu as $,bE as q,cE as C,oi as J,os as K}from"./zeni-epic-state-CgS-13Rp.js";import"./mui-BCtxe7Uc.js";import{d as Q}from"./routePaths-T6NVNRXw.js";import{M as W}from"./MobileAppDrawer-k5UN-ZVo.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="910317a1-62b2-4500-b639-a42b2f5b852c",t._sentryDebugIdIdentifier="sentry-dbid-910317a1-62b2-4500-b639-a42b2f5b852c")}catch{}})();const ee=E((function(t){const a=G(t),i=N.getSignedInUser(),l=D(t),c=l.tenantId,p={userId:i?.userId??"",sessionId:i?.zeniSessionId??"",tenantId:c??""},f=R(l?.userRole??[])&&a.localData.updateStatus.fetchState!=="In-Progress"?void 0:"readonly",e=z(t.companyConfigState),n=t.countryListState?.byCountryListCode?.nationalityCountryList?.countries??[];return{isCompanyVerified:a.companyView?.company?.company?.companyBillPayInfo?.companyVerificationStatus?.code==="verified",companyPassportView:a,allIndustries:e.companyIndustries??[],allNationalityCountries:n,isDisabled:f,authParams:p,filesEndPoint:`${L.fileMicroServiceBaseUrl}`,isZeniUser:Y(i)}}),(function(t,a){const{companyId:i,currentTenant:l,navigate:c,location:p}=a,{tenantEmailDomain:f}=l;return{onScheduleClick:e=>{let n=e.href;n.includes("http")||(n="https://".concat(n)),window.open(n,"_blank")},onSaveAll:()=>{t(K())},onAddressClick:e=>{const n=Q(f,e),o=B(p.state?.pathnameStackToGoBack,p.pathname);c(n,{state:{pathnameStackToGoBack:o}})},onResetClick:()=>{t(J({companyId:i}))},onBackClick:()=>{c("../")},onCompanyDetailsChanged:e=>{const{companyInfo:n,incInfo:o,taxDetails:r,zeniFinanceTeam:d}=e,{website:u}=n,{meetingLink:y}=d,{incDate:s}=o,{taxesFiledYears:h}=r,v={companyInfo:{...n,website:u!=""&&u!=null?C(u):void 0,meetingLink:y!=""&&y!=null?C(y):void 0,industry:n.industry.selectedOption,companyIndustryType:n.companyIndustryType?.selectedOption??void 0,companySubIndustry:n.companySubIndustry?.selectedOption??void 0,businessModel:n.businessModel.selectedOption??"",companySourceOfFunds:n.companySourceOfFunds?.selectedOption,companySourceOfFundsDescription:n.companySourceOfFundsDescription??void 0,countriesOfOperations:n.countriesOfOperations?.selectedOptions?.map((I=>I.length===2?I:U(I)))??[],transactionVolume:n.transactionVolume?.selectedOption??void 0,transactionVolumeDescription:n.transactionVolumeDescription??void 0,regulatedStatus:n.regulatedStatus??void 0,regulatedStatusDescription:n.regulatedStatusDescription??void 0,usNexus:n.usNexus??void 0,usNexusTypes:n.usNexusTypes?.selectedOptions??[],purposeOfAccount:n.purposeOfAccount?.selectedOption??void 0,purposeOfAccountDescription:n.purposeOfAccountDescription??void 0},incInfo:{typeOfInc:o.typeOfInc.selectedOption??"",stateOfInc:o.stateOfInc.selectedOption??"",incDate:s!=null?q(s?.toString()):s,fileId:o.fileIds[0]},taxDetails:{taxIdOrEIN:r.taxIdOrEIN,sicCode:r.sicCode,naicsCode:r.naicsCode,dunsNumber:r.dunsNumber,taxesFiledYears:h.selectedOptions.map((I=>parseInt(I))),fileId:r.fileIds[0]}};t(S({companyDetails:v}))},onPrimaryContactDetailsUpdated:e=>{t(S({primaryContact:{userId:e.userId,email:e.email.trim(),firstName:e.name.firstName,lastName:e.name.lastName}}))},onNewCompanyOfficerAdded:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:void 0}]}))},onNewCompanyOfficerRemoved:e=>{t($(e))},onCompanyOfficerUpdated:e=>{t(S({officers:[{officerType:e.officerType,email:e.email.trim(),phone:e.phone,firstName:e.name.firstName,lastName:e.name.lastName,userId:e.userId}]}))},updateFilesEntity:e=>{t(Z({files:e}))},onDeleteFile:e=>{t(X(e))},onEditFileName:(e,n)=>{t(H(e,n.split(".")[0]))}}}))(A);function de(){const t=w(),a=k(),i=x(),{tenantEmailDomain:l}=T(),[c,p]=g.useState(!1),[f,e]=g.useState(!1),n=O((s=>s.companyViewState.passportView.fetchState)),o=O((s=>s.companyConfigState.fetchState)),r=O((s=>D(s))),d=r.companyId??N.getSignedInUserTenant(l)?.companyId;if(N.getSignedInUser()==null)throw Error("Can't access company details page without signing in...");g.useEffect((()=>{c||n!=="Not-Started"||d==null||(p(!0),a(M(d)))}),[c,n,d,a]),g.useEffect((()=>{o==="Not-Started"&&a(_())}),[o,a]);const u=s=>{e(s)},y=n==="Not-Started"||n==="In-Progress"||o==="Not-Started"||o==="In-Progress";return d!=null&&n==="Error"?m.jsx(F,{onGoHome:()=>t("../",{replace:!0}),onReload:()=>window.location.reload()}):m.jsxs(m.Fragment,{children:[m.jsx(P,{analytics:V,onLoad:s=>s.trackPageLoaded(j.Event.companyPassport,b(i)?"Settings":"Company Passport")}),b(i)?m.jsx(W,{isAppContentDrawerOpen:f,handleDrawerToggle:u}):null,m.jsx(ee,{companyId:d,navigate:t,location:i,isLoading:y,currentTenant:r,isSettings:b(i),onClickMenuIcon:()=>{u(!0)}})]})}export{de as C};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as I}from"./liveblocks-
|
|
1
|
+
import{j as I}from"./liveblocks-CPy_3T4M.js";import{a as o}from"./sentry-B8WE62R1.js";import{u as F,h as P,g as z,j as C,N as w}from"./core-DHfFJrfH.js";import{T9 as H,fE as q,gk as G,pR as Q,gL as A,gj as V,gh as B,Tz as J,gg as O}from"./zeni-epic-state-CgS-13Rp.js";import{u as K,z as E,L as D,G as M,N as W}from"./index-BxJdVany.js";import{n as X}from"./mui-BCtxe7Uc.js";import{P as b,a as _}from"./AccountMappingScreen-FWj5nDCB.js";import{t as Y}from"./getLocaleForTenant-D_V8_IAs.js";import{g as Z,Q as ee}from"./QBOConnectionScreen-D_CvuPpu.js";import"./recharts-B2QzdJEJ.js";import"./analytics-MT8j1Arr.js";import"./plaid-BSrnBML8.js";import"./dnd-DG4Q4PBR.js";import"./stripe-cKAAJElX.js";import"./lottie-CPIsfbGQ.js";import"./lexical-Ds-L3Ehk.js";import"./pdf-BNLZqB1A.js";import"./utils-BAMwHjCz.js";import"./MobileAppDrawer-k5UN-ZVo.js";import"./InboxNotificationsProvider-8Zmc_gz4.js";import"./useTaskManagerAccess-D10G2ni1.js";import"./accountMappingHelper-65Fk5KmX.js";import"./empty-Hx6SHn8J.js";import"./pdf-lib-Dl0EkJKh.js";import"./index-scA92wXl.js";import"./url-Cgny8pWv.js";import"./index-dAj1V_OM.js";import"./decodeURIComponentSafe-DnV8TwS0.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},i=new t.Error().stack;i&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[i]="118b1af3-6445-4133-b1b3-8124b23c3fb3",t._sentryDebugIdIdentifier="sentry-dbid-118b1af3-6445-4133-b1b3-8124b23c3fb3")}catch{}})();const te=X.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
flex-direction: row;
|
|
@@ -8,4 +8,4 @@ import{j as I}from"./liveblocks-CyXsV56c.js";import{a as o}from"./sentry-T7AA_ij
|
|
|
8
8
|
height: 100vh;
|
|
9
9
|
background-color: ${t=>t.theme.colors.background};
|
|
10
10
|
box-shadow: ${t=>`0px 2px ${W.sp1} ${t.theme.colors.dropShadowNormal}`};
|
|
11
|
-
`;function we(){const t=F(),i=P(),v=z(),{setLoading:d,clearAllLoading:m}=
|
|
11
|
+
`;function we(){const t=F(),i=P(),v=z(),{setLoading:d,clearAllLoading:m}=K(),h=o.useRef(!1),S=o.useRef(!1),N=o.useRef(!1),p=o.useRef(!1),{code:L,realmId:U,state:$}=Z(v.search),f=L!==""&&U!==""&&$!=="";f&&(N.current=!0);const j=sessionStorage.getItem(b),u=j===_.pending,R=j===_.ready,x=C((s=>H(s))),e=C((s=>q(s))),n=C((s=>s.tenantState.fetchState)),r=C((s=>s.tenantState.activeTenantFetchState.fetchState)),a=E.getSignedInUser(),g=E.getActiveTenantForUser()?.tenantId,l=e?.externalConnections?.fetchState,c=e?.externalConnections?.saveConnectionState,y=e.externalConnections?.accounting[0]?.isValid;o.useLayoutEffect((()=>{d(D.CONNECTION_AUTH)}),[d]),o.useEffect((()=>{h.current||a==null||g==null||(h.current=!0,n==="Completed"||r!=="Not-Started"&&r!=="Error"||(d(D.TENANT_FETCHING),t(G(a.userId,g))))}),[h,n,d]),o.useEffect((()=>{e.tenantId==null&&!S.current&&a!=null&&(S.current=!0,!(g==null||g!=null&&(r==="Completed"||r==="Error"))||n!=="Not-Started"&&n!=="Error"||t(Q(a.userId)))}),[S,n,r]),o.useEffect((()=>{a==null||e?.tenantId==null||e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||c!=="Error"||(d(D.CONNECTION_AUTH),t(A(a.userId,e.tenantId)))}),[c]),o.useEffect((()=>{n!=="Completed"&&r!=="Completed"||a==null||e?.tenantId==null||(t(V(e.tenantId)),E.saveActiveTenantDomainForUser(e.tenantEmailDomain),B(a?.userId,a?.zeniSessionId,e.tenantId),M.updateAppLocaleID(Y(J(e))),e.externalConnections!=null||n!=="Completed"&&r!=="Completed"||l==="In-Progress"||a==null||e==null||t(A(a.userId,e.tenantId)))}),[n,r,l]),o.useEffect((()=>{x.tenantsCoreDetailsInOrder.length>0&&n==="Completed"&&E.saveSignedInUserTenants(x.tenantsCoreDetailsInOrder)}),[x.tenantsCoreDetailsInOrder.length,n]);const T=e==null||n!=="Completed"&&r!=="Completed"||l!=="Completed";if(o.useEffect((()=>{n!=="Completed"&&n!=="Error"||r!=="Completed"&&r!=="Error"||l!=="Completed"&&l!=="Error"||m()}),[n,r,l]),o.useEffect((()=>{u&&c==="In-Progress"&&(p.current=!0)}),[u,c]),o.useEffect((()=>{if(!u||T)return;const s=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return p.current&&c==="Completed"?(sessionStorage.setItem(b,_.ready),m(),void i(s,{replace:!0})):p.current&&c==="Error"?(sessionStorage.removeItem(b),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),void i(s,{replace:!0})):void(f||N.current||p.current||y!==!0||(sessionStorage.removeItem(b),t(O({messageSection:"accounting_projects_qbo_reconnect_failed",messageText:"failed",type:"error"})),m(),i(s,{replace:!0})))}),[u,T,c,f,y,e.tenantEmailDomain,m,t,i]),T)return null;if(f||y!==!0)return I.jsx(te,{children:I.jsx(ee,{})});if(u)return null;const k=e.tenantEmailDomain!=null?`/${e.tenantEmailDomain}/settings/accounting`:"/";return R?I.jsx(w,{to:k,replace:!0}):I.jsx(w,{to:"/",replace:!0})}export{we as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as i}from"./liveblocks-CPy_3T4M.js";import{z as a}from"./index-BxJdVany.js";import{g as n}from"./QBOConnectionScreen-D_CvuPpu.js";import"./sentry-B8WE62R1.js";import{g as p,N as s}from"./core-DHfFJrfH.js";import"./zeni-epic-state-CgS-13Rp.js";import"./recharts-B2QzdJEJ.js";import"./mui-BCtxe7Uc.js";import"./analytics-MT8j1Arr.js";import"./plaid-BSrnBML8.js";import"./dnd-DG4Q4PBR.js";import"./stripe-cKAAJElX.js";import"./lottie-CPIsfbGQ.js";import"./lexical-Ds-L3Ehk.js";import"./pdf-BNLZqB1A.js";import"./utils-BAMwHjCz.js";import"./empty-Hx6SHn8J.js";import"./pdf-lib-Dl0EkJKh.js";import"./index-scA92wXl.js";import"./url-Cgny8pWv.js";import"./index-dAj1V_OM.js";import"./decodeURIComponentSafe-DnV8TwS0.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]="c18cd95e-770d-4ff7-92bf-3374948ea538",t._sentryDebugIdIdentifier="sentry-dbid-c18cd95e-770d-4ff7-92bf-3374948ea538")}catch{}})();const U=()=>{const t=p(),{code:o,realmId:r,state:e}=n(t.search),d=a.getSignedInUser()?.userId??"";if(f(o,r,e,d)===!0){const m=`../../${e}/onboarding?code=${o}&realmId=${r}&state=auth_flow`;return i.jsx(s,{to:m})}return i.jsx(s,{to:"../../"})},f=(t,o,r,e)=>t!=""&&o!=""&&r!=""&&e!=null&&e!="";export{U as default,f as hasValidParams};
|
package/dist/assets/{CustomerOnboardingRoutes-cRAk7rF8.js → CustomerOnboardingRoutes-CBVh4ilH.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-CPy_3T4M.js";import{t as An,A as $e}from"./AddressScreen-BIEQJvnM.js";import wn from"./NotFoundScreen-DsHUR7rB.js";import{a as d,t as Me}from"./sentry-B8WE62R1.js";import{h as _e,g as Te,u as se,i as Ee,j as x,N as Q,q as Pn,l as cn,n as Dn,o as H}from"./core-DHfFJrfH.js";import{fE as Y,dY as xe,dX as Ae,bq as Un,Tq as jn,bR as Bn,pP as Fn,AI as Rn,AL as Vn,UM as Ln,UN as Nn,lt as Oe,lw as dn,U0 as Gn,b$ as $n,c8 as fe,Ba as we,AX as Mn,UO as me,Bb as un,RA as Qn,mG as ln,dh as pn,UP as Kn,UQ as zn,u2 as qn,TQ as Ce,hU as Hn,TP as be,hR as Zn,FA as Jn,u6 as Wn,hJ as Xn,hM as Qe,UR as mn,US as Yn,Ll as et,UT as nt,Lp as tt,AO as at,UU as ot,UV as st,lr as rt,lu as it,Bn as ct,AZ as gn,B9 as dt,bE as Ke,cE as ut,Bm as ze,ul as lt,u9 as pt,my as mt,gF as gt,gE as ft,gD as yt,UW as ht,AR as Ct,Bo as bt,Br as St,Bu as It,BA as kt,di as Ot}from"./zeni-epic-state-CgS-13Rp.js";import{z,M as Pe,y as W,p as vt,k as q,a8 as re,j as g,aE as _t,ai as fn,a1 as Tt,K as yn,V as hn,l as X,Z as ge,U as ve,aF as Et,N as qe,A as He,ae as xt,aG as Ze,aH as At,aI as wt}from"./index-BxJdVany.js";import{n as De}from"./mui-BCtxe7Uc.js";import{g as Pt,h as Dt,q as ie}from"./QBOConnectionScreen-D_CvuPpu.js";import{u as Ut,a as jt}from"./useEmailConnectResultRefresh-CgnDEvXl.js";import{u as Bt}from"./useChargeCardPusherEvents-DwnR999Q.js";import"./recharts-B2QzdJEJ.js";import"./analytics-MT8j1Arr.js";import"./plaid-BSrnBML8.js";import"./dnd-DG4Q4PBR.js";import"./stripe-cKAAJElX.js";import"./lottie-CPIsfbGQ.js";import"./lexical-Ds-L3Ehk.js";import"./pdf-BNLZqB1A.js";import"./utils-BAMwHjCz.js";import"./empty-Hx6SHn8J.js";import"./pdf-lib-Dl0EkJKh.js";import"./index-scA92wXl.js";import"./url-Cgny8pWv.js";import"./index-dAj1V_OM.js";import"./decodeURIComponentSafe-DnV8TwS0.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},l=new e.Error().stack;l&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[l]="7fe15009-b513-49d5-ad14-86919fd8589f",e._sentryDebugIdIdentifier="sentry-dbid-7fe15009-b513-49d5-ad14-86919fd8589f")}catch{}})();const Je=e=>{switch(e){case"Complete":return"yes";case"Pending Review":case"Incomplete":return"partially";default:return"no"}},Ft=()=>{const e=_e(),l=Te(),i=se(),[a,p]=d.useState(!1),[u,c]=d.useState(!1),{tenantEmailDomain:v}=Ee(),n=z.getSignedInUser(),{useFeatureGate:t}=Pe(),{isFeatureEnabled:C}=t(W.isApAgingFeatureEnabled),{isFeatureEnabled:o}=t(W.isArAgingFeatureEnabled),{isFeatureEnabled:w}=t(W.isReferralFeatureEnabled),{isFeatureEnabled:A}=t(W.isDebitCardFeatureEnabled),k=vt(),O=x((S=>Y(S))),P=x((S=>S.onboardingCustomerViewState.fetchState)),_=O.excludedResources,B=O.companyId??z.getSignedInUserTenant(v)?.companyId;if(n==null)throw Error("Can't access onboarding flow without signing in...");const m=xe(A,O),b=Ae(O),D=[],R=_?.resources?.find((S=>S.resource==="/reports/top_expenses"))==null,h=_?.resources?.find((S=>S.resource==="/reports/task_card"))==null,r=O?.userRole!=null&&Un(O?.userRole),T=_?.resources?.find((S=>S.resource==="/bills"))==null&&!r,E=_?.resources?.find((S=>S.resource==="/reimbursements"))==null;R===!1&&D.push("top_expenses"),h===!1&&D.push("task_card"),T===!1&&D.push("bill_pay_card","bill_pay_promo_card"),E===!1&&D.push("reimbursement_card","reimbursement_promo_card"),D.push("zeni_accounts_promo_card","treasury_promo_card"),w===!1&&D.push("rewards_card");const f=x((S=>{const F=[];C===!1&&F.push("accounts_payable_aging"),o===!1&&F.push("accounts_receivable_aging"),F.push("zeni_accounts_promo_card","treasury_promo_card"),w===!1&&F.push("rewards_card"),k===!1&&F.push("expense_automation_card");const Z=jn(S,F);return Bn(Z.reportsInOrder.map(($=>({fetchState:$.fetchState,error:$.error})))).fetchState}));d.useEffect((()=>{P!=="Completed"||a||m||b||(p(!0),i(Fn(n.userId,B,O.tenantId,!0,!1,D)))}),[a,P,m,b,n,O.tenantId,i]);const U=d.useRef(!1),N=d.useCallback((()=>{const S={pathnameStackToGoBack:q(l.state?.pathnameStackToGoBack,l.pathname),message:"activation"};e(m?"../../checking":b?"../../cards":"../../dashboard",{state:S})}),[e,l,m,b]),G=d.useCallback((()=>{U.current||(U.current=!0,N())}),[N]);if(d.useEffect((()=>{const S=setTimeout((()=>c(!0)),3e3);return()=>clearTimeout(S)}),[]),d.useEffect((()=>{const S=setTimeout(G,6e3);return()=>clearTimeout(S)}),[G]),d.useEffect((()=>{m||b||!u||f!=="Completed"&&f!=="Error"||G()}),[u,f,m,b,G]),P!=="Completed")return s.jsx(Q,{to:"../"});const L=O.company?.companyOnboardingInfo?.onboardingInfo,ee={timeSinceQuoteSign:L?.onboardingTimeSinceQuoteSigned??"",timeSinceQuoteSignInMinutes:L?.onboardingToQuoteSignMinutes??0,isKybDone:Je(L?.businessVerified?.status),isKycDone:Je(L?.identityVerified?.status),paymentType:"",paymentSource:"",qboConnectionSource:L?.accountingConnectionCreationMode??""};return s.jsxs(s.Fragment,{children:[s.jsx(re,{analytics:g,onLoad:S=>S.trackOnboardingDashboardActivation(ee)}),s.jsx(_t,{show:!0,onComplete:G})]})},Se=["reading_books","finance_graph","reconciliation","cfo_foundation"],Ie=["llm_fine_tuning","rag_knowledge_graph","personalized_context"],We=(e,l)=>{const i=new Map(e.map((a=>[a.key,a])));return l.map((a=>{return p=i.get(a)?.status,p==="starting"||p==="building"?p:"idle";var p}))},Xe=(e,l)=>{if(e.length===0)return!1;const i=new Map(e.map((a=>[a.key,a])));return l.every((a=>i.get(a)?.status==="ready"))},Ye=De.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
background-color: ${e=>e.theme.colors.grey4};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as d}from"./liveblocks-CyXsV56c.js";import{i as K,j as _,g as Z,u as z,h as J,l as ne,k as oa,n as ft,o as F,N as yn}from"./core-DCcrGtvx.js";import{fE as L,V6 as Ze,bE as sa,br as Ee,Wt as vn,k9 as An,Wu as Yt,Wv as In,kc as gt,Ww as qe,Wx as En,kh as Dn,Wy as Gt,Wz as Tn,kl as bt,WA as Qe,WB as xn,WC as wn,Vq as Pn,ln as On,WD as Fn,bn as Je,WE as ra,W4 as ue,bc as ia,lB as ca,lk as la,W6 as me,W5 as ae,fD as da,g9 as jn,gp as Ct,WF as Rn,WG as Bn,WH as ua,WI as Oe,Dh as Me,Di as Ue,DG as De,DA as pe,Dm as Le,WJ as Mn,b$ as Ve,WK as Un,WL as Ln,WM as ma,WN as Fe,WO as Vn,eb as et,zu as pa,WP as Yn,WQ as ha,WR as Gn,WS as Nn,WT as $n,WU as St,U2 as kt,tA as Te,l_ as xe,DQ as yt,zB as Wn,zI as zn,WV as Xn,WW as Kn,Dj as Nt,WX as qn,zx as Ae,zs as fa,WY as be,WZ as $t,W_ as Qn,W$ as vt,U1 as At,BF as ga,X0 as Hn,X1 as ba,X2 as Zn,X3 as Jn,X4 as eo,X5 as It,BU as to,B$ as ao,X6 as no,X7 as oo,Dl as Wt,X8 as so,BD as Ca,X9 as Ce,Xa as zt,Xb as ro,bq as _a,DV as Sa,Xc as io,Xd as ka,Xe as co,Xf as lo,Xg as uo,Xh as Et,DN as mo,DP as po,Xi as ho,Xj as fo,Dk as Xt,Xk as go,DT as ya,Xl as _e,Xm as Kt,Xn as bo,Xo as Co,Xp as va,lP as Aa,pW as Ia,lU as Ea,pU as Da,pT as Ta,pS as xa,B0 as _o,db as So,pP as ko,Tq as yo,q4 as vo,Xq as Ao,Xr as Io,Xs as Eo,b5 as Dt,p_ as Do,ib as To,gH as xo,pZ as wo,ld as Po,pX as Oo,pV as Fo,dY as jo,dX as Ro}from"./zeni-epic-state-B9l_W9RQ.js";import{z as V,av as oe,p as j,j as D,G as q,bb as Bo,as as Ye,a8 as Ge,bc as wa,U as $,bd as Mo,be as Pa,E as Uo,bf as Lo,bg as Vo,a as Oa,a1 as Fa,e as ja,ar as Yo,bh as Go,ao as No,O as we,bi as Ra,B as ce,bj as Ba,bk as Ma,au as Ua,bl as $o,ai as Ne,V as $e,c as Y,bm as Wo,m as zo,l as Xo,a4 as Ko,aq as qo,bn as Qo,bo as Ho,bp as Zo,bq as Ie}from"./index-Bw4k26Lh.js";import{n as Tt}from"./mui-ezTHtwEe.js";import{a as b}from"./sentry-T7AA_ij8.js";import{w as La}from"./withTransactionSidePanel-Mm6xVtPH.js";import{c as Va,t as Pe,f as he,b as xt,a as wt,v as Jo}from"./routePaths-Bd9tk_bd.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-C0OwLWSS.js";import Be from"./NotFoundScreen-BjZ5T-Ms.js";import{u as Pt}from"./useInitialThreadRequest-CLczj5aZ.js";import{t as Ya}from"./analyticsHelper-h8-gsFza.js";import{C as es}from"./CompanyPassportScreen-BxZDXrE5.js";import{u as ts}from"./useAiCfoDashboardSuggestedQuestionsChips-99a1ae26.js";import{F as as}from"./FeaturePreviewScreen-DS5Xpxt9.js";import"./recharts-Chyhxc02.js";import"./analytics-B-TvIB4L.js";import"./plaid-5PXB6whD.js";import"./dnd-2zpntaNq.js";import"./stripe-cKAAJElX.js";import"./lottie-ZAIvsM-R.js";import"./lexical-YhB7nNuN.js";import"./pdf-D6N9uxwe.js";import"./utils-oeHkWTt8.js";import"./TransactionDetailScreen-ChIu7aYA.js";import"./decodeURIComponentSafe-DRhUPcmy.js";import"./expenseAutomationHelper-f_QoLd6I.js";import"./MobileAppDrawer-NUU2GCIb.js";import"./InboxNotificationsProvider-BSgZT9XB.js";import"./useTaskManagerAccess-JxICb6EI.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]="dc8c1ead-b6df-42d0-896a-18215e803065",e._sentryDebugIdIdentifier="sentry-dbid-dc8c1ead-b6df-42d0-896a-18215e803065")}catch{}})();const ns=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=V.getSignedInUser(),i=_((E=>E.tenantState.currentTenantId)),l=_((E=>L(E))),{tenantEmailDomain:m}=K(),p=Z(),h=l?.companyName??"",f={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo((()=>({authParams:f,companyName:h,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:Ze()})),[]),u=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),C=z(),g=J(),k=_((E=>vn(E,u,o))),I=b.useCallback((()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&C(An(o,u))}),[u]),v=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),S=b.useCallback(((E,B)=>{C(Yt({sortKey:E,sortOrder:B}))}),[]),T=b.useCallback((E=>{C(Yt({downloadState:E}))}),[]),P=b.useCallback((E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const B=Va({id:E.transactionId,type:E.transactionType},m);g(B);const y=j(p.state?.pathnameStackToGoBack,p.pathname);g(B,{state:{pathnameStackToGoBack:y}})}}),[m,e]),x=b.useCallback((()=>{k.vendor!=null&&D.trackApAgingDetail("AP Aging",u.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)}),[k.vendor,u]);return b.useEffect((()=>{I()}),[]),b.useEffect((()=>{k.fetchState==="Completed"&&x()}),[x,k.fetchState]),d.jsx(Bo,{apAgingDetail:k,downloadParams:c,reportDate:u,analytics:D,onTransactionClick:P,onReload:I,onBackClick:v,onColumnSortConfigChanged:S,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),os=()=>{const e=z(),a=J(),t=_((S=>In(S))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Ye({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((S=>S.tenantState.currentTenantId)),i=_((S=>L(S))),l=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},p=b.useMemo((()=>({authParams:m,companyName:l,downloadEndPoint:`${oe}/agingReport`,timezone:Ze()})),[]),h=t.apAgingUIState.selectedDate??Ee(),f=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(gt(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((S=>{e(qe({searchString:S}))}),[]),C=b.useCallback(((S,T)=>{e(qe({sortKey:T,sortOrder:S}))}),[]),g=b.useCallback((S=>{a(`./${S}/${h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),k=b.useCallback((S=>{e(qe({downloadState:S}))}),[]),I=b.useCallback(((S,T)=>{}),[]),v=b.useCallback(((S,T)=>{e(qe({selectedDate:S,agingDateSelectionType:T})),e(gt(S))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:D,onLoad:S=>S.trackPageLoaded($.Event.agingReport,"AP Aging")}):null,d.jsx(wa,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:D,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:k,onSelectedDateChanged:v,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ss=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=V.getSignedInUser(),i=_((x=>L(x))),{tenantEmailDomain:l}=K(),m=Z(),p=i.companyName,h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},f=b.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:Ze()})),[]),c=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),u=z(),C=J(),g=_((x=>En(x,c,o))),k=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Dn(o,c))}),[c]),I=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),v=b.useCallback(((x,E)=>{u(Gt({sortKey:x,sortOrder:E}))}),[]),S=b.useCallback((x=>{u(Gt({downloadState:x}))}),[]),T=b.useCallback((x=>{if(e)e(x.transactionId,x.transactionType);else if(l!=null){const E=Va({id:x.transactionId,type:x.transactionType},l);C(E);const B=j(m.state?.pathnameStackToGoBack,m.pathname);C(E,{state:{pathnameStackToGoBack:B}})}}),[l,e]),P=b.useCallback((()=>{g.customer!=null&&D.trackArAgingDetail("AR Aging",c.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{k()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&P()}),[g.fetchState,P]),d.jsx(Mo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:D,onTransactionClick:T,onReload:k,onBackClick:I,onColumnSortConfigChanged:v,updateDownloadStateHandler:S,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),rs=()=>{const e=z(),a=J(),t=_((v=>Tn(v))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Ye({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((v=>L(v))),i=s.companyName,l={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:l,companyName:i,downloadEndPoint:`${oe}/agingReport`,timezone:Ze()})),[]),p=t.arAgingUIState.selectedDate??Ee(),h=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((v=>{e(Qe({searchString:v}))}),[]),u=b.useCallback(((v,S)=>{e(Qe({sortKey:S,sortOrder:v}))}),[]),C=b.useCallback((v=>{a(`./${v}/${p.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((v=>{e(Qe({downloadState:v}))}),[]),k=b.useCallback(((v,S)=>{e(Qe({selectedDate:v,agingDateSelectionType:S})),e(bt(v))}),[]),I=b.useCallback(((v,S)=>{e(xn({nodeId:v,isCollapsed:S}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:D,onLoad:v=>v.trackPageLoaded($.Event.agingReport,"AR Aging")}):null,d.jsx(wa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:D,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Na(e,a){const t=Pn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(On(n,o))}}}const is=ne((function(e){const a=wn(e).accountsInOrder.map(((t,n)=>Ga(t,n)));return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:D}}),Na)(Pa),cs=ne((function(e){const a=Fn(e).accountsInOrder.map(((o,r)=>Ga(o,r))),t=V.getSignedInUser(),n=Je(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:D}}),Na)(Pa);function ls(){const e=J(),a=Z(),{tenantEmailDomain:t}=K(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(is,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function ds(){const e=J(),a=Z(),{tenantEmailDomain:t}=K(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(cs,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const us=Tt.div`
|
|
1
|
+
import{j as d}from"./liveblocks-CPy_3T4M.js";import{i as K,j as _,g as Z,u as z,h as J,l as ne,k as oa,n as ft,o as F,N as yn}from"./core-DHfFJrfH.js";import{fE as L,V6 as Ze,bE as sa,br as Ee,Wt as vn,k9 as An,Wu as Yt,Wv as In,kc as gt,Ww as qe,Wx as En,kh as Dn,Wy as Gt,Wz as Tn,kl as bt,WA as Qe,WB as xn,WC as wn,Vq as Pn,ln as On,WD as Fn,bn as Je,WE as ra,W4 as ue,bc as ia,lB as ca,lk as la,W6 as me,W5 as ae,fD as da,g9 as jn,gp as Ct,WF as Rn,WG as Bn,WH as ua,WI as Oe,Dh as Me,Di as Ue,DG as De,DA as pe,Dm as Le,WJ as Mn,b$ as Ve,WK as Un,WL as Ln,WM as ma,WN as Fe,WO as Vn,eb as et,zu as pa,WP as Yn,WQ as ha,WR as Gn,WS as Nn,WT as $n,WU as St,U2 as kt,tA as Te,l_ as xe,DQ as yt,zB as Wn,zI as zn,WV as Xn,WW as Kn,Dj as Nt,WX as qn,zx as Ae,zs as fa,WY as be,WZ as $t,W_ as Qn,W$ as vt,U1 as At,BF as ga,X0 as Hn,X1 as ba,X2 as Zn,X3 as Jn,X4 as eo,X5 as It,BU as to,B$ as ao,X6 as no,X7 as oo,Dl as Wt,X8 as so,BD as Ca,X9 as Ce,Xa as zt,Xb as ro,bq as _a,DV as Sa,Xc as io,Xd as ka,Xe as co,Xf as lo,Xg as uo,Xh as Et,DN as mo,DP as po,Xi as ho,Xj as fo,Dk as Xt,Xk as go,DT as ya,Xl as _e,Xm as Kt,Xn as bo,Xo as Co,Xp as va,lP as Aa,pW as Ia,lU as Ea,pU as Da,pT as Ta,pS as xa,B0 as _o,db as So,pP as ko,Tq as yo,q4 as vo,Xq as Ao,Xr as Io,Xs as Eo,b5 as Dt,p_ as Do,ib as To,gH as xo,pZ as wo,ld as Po,pX as Oo,pV as Fo,dY as jo,dX as Ro}from"./zeni-epic-state-CgS-13Rp.js";import{z as V,av as oe,k as j,j as D,G as q,bb as Bo,as as Ye,a8 as Ge,bc as wa,U as $,bd as Mo,be as Pa,E as Uo,bf as Lo,bg as Vo,a as Oa,a1 as Fa,d as ja,ar as Yo,bh as Go,ao as No,M as we,bi as Ra,B as ce,bj as Ba,bk as Ma,au as Ua,bl as $o,ai as Ne,V as $e,y as Y,bm as Wo,p as zo,l as Xo,a4 as Ko,aq as qo,bn as Qo,bo as Ho,bp as Zo,bq as Ie}from"./index-BxJdVany.js";import{n as Tt}from"./mui-BCtxe7Uc.js";import{a as b}from"./sentry-B8WE62R1.js";import{w as La}from"./withTransactionSidePanel-BVm7iKO9.js";import{c as Va,t as Pe,f as he,b as xt,a as wt,v as Jo}from"./routePaths-T6NVNRXw.js";import{u as se}from"./useAskAiCfoHostNavButtonProps-BjFaoyi3.js";import Be from"./NotFoundScreen-DsHUR7rB.js";import{u as Pt}from"./useInitialThreadRequest-CYNlLID-.js";import{t as Ya}from"./analyticsHelper-CPeGk6N0.js";import{C as es}from"./CompanyPassportScreen-j7OCjtB_.js";import{u as ts}from"./useAiCfoDashboardSuggestedQuestionsChips-ByuEaj9g.js";import{F as as}from"./FeaturePreviewScreen-DjxhsBnU.js";import"./recharts-B2QzdJEJ.js";import"./analytics-MT8j1Arr.js";import"./plaid-BSrnBML8.js";import"./dnd-DG4Q4PBR.js";import"./stripe-cKAAJElX.js";import"./lottie-CPIsfbGQ.js";import"./lexical-Ds-L3Ehk.js";import"./pdf-BNLZqB1A.js";import"./utils-BAMwHjCz.js";import"./TransactionDetailScreen-42QtBhCQ.js";import"./decodeURIComponentSafe-DnV8TwS0.js";import"./expenseAutomationHelper-_DN5nYaA.js";import"./MobileAppDrawer-k5UN-ZVo.js";import"./InboxNotificationsProvider-8Zmc_gz4.js";import"./useTaskManagerAccess-D10G2ni1.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]="6dccb26a-7d39-4129-94bc-38d7c03171e6",e._sentryDebugIdIdentifier="sentry-dbid-6dccb26a-7d39-4129-94bc-38d7c03171e6")}catch{}})();const ns=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{vendorId:o,reportDate:r}=K(),s=V.getSignedInUser(),i=_((E=>E.tenantState.currentTenantId)),l=_((E=>L(E))),{tenantEmailDomain:m}=K(),p=Z(),h=l?.companyName??"",f={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i??""},c=b.useMemo((()=>({authParams:f,companyName:h,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:Ze()})),[]),u=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),C=z(),g=J(),k=_((E=>vn(E,u,o))),I=b.useCallback((()=>{o!=null&&k.fetchState!=="In-Progress"&&k.fetchState!=="Completed"&&C(An(o,u))}),[u]),v=b.useCallback((()=>{g("../../",{relative:"path"})}),[]),S=b.useCallback(((E,B)=>{C(Yt({sortKey:E,sortOrder:B}))}),[]),T=b.useCallback((E=>{C(Yt({downloadState:E}))}),[]),P=b.useCallback((E=>{if(e)e(E.transactionId,E.transactionType);else if(m!=null){const B=Va({id:E.transactionId,type:E.transactionType},m);g(B);const y=j(p.state?.pathnameStackToGoBack,p.pathname);g(B,{state:{pathnameStackToGoBack:y}})}}),[m,e]),x=b.useCallback((()=>{k.vendor!=null&&D.trackApAgingDetail("AP Aging",u.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),k.vendor.id,k.vendor.name)}),[k.vendor,u]);return b.useEffect((()=>{I()}),[]),b.useEffect((()=>{k.fetchState==="Completed"&&x()}),[x,k.fetchState]),d.jsx(Bo,{apAgingDetail:k,downloadParams:c,reportDate:u,analytics:D,onTransactionClick:P,onReload:I,onBackClick:v,onColumnSortConfigChanged:S,updateDownloadStateHandler:T,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),os=()=>{const e=z(),a=J(),t=_((S=>In(S))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AP Aging"});Ye({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((S=>S.tenantState.currentTenantId)),i=_((S=>L(S))),l=i?.companyName??"",m={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s??""},p=b.useMemo((()=>({authParams:m,companyName:l,downloadEndPoint:`${oe}/agingReport`,timezone:Ze()})),[]),h=t.apAgingUIState.selectedDate??Ee(),f=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(gt(h))}),[]);b.useEffect((()=>{f()}),[]);const c=b.useCallback((()=>{a("../",{relative:"path"})}),[]),u=b.useCallback((S=>{e(qe({searchString:S}))}),[]),C=b.useCallback(((S,T)=>{e(qe({sortKey:T,sortOrder:S}))}),[]),g=b.useCallback((S=>{a(`./${S}/${h.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[h]),k=b.useCallback((S=>{e(qe({downloadState:S}))}),[]),I=b.useCallback(((S,T)=>{}),[]),v=b.useCallback(((S,T)=>{e(qe({selectedDate:S,agingDateSelectionType:T})),e(gt(S))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:D,onLoad:S=>S.trackPageLoaded($.Event.agingReport,"AP Aging")}):null,d.jsx(wa,{uiState:t.apAgingUIState,report:t,downloadParams:p,analytics:D,onReloadReport:f,onBackClick:c,onSearchTextChange:u,onSortOrderChange:C,onEntityNameClick:g,updateDownloadStateHandler:k,onSelectedDateChanged:v,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},ss=La((function({openTransactionPanel:e,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n}){const{customerId:o,reportDate:r}=K(),s=V.getSignedInUser(),i=_((x=>L(x))),{tenantEmailDomain:l}=K(),m=Z(),p=i.companyName,h={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:i.tenantId},f=b.useMemo((()=>({authParams:h,companyName:p,downloadEndPoint:`${oe}/agingDetailedReport`,timezone:Ze()})),[]),c=b.useMemo((()=>r!=null?sa(r):Ee()),[r]),u=z(),C=J(),g=_((x=>En(x,c,o))),k=b.useCallback((()=>{o!=null&&g.fetchState!=="In-Progress"&&g.fetchState!=="Completed"&&u(Dn(o,c))}),[c]),I=b.useCallback((()=>{C("../../",{relative:"path"})}),[]),v=b.useCallback(((x,E)=>{u(Gt({sortKey:x,sortOrder:E}))}),[]),S=b.useCallback((x=>{u(Gt({downloadState:x}))}),[]),T=b.useCallback((x=>{if(e)e(x.transactionId,x.transactionType);else if(l!=null){const E=Va({id:x.transactionId,type:x.transactionType},l);C(E);const B=j(m.state?.pathnameStackToGoBack,m.pathname);C(E,{state:{pathnameStackToGoBack:B}})}}),[l,e]),P=b.useCallback((()=>{g.customer!=null&&D.trackArAgingDetail("AR Aging",c.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat),g.customer.id,g.customer.name)}),[g.customer,c]);return b.useEffect((()=>{k()}),[]),b.useEffect((()=>{g.fetchState==="Completed"&&P()}),[g.fetchState,P]),d.jsx(Mo,{arAgingDetail:g,downloadParams:f,reportDate:c,analytics:D,onTransactionClick:T,onReload:k,onBackClick:I,onColumnSortConfigChanged:v,updateDownloadStateHandler:S,panelContent:a,sidePanelIsOpen:t,sidePanelIsFullView:n})})),rs=()=>{const e=z(),a=J(),t=_((v=>Tn(v))),{isAiCfoAccessEnabled:n,onAskAiCfoClick:o}=se({mobileExploreReferrer:"AR Aging"});Ye({isDataReady:t.fetchState==="Completed"});const r=V.getSignedInUser(),s=_((v=>L(v))),i=s.companyName,l={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:s.tenantId},m=b.useMemo((()=>({authParams:l,companyName:i,downloadEndPoint:`${oe}/agingReport`,timezone:Ze()})),[]),p=t.arAgingUIState.selectedDate??Ee(),h=b.useCallback((()=>{t.fetchState!=="In-Progress"&&t.fetchState!=="Completed"&&e(bt(p))}),[]);b.useEffect((()=>{h()}),[]);const f=b.useCallback((()=>{a("../",{relative:"path"})}),[]),c=b.useCallback((v=>{e(Qe({searchString:v}))}),[]),u=b.useCallback(((v,S)=>{e(Qe({sortKey:S,sortOrder:v}))}),[]),C=b.useCallback((v=>{a(`./${v}/${p.format(q.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat)}`)}),[p]),g=b.useCallback((v=>{e(Qe({downloadState:v}))}),[]),k=b.useCallback(((v,S)=>{e(Qe({selectedDate:v,agingDateSelectionType:S})),e(bt(v))}),[]),I=b.useCallback(((v,S)=>{e(xn({nodeId:v,isCollapsed:S}))}),[]);return d.jsxs(d.Fragment,{children:[t.fetchState==="Completed"?d.jsx(Ge,{analytics:D,onLoad:v=>v.trackPageLoaded($.Event.agingReport,"AR Aging")}):null,d.jsx(wa,{uiState:t.arAgingUIState,report:t,downloadParams:m,analytics:D,onReloadReport:h,onBackClick:f,onSearchTextChange:c,onSortOrderChange:u,onEntityNameClick:C,updateDownloadStateHandler:g,onSelectedDateChanged:k,onNodeCollapseToggled:I,isAiCfoAccessEnabled:n,onAskAiCfoClick:o})]})},Ga=(e,a)=>({key:a,title:e.accountName,amount:e.balance?.available,logoUri:e.logo?.toString(),source:e});function Na(e,a){const t=Pn(a.firstMonthOfFY);return{onItemClick:(n,o)=>{const r=o.accountName===""?o.accountDescription:o.accountName,s=Pe(a.tenantEmailDomain,o.accountId,o.accountType,r,"quarter",t,!1),i=j(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(s,{state:{pathnameStackToGoBack:i,referrer:a.referrerType}})},onSetAccountsStatementDate:(n,o)=>{e(On(n,o))}}}const is=ne((function(e){const a=wn(e).accountsInOrder.map(((t,n)=>Ga(t,n)));return{sectionTitle:q.getLocalizedStrings().balanceCard.cashBalanceSectionTitle,transactionArray:a,fetchState:e.cashBalanceState.fetchState,analytics:D}}),Na)(Pa),cs=ne((function(e){const a=Fn(e).accountsInOrder.map(((o,r)=>Ga(o,r))),t=V.getSignedInUser(),n=Je(t);return{sectionTitle:q.getLocalizedStrings().balanceCard.cardBalanceSectionTitle,transactionArray:a,isZeniUser:n,fetchState:e.cardBalanceState.fetchState,analytics:D}}),Na)(Pa);function ls(){const e=J(),a=Z(),{tenantEmailDomain:t}=K(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cashBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(is,{tenantEmailDomain:t,location:a,referrerType:"Cash Balance",navigate:e,firstMonthOfFY:n})}function ds(){const e=J(),a=Z(),{tenantEmailDomain:t}=K(),n=_((o=>L(o).company?.companyInfo.firstMonthOfFY??1));return _((o=>o.cardBalanceState.fetchState))==="Error"?d.jsx(Be,{}):d.jsx(cs,{tenantEmailDomain:t,location:a,referrerType:"Card Balance",navigate:e,firstMonthOfFY:n})}const us=Tt.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
flex: 1 1 auto;
|
|
4
4
|
min-height: 100%;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as v}from"./liveblocks-
|
|
1
|
+
import{j as v}from"./liveblocks-CPy_3T4M.js";import{a as u}from"./sentry-B8WE62R1.js";import{u as y,j as b,l as w,g as A,N as k}from"./core-DHfFJrfH.js";import{T9 as N,fE as _,gk as R,Ta as U,pR as L,Tb as z}from"./zeni-epic-state-CgS-13Rp.js";import{u as j,z as f,L as C,t as I,G as O,b as $}from"./index-BxJdVany.js";import"./mui-BCtxe7Uc.js";import{t as P}from"./getLocaleForTenant-D_V8_IAs.js";import"./recharts-B2QzdJEJ.js";import"./analytics-MT8j1Arr.js";import"./plaid-BSrnBML8.js";import"./dnd-DG4Q4PBR.js";import"./stripe-cKAAJElX.js";import"./lottie-CPIsfbGQ.js";import"./lexical-Ds-L3Ehk.js";import"./pdf-BNLZqB1A.js";import"./utils-BAMwHjCz.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="81bf798b-dae9-402a-82c7-54704078ff8b",t._sentryDebugIdIdentifier="sentry-dbid-81bf798b-dae9-402a-82c7-54704078ff8b")}catch{}})();const G=w((function(t){return{fetchState:t.tenantState.fetchState,activeTenantFetchState:t.tenantState.activeTenantFetchState.fetchState,currentTenant:_(t),tenantsInOrder:z(t).tenantsInOrder}}))((function({fetchState:t,activeTenantFetchState:s,currentTenant:o,tenantsInOrder:h}){const r=A(),p=new URLSearchParams(r.search);if(o==null||t!=="Completed"&&s!=="Completed")return null;{let m="";const n=h.map((l=>l.tenantEmailDomain)),i=r.state?.origin,a=r.state?.queryParams;let c=`../${o.tenantEmailDomain}`,d=null,e=!1,g=null,S=null;const T=E(r.pathname);if(T!=null)c=`../${o.tenantEmailDomain}/${T}`,m="comingFromV2UrlPath",T==="ai-cfo/explore"&&(d=p.get("question")?.replace(/^["']|["']$/g,"")??null,e=p.get("should_submit")==="true");else if(i!=null)if(n.reduce(((l,F)=>l||i.split("/").find((D=>D===F))!=null),!1))c=i,i.includes("ai-cfo")&&a!=null&&(g=a.aiCfoRef??null,S=a.aiCfoEmailRefId??null);else{const l=E(i);l!=null?(c=`../${o.tenantEmailDomain}/${l}`,m="comingFromV2UrlPath",l==="ai-cfo/explore"&&a!=null&&(a.aiCfoQuestion!=null&&(d=a.aiCfoQuestion),a.aiCfoShouldSubmit==="true"&&(e=!0))):console.warn("Don't have access to previous path tenant!")}const x=$(c,p);return v.jsx(k,{to:x,replace:!0,state:{...r.state,origin:"",message:m,aiCfoInitialQuestion:d,aiCfoShouldSubmit:e,aiCfoRef:g,aiCfoEmailRefId:S}})}}));function oe(){const t=y(),{setLoading:s,clearAllLoading:o}=j(),h=u.useRef(!1),r=u.useRef(!1),p=u.useRef(null),m=b((e=>N(e))),n=b((e=>e.tenantState.fetchState)),i=b((e=>e.tenantState.error)),a=b((e=>e.tenantState.activeTenantFetchState.fetchState)),c=b((e=>_(e))),d=f.getSignedInUser();return u.useLayoutEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId??null;p.current!==e&&(p.current=e,h.current=!1,r.current=!1,s(C.TENANT_FETCHING)),!h.current||a!=="Completed"&&a!=="Error"||(h.current=!1),!r.current||n!=="Completed"&&n!=="Error"||(r.current=!1)}),[a,n]),u.useEffect((()=>{const e=f.getActiveTenantForUser()?.tenantId;h.current===!1&&d!=null&&e!=null&&I.shouldFetchActiveTenant(e)&&(h.current=!0,I.markActiveTenantFetchStarted(e),n==="Completed"||a!=="Not-Started"&&a!=="Error"||(s(C.TENANT_FETCHING),t(R(d.userId,e))))}),[n,a,d,t]),u.useEffect((()=>{const e=f.getSignedInUser(),g=f.getActiveTenantForUser()?.tenantId,S=g==null||a==="Completed"||a==="Error";r.current===!1&&e!=null&&S&&I.shouldFetchAllTenants()&&(r.current=!0,I.markAllTenantsFetchStarted(),(n==="Not-Started"||n==="Error"&&!U(i))&&t(L(e.userId)))}),[n,a,i,d,t]),u.useEffect((()=>{f.isSignedIn()&&n==="Completed"&&m.tenantsCoreDetailsInOrder.length>0&&(f.saveSignedInUserTenants(m.tenantsCoreDetailsInOrder),o())}),[m.tenantsCoreDetailsInOrder,n]),u.useEffect((()=>{!f.isSignedIn()||n!=="Completed"&&a!=="Completed"||c==null||(O.updateAppLocaleID(P(c)),o())}),[n,a,c]),v.jsx(G,{})}const Q=["dashboard/cash-balance","dashboard/card-balance","dashboard/operating-expenses","dashboard/revenue","dashboard/burn-rate","dashboard/cash-position","dashboard/top-expenses","dashboard/cash-in-cash-out","dashboard","reports","forecast","uncategorized-expense","uncategorized-income","missing-receipts","bills","cards/activate","cards","reimbursements","wise","checking","aicfo"],q={"dashboard/cash-balance":"dashboard/cash_balance","dashboard/card-balance":"dashboard/card_balance","dashboard/operating-expenses":"dashboard/operating_expenses","dashboard/revenue":"dashboard/revenue","dashboard/burn-rate":"dashboard/net_burn_or_income","dashboard/cash-position":"dashboard/cash_position","dashboard/top-expenses":"dashboard/top_expenses","dashboard/cash-in-cash-out":"dashboard/cash_in_cash_out",dashboard:"dashboard",reports:"reports",forecast:"forecast","uncategorized-expense":"transactions/uncategorized-expense","uncategorized-income":"transactions/uncategorized-income","missing-receipts":"transactions/missing-receipts",bills:"bills",reimbursements:"reimbursements","cards/activate":"cards/activate",cards:"cards",wise:"bills/wise/callback/link-account",checking:"checking",aicfo:"ai-cfo/explore"};function E(t){for(const s of Q)if(t.toLocaleLowerCase().includes(s))return q[s]}export{oe as default};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import{j as l}from"./liveblocks-CPy_3T4M.js";import{h as w,g as C,j as h,l as E,i as V}from"./core-DHfFJrfH.js";import{Y6 as k,Yd as M,gF as _,gE as W,gD as K,kO as X,W5 as q,uc as J,fE as B,XF as D,kM as F,Y7 as S,Yg as T,kK as G,l5 as j}from"./zeni-epic-state-CgS-13Rp.js";import{bM as L,a1 as N,M as R,z as O,E as U,a4 as p,y as v,a7 as Y,bN as Q,N as Z,bO as ee,k as te}from"./index-BxJdVany.js";import{n as z}from"./mui-BCtxe7Uc.js";import"./sentry-B8WE62R1.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]="56d80476-df9a-47c4-92ec-6e34127465c6",e._sentryDebugIdIdentifier="sentry-dbid-56d80476-df9a-47c4-92ec-6e34127465c6")}catch{}})();const ne=E(null,(function(e,t){return{onSaveVendor:n=>{e(X(t.vendorId!==void 0?t.vendorId:void 0,t.billId,void 0,t.isExpressPayPage)),e(q("common")),n!=null&&e(J(n))},onGetOtp:n=>{e(K(n,"BillPayVendor"))},onResendOtp:n=>{e(W(n,"BillPayVendor"))},onVerifyOtp:(n,a)=>{e(_(n,a,"BillPayVendor"))},onVerifyOtpSuccess:(n,a,o)=>{e(M(n,a,o))}}}))(L);function H({vendorId:e,billId:t,isExpressPayPage:n}){const a=w(),o=C(),s=h((d=>k(d,e)));return l.jsx(ne,{location:o,navigate:a,vendorId:e,billId:t,vendorViewDetails:s,isExpressPayPage:n??!1})}const ae=z.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
|
+
`,oe=E((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{navigate:n,location:a,vendorId:o}=t;return{onFetchBankName:s=>{e(j(s))},onSaveHandler:s=>{e(G(t.bankAccountContext,s,"standard",o))},onCancel:()=>{(()=>{const s=p(a.state?.pathnameStackToGoBack),d=s.poppedPathname??P();n(d,{state:{pathnameStackToGoBack:s.newStack}})})(),e(S())},onACHDetailsUpdated:s=>{const{bankAccountSection:d}=s;e(T({data:d}))},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")n("../",{relative:"path"});else{const s=p(t.location.state?.pathnameStackToGoBack),d=s.poppedPathname??P(0);t.navigate(d,{state:{pathnameStackToGoBack:s.newStack}})}e(S())}}}))(Q);function fe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:d}=V(),i=e??s,{useFeatureGate:c}=R(),r=O.getSignedInUser(),b=h((u=>B(u))),g=U(),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:I}=c(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=c(v.isDepositAccountsFeatureEnabled);if(r==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Y,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:g.colors.grey5}}):l.jsxs(ae,{windowSize:o,children:[l.jsx(H,{vendorId:i,billId:d}),l.jsx(oe,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:b,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const P=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t},me=(e,t,n)=>{let a=`/${e}/bill/${encodeURIComponent(t)}`;return n=="draft"&&(a+="/edit"),a},he=e=>`/${e}/bills`,ke=(e,t)=>{let n=`/${e}/bill`;return n=t!=null?n.concat(`/${t}/edit`):n.concat("/new"),n},A=(e,t,n,a)=>{let o=`/${e}/bill`;return o+=n!=null?`/${n}/edit/vendor`:"/new/vendor",o+=a!=null?`/${a}/edit/${t}`:`/create/${t}`,o};function Se(e,t,n){return A(e,"ach",t,n)}function ve(e,t,n){return A(e,"domestic",t,n)}function ge(e,t,n){return A(e,"international",t,n)}const se=(e,t,n)=>{let a=`/${e}/bill/`;return a=n!=null?a.concat(`${encodeURIComponent(n)}/${t}/`):a.concat(`new/${t}/`),a},ce=z.div`
|
|
10
|
+
display: flex;
|
|
11
|
+
height: 100vh;
|
|
12
|
+
width: 100%;
|
|
13
|
+
flex: 1 1 auto;
|
|
14
|
+
flex-direction: column;
|
|
15
|
+
align-items: center;
|
|
16
|
+
background-color: ${e=>e.theme.colors.grey4};
|
|
17
|
+
box-shadow: ${e=>`0px 2px ${Z.sp1} ${e.theme.colors.dropShadowNormal}`};
|
|
18
|
+
`,de=E((function(e,t){const{vendorId:n,billId:a}=t,o=k(e,n),s=D(e,t.isVendorRecommendationEnabled,t.isZeniAccountsFeatureEnabled,a);return{billId:a,isDisabled:o.bankAccountCreationState.fetchState==="In-Progress"?"readonly":void 0,vendorViewDetails:o,file:s.file,bankAccountContext:t.bankAccountContext}}),(function(e,t){const{billId:n,navigate:a,location:o,vendorId:s,currentTenant:d}=t,{tenantEmailDomain:i}=d;return{onFetchBankName:c=>{e(j(c))},onSaveHandler:c=>{e(G(t.bankAccountContext,c,"us-domestic",s))},onWireDetailsUpdated:c=>{const{bankAccountSection:r}=c;e(T({data:r}))},onCancel:()=>{(()=>{const c=p(o.state?.pathnameStackToGoBack),r=c.poppedPathname??$();a(r,{state:{pathnameStackToGoBack:c.newStack}})})(),e(S())},onAddressClick:c=>{if(t.bankAccountContext==="express-pay")a("./add-address");else{const r=se(i,c,n),b=te(o.state?.pathnameStackToGoBack,o.pathname);a(r,{state:{pathnameStackToGoBack:b}})}},onBackClick:()=>{if(e(F({fetchState:"Not-Started"})),t.bankAccountContext==="express-pay")a("../",{relative:"path"});else{const c=p(t.location.state?.pathnameStackToGoBack),r=c.poppedPathname??$(0);t.navigate(r,{state:{pathnameStackToGoBack:c.newStack}})}e(S())}}}))(ee);function xe({vendorIdParam:e,accountContext:t}){const n=w(),a=C(),o=N(),{vendorId:s,billId:d}=V(),i=e??s,c=O.getSignedInUser(),{useFeatureGate:r}=R(),b=U(),g=h((u=>B(u))),x=p(a.state?.pathnameStackToGoBack),f=t??(x.poppedPathname?.includes("vendor")===!0?"vendor":"billDetail"),m=h((u=>k(u,i))),{isFeatureEnabled:I}=r(v.isVendorRecommendationFeatureEnabled),{isFeatureEnabled:y}=r(v.isDepositAccountsFeatureEnabled);if(c==null)throw Error("Can't access address page without signing in...");return f==="billDetail"&&m.editVendorState?.saveStatus.fetchState==="In-Progress"?l.jsx(Y,{fetchState:m.editVendorState?.saveStatus.fetchState??"Not-Started",style:{backgroundColor:b.colors.grey5,boxShadow:`0px 2px ${Z.sp1} ${b.colors.dropShadowNormal}`}}):l.jsxs(ce,{windowSize:o,children:[l.jsx(H,{vendorId:i,billId:d}),l.jsx(de,{location:a,navigate:n,billId:d,vendorId:i,currentTenant:g,bankAccountContext:f,isVendorRecommendationEnabled:I,isZeniAccountsFeatureEnabled:y})]})}const $=(e=2)=>{let t="../";for(let n=0;n<e;n++)t=`${t}../`;return t};export{fe as A,xe as D,H as V,me as a,se as b,ke as c,ve as d,he as g,ge as i,Se as v};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-
|
|
1
|
+
import{j as i}from"./liveblocks-CPy_3T4M.js";import{a1 as c,ab as l,E as f}from"./index-BxJdVany.js";import{D as p}from"./mui-BCtxe7Uc.js";import"./sentry-B8WE62R1.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},r=new e.Error().stack;r&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[r]="c06e3c71-2cdd-4b4c-9d6d-3f270023e5b2",e._sentryDebugIdIdentifier="sentry-dbid-c06e3c71-2cdd-4b4c-9d6d-3f270023e5b2")}catch{}})();const b={drawerLeftMargin:new l(0,0,240)};function h(e){const{isOpen:r,drawerLeftMargin:o,children:t,onClose:d}=e,n=c(),s=o?.valuePx(n)??b.drawerLeftMargin.valuePx(n),a=f();return i.jsx(p,{anchor:"right",open:r,PaperProps:{style:{width:`calc(100% - ${s})`}},slotProps:{backdrop:{style:{backgroundColor:a.colors.black,opacity:.8,cursor:"pointer"}}},onClose:d,children:t})}export{h as D};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as s}from"./liveblocks-
|
|
1
|
+
import{j as s}from"./liveblocks-CPy_3T4M.js";import{a as d}from"./sentry-B8WE62R1.js";import{h as B,u as G,g as A,i as R,j as l,N as _,l as q,n as F,o as V}from"./core-DHfFJrfH.js";import{W9 as N,fE as O,Vr as M,m_ as Y,Rt as I,We as $,W4 as z,l_ as H,Ru as S,Vw as J,Vx as K,W6 as L,W5 as Q}from"./zeni-epic-state-CgS-13Rp.js";import{b8 as U,j as X,a4 as Z,k as tt}from"./index-BxJdVany.js";import"./mui-BCtxe7Uc.js";import{d as k}from"./decodeURIComponentSafe-DnV8TwS0.js";import{w as et}from"./withTransactionSidePanel-BVm7iKO9.js";import{f as at,c as nt}from"./routePaths-T6NVNRXw.js";import"./recharts-B2QzdJEJ.js";import"./analytics-MT8j1Arr.js";import"./plaid-BSrnBML8.js";import"./dnd-DG4Q4PBR.js";import"./stripe-cKAAJElX.js";import"./lottie-CPIsfbGQ.js";import"./lexical-Ds-L3Ehk.js";import"./pdf-BNLZqB1A.js";import"./utils-BAMwHjCz.js";import"./useAskAiCfoHostNavButtonProps-BjFaoyi3.js";import"./TransactionDetailScreen-42QtBhCQ.js";import"./useInitialThreadRequest-CYNlLID-.js";import"./expenseAutomationHelper-_DN5nYaA.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="528af9e6-6227-441d-922d-2d77094b605f",a._sentryDebugIdIdentifier="sentry-dbid-528af9e6-6227-441d-922d-2d77094b605f")}catch{}})();const ot=q((function(a,t){const e=t.entity,o=$(a,t.entity,"EntityDetail");return{selectedEntity:e,autoCompleteData:{autoCompleteText:e.name,entityAutoCompleteView:z(a,"common")},trendWithTransactionsReport:o,analytics:X,isAccountingClassesEnabled:H(a)}}),(function(a,t){return{onTransactionItemClick:e=>{if(t.openTransactionPanel)return void t.openTransactionPanel(e.id,e.type);const o=`${nt(e,t.tenantEmailDomain)}`,c=tt(t.location.state?.pathnameStackToGoBack,t.location.pathname);t.navigate(o,{state:{pathnameStackToGoBack:c}})},autoCompleteActions:{onAutoCompleteInputChange:e=>{e.trim().length>=2?a(L({searchString:e,searchOrigin:"common"})):e.trim().length===0&&a(Q("common"))},onAutoCompleteEntity:e=>{const o=at(e,t.tenantEmailDomain);a(J()),a(K()),t.resetTrendIsFetchedStates(),t.navigate(o,{replace:!0,state:{pathnameStackToGoBack:t.location.state?.pathnameStackToGoBack}})},onCancelAutoComplete:()=>{const e=Z(t.location.state?.pathnameStackToGoBack),o=e.poppedPathname??b();t.navigate(o,{state:{pathnameStackToGoBack:e.newStack}})}},onTrendSelectedPeriodChange:e=>{if(t.closeSidePanel?.(),e==null)t.defaultTransactionTimePeriod!=null&&a(S(t.entity,"EntityDetail",{timeframe:"quarter",timePeriod:t.defaultTransactionTimePeriod}));else{const o=e.currentTimePeriod==null?e.addTimePeriod:{startDate:e.addTimePeriod.startDate,endDate:e.currentTimePeriod.endDate};a(I(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:e.addTimePeriod})),a(S(t.entity,"EntityDetail",{timeframe:e.timeframe,timePeriod:o}))}}}}))(U),it=et((function({entityType:a,...t}){const e=B(),o=G(),c=A(),[m,T]=d.useState(!1),[h,D]=d.useState(!1),{tenantEmailDomain:C,entityIdEncoded:x,entityNameEncoded:j}=R(),r=k(x??""),p=k(j??""),f=rt(r,p),w=[r,p].filter((n=>n!=null)),i={name:p,id:r,type:a,zeniId:r,qboId:r},g=l((n=>N(n.customerIncomeState,n.vendorExpenseState,n.trendState,i,"quarter"))),v=l((n=>O(n).company?.companyInfo.firstMonthOfFY??1)),u=l((n=>M(n.trendWithTransactionsState,i,"EntityDetail")));d.useEffect((()=>{m===!1&&f===!0&&(T(!0),o(Y(i)))}),[m,f,i]);const E=l((n=>n.trendState.fetchState)),P=u?.selectedPeriod?.timePeriod??g,W=(function(n,y){return n!=null&&y!=null?{startDate:n.startDate,endDate:y?.endDate}:y})(u?.selectedPeriod?.timePeriod,g);return d.useEffect((()=>{m===!0&&h===!1&&E==="Completed"&&(D(!0),P!=null&&o(I(i,"EntityDetail",{timeframe:u?.selectedPeriod?.timeframe??"quarter",timePeriod:P})))}),[m,h,E]),f?s.jsx(ot,{firstMonthOfFY:v,tenantEmailDomain:C,location:c,navigate:e,entity:i,defaultTransactionTimePeriod:W,resetTrendIsFetchedStates:()=>{T(!1),D(!1)},...t}):s.jsx(_,{to:b(w.length)})})),rt=(a,t)=>t!=null&&t.length>0&&a!=null&&a.length>0,b=(a=2)=>{let t="../";for(let e=0;e<a;e++)t=`${t}../`;return t};function wt({entityType:a}){return s.jsx(F,{children:s.jsx(V,{path:"/:entityIdEncoded/:entityNameEncoded/*",element:s.jsx(it,{entityType:a})})})}export{wt as EntityDetailRoutes,wt as default};
|
package/dist/assets/{ExpenseAutomationRoutes-DaMemxd2.js → ExpenseAutomationRoutes-D2vZzdqI.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as f}from"./liveblocks-
|
|
1
|
+
import{j as f}from"./liveblocks-CPy_3T4M.js";import Ba from"./NotFoundScreen-DsHUR7rB.js";import{a,R as Pn}from"./sentry-B8WE62R1.js";import{n as Te,S as Ua}from"./mui-BCtxe7Uc.js";import{u as Se,h as bt,g as Xe,j as F,i as Ct,l as Va,t as Oa,n as Ma,o as ut}from"./core-DHfFJrfH.js";import{fE as Ue,a0i as ja,p$ as _e,Ts as La,zn as za,a0j as $a,a0k as Ga,a0l as qa,a0m as mt,a0n as Je,gg as ft,a0o as nn,eM as Na,f$ as Ja,a0p as an,a0q as We,qS as Wa,uf as Ya,gR as Ha,gP as Ka,a0r as Qa,r3 as Za,rc as Xa,qa as es,qo as An,gO as de,gQ as ts,a0s as ns,qK as xn,rd as as,ql as ss,qg as os,ul as cs,gN as Fe,a0t as Ke,Bx as wn,LO as Rn,a0u as Dn,EQ as _n,a0v as is,fj as ls,fl as rs,sg as It,Wa as sn,Wc as ds,m1 as us,Wd as ms,m8 as ps,dk as hs,CQ as kt,a0w as Ss,a0x as gs,s6 as Cs,s7 as fs,W0 as Is,V6 as ks,$M as Ts,qD as Fn,ri as Qe,a0y as bs,W6 as on,W5 as Ne,a0z as cn,mp as ys,a0A as Es,a0B as vs,a0C as Ps,a0D as As,qy as xs,rl as Ye,a0E as ws,a0F as Rs,a0G as Ds,rt as _s,mc as Fs,m3 as Bs,a0H as Us,mb as ln,Wn as Vs,a0I as Os,a0J as Ms,tS as js,tt as Ls,rj as he,ts as pt,a0K as zs,a0L as $s,a0M as Gs,a0N as qs,nI as Ns,br as Js,nD as rn,np as Ws,a0O as Ys,g_ as Hs,nA as Ks,si as Qs,sk as Zs,r$ as Xs,V9 as eo,Va as to,Ei as no,Eh as ao,Ey as so,a0P as dn,s5 as oo,fw as Tt,sb as co,a0Q as io,sr as lo,rV as ro,sw as uo,r_ as mo,rE as po,a0R as ho,Ti as Bn,qW as So,qu as go,qB as un,ro as Co,a0S as fo,a0T as Io,rk as Un,a0U as ko,a0V as To,a0W as bo,a0X as yo,sA as Eo,a0Y as vo,a0Z as Po,a0_ as mn,u1 as Ao,tk as xo,s2 as pn,W4 as wo,a0$ as Ro,a10 as Do,ma as _o,a11 as Fo,Qu as Bo,m9 as Uo,l_ as Vo,Th as Oo,sT as Vn,td as Mo,rh as hn,rm as jo,bE as Lo,nx as zo,nu as $o,a12 as Go,rD as Sn,t9 as gn,t7 as qo,a13 as No,sY as Jo,sD as Wo,ta as Yo,a14 as Ho,a15 as Ko,sJ as Qo,a16 as Zo,sE as Xo,sI as ec,sG as tc,tg as nc}from"./zeni-epic-state-CgS-13Rp.js";import{M as Ze,y as K,j as Y,k as ne,aq as On,as as Mn,dO as ac,z as et,dP as sc,dQ as oc,dR as cc,ae as Be,dS as ic,dT as Cn,ba as fn,dU as lc,a7 as jn,dV as rc,l as He,G as dc,w as uc,dW as mc,av as In,dX as pc,a as hc,dY as Sc,dZ as gc,K as Cc,V as fc,d_ as Ic,d$ as kc,e0 as Tc,b4 as bc,br as yc,ab as Ec,b5 as vc,b6 as Pc}from"./index-BxJdVany.js";import{u as Ln}from"./useAskAiCfoHostNavButtonProps-BjFaoyi3.js";import{g as kn,h as Ac,r as xc,b as wc,c as Rc,i as Dc,a as _c,C as Fc}from"./TransactionDetailScreen-42QtBhCQ.js";import{b as Bc,S as Uc,a as Vc,J as Oc}from"./ScheduleDetailsPrepaidExpensesScreen-0OK7ToFy.js";import{s as Tn,i as zn,h as Mc,v as jc,c as Lc}from"./routePaths-T6NVNRXw.js";import{u as zc,a as $c,w as Gc}from"./withTransactionSidePanel-BVm7iKO9.js";import{a as ht}from"./accountMappingHelper-65Fk5KmX.js";import{D as qc}from"./DrawerScreen-DkSWP8ho.js";import"./recharts-B2QzdJEJ.js";import"./analytics-MT8j1Arr.js";import"./plaid-BSrnBML8.js";import"./dnd-DG4Q4PBR.js";import"./stripe-cKAAJElX.js";import"./lottie-CPIsfbGQ.js";import"./lexical-Ds-L3Ehk.js";import"./pdf-BNLZqB1A.js";import"./utils-BAMwHjCz.js";import"./decodeURIComponentSafe-DnV8TwS0.js";import"./useInitialThreadRequest-CYNlLID-.js";import"./expenseAutomationHelper-_DN5nYaA.js";import"./pathToGoBack-XPlRz7Jt.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},s=new t.Error().stack;s&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[s]="d70662c6-540e-4366-891c-7310fa5e2247",t._sentryDebugIdIdentifier="sentry-dbid-d70662c6-540e-4366-891c-7310fa5e2247")}catch{}})();const Nc=()=>{const t=Se(),s=bt(),b=Xe(),g=F((h=>Ue(h))),{useFeatureGate:C}=Ze(),{isFeatureEnabled:i}=C(K.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:d}=C(K.aiAuditScorePercentage),P=F((h=>h.expenseAutomationViewState.selectedPeriodByTenantId)),r=F((h=>ja(h,g.tenantId))),{isAiCfoAccessEnabled:E,onAskAiCfoClick:w}=Ln({mobileExploreReferrer:"Month-End Close Overview"}),A=a.useCallback(((h,l,q=!1)=>{t(_e({tenantId:l,period:{month:h.month,year:h.year},refreshViewInBackground:q}))}),[]),T=a.useCallback((h=>{const l=b.state?.referrer;r.monthEndCloseChecks?.auditSummary!=null&&Y.trackMonthCloseAuditPage(h.month,h.year,r.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",r.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,l??null),t(La(g.tenantId,h))}),[g.tenantId,r.monthEndCloseChecks?.auditSummary,r.monthEndCloseChecks?.reportEmailSentDate]),p=P[g.tenantId],u=a.useCallback((()=>{const h=b.state?.referrer;r.monthEndCloseChecks?.auditSummary!=null&&Y.trackMonthCloseAuditPage(p.month,p.year,r.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",r.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,h??null),A(p,g.tenantId,!0)}),[A,p,g.tenantId,r.monthEndCloseChecks?.auditSummary,r.monthEndCloseChecks?.reportEmailSentDate]),_=ne(b.state?.pathnameStackToGoBack,b.pathname),x=a.useCallback((()=>{if(r.monthEndCloseChecks!=null&&p!=null){const h=r.monthEndCloseChecks.monthEndCloseCheckList.find((l=>l.progress<100));if(h!=null)return void s(`./${h.id}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview"}});s(`./month_end_insights/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview"}})}}),[r.monthEndCloseChecks,p]),{areTenantIdsInSync:S}=On();return Mn({isDataReady:r.fetchState==="Completed"}),a.useEffect((()=>{p!=null&&r.fetchState!=="In-Progress"&&r.fetchState!=="Completed"&&S&&A(p,g.tenantId)}),[A,p,r.fetchState,g.tenantId,S]),a.useEffect((()=>{p!=null&&r.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&r.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&S&&t(za(p))}),[p,r.monthClosePerformanceTrendFetchStatus.fetchState,S]),a.useEffect((()=>{const h=setInterval((()=>{r.fetchState!=="In-Progress"&&r.fetchState==="Completed"&&u()}),3e5);return()=>clearInterval(h)}),[r.fetchState]),a.useEffect((()=>{if(r.fetchState==="Completed"&&r.monthEndCloseChecks?.auditSummary!=null){const h=b.state?.referrer;Y.trackMonthCloseAuditPage(r.selectedPeriod.month,r.selectedPeriod.year,r.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",r.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,h??null)}}),[r.fetchState,r.selectedPeriod,r.monthEndCloseChecks?.auditSummary,r.monthEndCloseChecks?.reportEmailSentDate]),f.jsx(Jc,{children:f.jsx(ac,{monthEndCloseChecksView:r,isRealtimeInsightsFeatureEnabled:i,onMonthEndCheckClick:h=>{s(`./${h}/${p.month}-${p.year}`,{state:{pathnameStackToGoBack:_,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:T,handleReviewButtonClick:x,onBackClick:()=>{s("../../dashboard")},onReload:u,isAiCfoAccessEnabled:E,onAskAiCfoClick:w,aiAuditScorePercentageEnabled:d})})},Jc=Te.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-CPy_3T4M.js";import{a as r}from"./sentry-B8WE62R1.js";import{aw as d,ax as l,s as p,a4 as m}from"./index-BxJdVany.js";import"./mui-BCtxe7Uc.js";import c from"./NotFoundScreen-DsHUR7rB.js";import{h as u,g as b}from"./core-DHfFJrfH.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]="052e3476-042d-44ff-b15b-67fe1524a52f",e._sentryDebugIdIdentifier="sentry-dbid-052e3476-042d-44ff-b15b-67fe1524a52f")}catch{}})();const _=()=>{const e=u(),a=b(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),f=r.useCallback((()=>{(()=>{const n=m(a.state?.pathnameStackToGoBack),i=n.poppedPathname??k();e(i,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=d(a.pathname);return o!=null?s.jsx(l,{menuItem:p(o),onDemoClick:t,onGoBack:f}):s.jsx(c,{})},k=(e=2)=>{let a="../";for(let t=0;t<e;t++)a=`${a}../`;return a};export{_ as F};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as r}from"./sentry-
|
|
1
|
+
import{a as r}from"./sentry-B8WE62R1.js";import{u as l,h as m,g as p}from"./core-DHfFJrfH.js";import{hX as f,TP as g,TQ as _}from"./zeni-epic-state-CgS-13Rp.js";import{u as h,L as b,z as y}from"./index-BxJdVany.js";import"./liveblocks-CPy_3T4M.js";import"./recharts-B2QzdJEJ.js";import"./mui-BCtxe7Uc.js";import"./analytics-MT8j1Arr.js";import"./plaid-BSrnBML8.js";import"./dnd-DG4Q4PBR.js";import"./stripe-cKAAJElX.js";import"./lottie-CPIsfbGQ.js";import"./lexical-Ds-L3Ehk.js";import"./pdf-BNLZqB1A.js";import"./utils-BAMwHjCz.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ec601175-4065-42c0-8005-e7a1386e1045",e._sentryDebugIdIdentifier="sentry-dbid-ec601175-4065-42c0-8005-e7a1386e1045")}catch{}})();function R(){const e=l(),n=m(),o=p(),{setLoading:i,clearAllLoading:d}=h(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(b.CONNECTION_AUTH)}),[i]),r.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(f(t.tenant_id,t.connection_id,g("revenue"),_("hubspot"),{authorization_code:a,client_id:t.client_id,client_secret:t.client_secret,redirect_uri:t.redirect_uri}))}d();const u=y.getActiveTenantForUser();n(u?.tenantEmailDomain!=null?`/${u.tenantEmailDomain}/settings/integrations`:"/",{replace:!0})}),[]),null}export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as s}from"./liveblocks-
|
|
1
|
+
import{m as s}from"./liveblocks-CPy_3T4M.js";import{j as d}from"./core-DHfFJrfH.js";import{fE as f}from"./zeni-epic-state-CgS-13Rp.js";import"./sentry-B8WE62R1.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]="e40ea1f3-fe09-4e9c-a3dd-32e5cdf19438",e._sentryDebugIdIdentifier="sentry-dbid-e40ea1f3-fe09-4e9c-a3dd-32e5cdf19438")}catch{}})();const h=()=>d((e=>f(e))).tenantId==null?{inboxNotifications:[],isLoading:!1,isFetchingMore:!1,hasFetchedAll:!0,fetchMore:()=>null}:(()=>{const{inboxNotifications:e,isLoading:o,isFetchingMore:i,hasFetchedAll:t,fetchMore:n}=s();return{inboxNotifications:e,isLoading:o,isFetchingMore:i,hasFetchedAll:t,fetchMore:n}})();export{h as u};
|