@zeniai/web-app-ui 5.3.58-qa → 5.3.59-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-CHe5ZDGP.js → AccountMappingScreen-DTTeREwj.js} +2 -2
- package/dist/assets/{ActualMatchingMatchDetailScreen-C-SpCliN.js → ActualMatchingMatchDetailScreen--9Q2zWrD.js} +1 -1
- package/dist/assets/AddressRoutes-CpjgVbMa.js +1 -0
- package/dist/assets/AddressScreen-I8Rs-MIn.js +9 -0
- package/dist/assets/AiCfoScreen-xXGezaaX.js +22 -0
- package/dist/assets/{AppDrawer-DOUxHB1n.js → AppDrawer-B74W93Dx.js} +1 -1
- package/dist/assets/{BillPayApprovalRoutes-B0Nta3_I.js → BillPayApprovalRoutes-DCL_JI3v.js} +1 -1
- package/dist/assets/{BillPayRoutes-B9TIHh4P.js → BillPayRoutes-4uVHGBny.js} +10 -10
- package/dist/assets/{BusinessVerificationPageScreen-DrcWW1y2.js → BusinessVerificationPageScreen-Cp54FFZH.js} +2 -2
- package/dist/assets/{CardsAiCfoScreen-DlYyRzr9.js → CardsAiCfoScreen-6wFZ3h7n.js} +1 -1
- package/dist/assets/ChargeCardRoutes-kaYLfF_G.js +71 -0
- package/dist/assets/CompanyPassportScreen-CpTbm6Sc.js +1 -0
- package/dist/assets/ConnectionAuthScreen-BPhkvgwP.js +11 -0
- package/dist/assets/CustomerOnboardingAuthScreen-vcuV_rLb.js +1 -0
- package/dist/assets/{CustomerOnboardingRoutes-CV-zX-f3.js → CustomerOnboardingRoutes-C2BUPvve.js} +3 -3
- package/dist/assets/{DashboardRoutes-B4rPAFsp.js → DashboardRoutes-i732ENnt.js} +4 -4
- package/dist/assets/{DefaultTenantHome-D2yS26zu.js → DefaultTenantHome-Fr9STTcy.js} +1 -1
- package/dist/assets/DomesticWireDetailScreen-DldCKkMe.js +18 -0
- package/dist/assets/{DrawerScreen-DcAKkP88.js → DrawerScreen-DKrIxc45.js} +1 -1
- package/dist/assets/EntityDetailRoutes-Ci3OHQmT.js +1 -0
- package/dist/assets/{ExpenseAutomationRoutes-2l3STf0l.js → ExpenseAutomationRoutes-D2Y0HhSl.js} +4 -4
- package/dist/assets/FeaturePreviewScreen-SWdUfPQt.js +1 -0
- package/dist/assets/{HubSpotOAuthCallbackScreen-Doqpd6l9.js → HubSpotOAuthCallbackScreen-DDiR98eZ.js} +1 -1
- package/dist/assets/{InboxNotificationsProvider-zG7x1gLM.js → InboxNotificationsProvider-Cqk-hq7Y.js} +1 -1
- package/dist/assets/InvoicingRoutes-BIKlKPOH.js +2 -0
- package/dist/assets/MagicLinkRoutes-BjSYWVoE.js +72 -0
- package/dist/assets/MagicLinkSignInScreen-CVVN5hX7.js +12 -0
- package/dist/assets/MobileAppDrawer-7ZhbRmu1.js +1 -0
- package/dist/assets/NotFoundScreen-DcVbM1H7.js +1 -0
- package/dist/assets/{NotificationRoutes-hJV6UzGh.js → NotificationRoutes-CjrMrdzi.js} +1 -1
- package/dist/assets/OAuthConsentScreen-DhHm1x32.js +1 -0
- package/dist/assets/PandLWithForecastRoutes-fBT0Sc9A.js +1 -0
- package/dist/assets/{PaymentLinkScreen-DDprDsoQ.js → PaymentLinkScreen-CgUBBSzR.js} +9 -9
- package/dist/assets/{PeopleRoutes-BlO3KG08.js → PeopleRoutes-CwPbD29F.js} +5 -5
- package/dist/assets/{PerformanceRoutes-6Ca4X1Bq.js → PerformanceRoutes-DJaLpKq7.js} +1 -1
- package/dist/assets/{Preview-Crvq2j5W.js → Preview-DZpsneMy.js} +1 -1
- package/dist/assets/{QBOConnectionScreen-ByT4Lz_O.js → QBOConnectionScreen-B-S6pmPF.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRoutes-BVIa8SJX.js → ReimbursementApprovalRoutes-NW-WKLny.js} +1 -1
- package/dist/assets/{ReimbursementApprovalRuleDetailScreen-BmA4MWUa.js → ReimbursementApprovalRuleDetailScreen-D61HNZbO.js} +1 -1
- package/dist/assets/{ReimbursementRoutes-CRFGQISM.js → ReimbursementRoutes-Df6Tud5L.js} +12 -12
- package/dist/assets/{ReportsRoutes-s6sDyTPD.js → ReportsRoutes-CuktTqMX.js} +1 -1
- package/dist/assets/RewardsRoutes-5Gqy0mIy.js +1 -0
- package/dist/assets/{ScheduleDetailsPrepaidExpensesScreen-CDMS-Kyu.js → ScheduleDetailsPrepaidExpensesScreen-DazVitQy.js} +5 -5
- package/dist/assets/{ScreenRoutes-DGSfHb9l.js → ScreenRoutes-BuhEV3h0.js} +2 -2
- package/dist/assets/{SettingsRoutes-C_k-hnnr.js → SettingsRoutes-CEmnHqG6.js} +5 -5
- package/dist/assets/{SetupPagesScreen-DAfX5Gik.js → SetupPagesScreen-DdTVcR2_.js} +5 -5
- package/dist/assets/{SignInScreen-C5hV08WY.js → SignInScreen-BITRkzSC.js} +1 -1
- package/dist/assets/SignOutScreen-C5iuWq-z.js +9 -0
- package/dist/assets/{TaskListScreen-DKWXa0Uv.js → TaskListScreen-CwUzHwaA.js} +2 -2
- package/dist/assets/TaskRoutes-CFl1X2SM.js +9 -0
- package/dist/assets/TransactionDetailRoutes-DK4lWWF0.js +1 -0
- package/dist/assets/TransactionDetailScreen-iW49SNvH.js +5 -0
- package/dist/assets/{TransactionListRoutes-CiDmnLCE.js → TransactionListRoutes-BsHwubWD.js} +1 -1
- package/dist/assets/{TreasuryRoutes-3zDhHaKN.js → TreasuryRoutes-CN9ZH5Gy.js} +5 -5
- package/dist/assets/{VendorsRoutes-BkvgN-45.js → VendorsRoutes-B3QNi1in.js} +10 -10
- package/dist/assets/WiseConfirmationScreen-adPXoaAz.js +12 -0
- package/dist/assets/ZeniAccountRoutes-CFTwFem2.js +57 -0
- package/dist/assets/ZeniAccountStatementScreen-D7D_AloB.js +9 -0
- package/dist/assets/{accountMappingHelper-Dr9MEF3a.js → accountMappingHelper-DPpfSFuE.js} +1 -1
- package/dist/assets/{analytics-Ckbn2qr2.js → analytics-VM2TTd1t.js} +1 -1
- package/dist/assets/{analyticsHelper-vNgRVJkc.js → analyticsHelper-DRQlG4Yk.js} +1 -1
- package/dist/assets/{core-C1MQ75FC.js → core-DuhHfvEc.js} +1 -1
- package/dist/assets/{decodeURIComponentSafe-BkSrHWOz.js → decodeURIComponentSafe-BuuGDiIq.js} +1 -1
- package/dist/assets/{dnd-64pfrglk.js → dnd-pjIs22E1.js} +1 -1
- package/dist/assets/{empty-CPYiU0XG.js → empty-CJJq6lBE.js} +1 -1
- package/dist/assets/{empty-DTjUxrNn.js → empty-DH6a4LIS.js} +1 -1
- package/dist/assets/{emptyVideoElement-lIBGY-aq.js → emptyVideoElement-Buo10ELC.js} +1 -1
- package/dist/assets/epic-BrvjVRdN.js +2 -0
- package/dist/assets/expenseAutomationHelper-B5_HDAxt.js +1 -0
- package/dist/assets/{getLocaleForTenant-BAgQLN5V.js → getLocaleForTenant-pGR9Sol9.js} +1 -1
- package/dist/assets/{index-DheSTGi7.js → index-BSR6syxs.js} +12365 -12358
- package/dist/assets/{index-Dl0S4JM9.js → index-BnTSo1tz.js} +1 -1
- package/dist/assets/{index-BgIX2Tk5.js → index-CKIs26-I.js} +2 -2
- package/dist/assets/{index-RA90NjT0.js → index-DLhjtHx_.js} +1 -1
- package/dist/assets/{index-Dcy8EwAy.js → index-Da30M-mt.js} +1 -1
- package/dist/assets/{index-fx_VKS0e.js → index-DhX5ECiu.js} +1 -1
- package/dist/assets/{index-DBaQwW7d.js → index-iYJnyyes.js} +1 -1
- package/dist/assets/{index-DuTsLjcS.js → index-sDU_TgqD.js} +1 -1
- package/dist/assets/{lexical-TkcJlpM_.js → lexical-Db4_RNT4.js} +1 -1
- package/dist/assets/{liveblocks-BF-IiX2V.js → liveblocks-Bnd7TfEn.js} +1 -1
- package/dist/assets/{lottie-CWNAcXJv.js → lottie-DnzLxz4m.js} +1 -1
- package/dist/assets/{mui-D4JyxRuO.js → mui-CAtYecwm.js} +1 -1
- package/dist/assets/{pathToGoBack-wJzek_Cz.js → pathToGoBack-DaQqgjO2.js} +1 -1
- package/dist/assets/{pdf-Cj_veg-U.js → pdf-C4y-9f6g.js} +3 -3
- package/dist/assets/{pdf-lib-LgS50teK.js → pdf-lib-BWugleNz.js} +1 -1
- package/dist/assets/{plaid-CD2DDkpy.js → plaid-DQqtphHb.js} +1 -1
- package/dist/assets/{pusher-CgyD-8gi.js → pusher-HpTlXf8Y.js} +1 -1
- package/dist/assets/{react-DylygKQb.js → react-C6LG84CA.js} +1 -1
- package/dist/assets/{react-DW9umh8L.js → react-C6rP9W0h.js} +1 -1
- package/dist/assets/{react-LQ8ewR7F.js → react-Ci7GXtnj.js} +1 -1
- package/dist/assets/{react-BhEAmIaW.js → react-DxnB6A_E.js} +1 -1
- package/dist/assets/{react-BPkYL230.js → react-RcSRKvz2.js} +1 -1
- package/dist/assets/{react-CBd5YUO5.js → react-Zn4z9FkL.js} +1 -1
- package/dist/assets/{recharts-BEOxWuh3.js → recharts-Ax0XVvbk.js} +1 -1
- package/dist/assets/{routePaths-DrHt4RCx.js → routePaths-DY-fUoNb.js} +1 -1
- package/dist/assets/{sentry-DQv7eTqs.js → sentry-C4tTgPRE.js} +1 -1
- package/dist/assets/{stripSplatSuffix-CF6NUsXZ.js → stripSplatSuffix-C2h79EC3.js} +1 -1
- package/dist/assets/{url-Eifk29FQ.js → url-Cf1wHOjT.js} +1 -1
- package/dist/assets/{url-BQJem0W5.js → url-oIafCeJQ.js} +1 -1
- package/dist/assets/useActualMatchingMatchDetail-BS7hRXcn.js +1 -0
- package/dist/assets/{useAiCfoDashboardSuggestedQuestionsChips-DRaJ3Gwb.js → useAiCfoDashboardSuggestedQuestionsChips-DS5PLjzx.js} +1 -1
- package/dist/assets/{useAskAiCfoHostNavButtonProps-DhY9V91R.js → useAskAiCfoHostNavButtonProps-BmrnfhUQ.js} +1 -1
- package/dist/assets/{useChargeCardPusherEvents-Cwq1bouz.js → useChargeCardPusherEvents-BgJc6X4f.js} +1 -1
- package/dist/assets/{useDeviceId-BrccfFDF.js → useDeviceId-D-PGNAnc.js} +1 -1
- package/dist/assets/useEmailConnectResultRefresh-BiJOFAYU.js +1 -0
- package/dist/assets/{useInitialThreadRequest-Fj77Qh1B.js → useInitialThreadRequest-B6RfidGO.js} +1 -1
- package/dist/assets/{useTaskManagerAccess-BOnqrzjJ.js → useTaskManagerAccess-CSigDKkg.js} +1 -1
- package/dist/assets/{useTaskManagerPusherEvents-jr7UAjj6.js → useTaskManagerPusherEvents-7vpYlql3.js} +1 -1
- package/dist/assets/{utils-G6VVxCSd.js → utils-BtDnAqMA.js} +1 -1
- package/dist/assets/{withTransactionSidePanel-DdbBVvXc.js → withTransactionSidePanel-C37C2_tY.js} +4 -4
- package/dist/assets/{zeni-epic-state-Dmop9tB7.js → zeni-epic-state-B5FlPsWC.js} +6 -6
- package/dist/index.html +1 -1
- package/package.json +3 -3
- package/dist/assets/AddressRoutes-D1soVd7h.js +0 -1
- package/dist/assets/AddressScreen-Dsruahz2.js +0 -9
- package/dist/assets/AiCfoScreen-3zzxXdtv.js +0 -22
- package/dist/assets/ChargeCardRoutes-DZRPdI1Z.js +0 -71
- package/dist/assets/CompanyPassportScreen-DAYszi2A.js +0 -1
- package/dist/assets/ConnectionAuthScreen-BBBGS4jz.js +0 -11
- package/dist/assets/CustomerOnboardingAuthScreen-CZDOwYAs.js +0 -1
- package/dist/assets/DomesticWireDetailScreen-C3OQdqoM.js +0 -18
- package/dist/assets/EntityDetailRoutes-Cf2odala.js +0 -1
- package/dist/assets/FeaturePreviewScreen-B1Ivzvw1.js +0 -1
- package/dist/assets/InvoicingRoutes-CQVQ-Y38.js +0 -2
- package/dist/assets/MagicLinkRoutes-DcyXYSMX.js +0 -72
- package/dist/assets/MagicLinkSignInScreen-DSwu3x1a.js +0 -12
- package/dist/assets/MobileAppDrawer-CdDtqWOO.js +0 -1
- package/dist/assets/NotFoundScreen-ujna2tN5.js +0 -1
- package/dist/assets/OAuthConsentScreen-CC7ydiAB.js +0 -1
- package/dist/assets/PandLWithForecastRoutes-BlHGiHRN.js +0 -1
- package/dist/assets/RewardsRoutes-D_CDp-DT.js +0 -1
- package/dist/assets/SignOutScreen-BW3JHrQP.js +0 -9
- package/dist/assets/TaskRoutes-uwwC8_Az.js +0 -9
- package/dist/assets/TransactionDetailRoutes-9VQeLVZi.js +0 -1
- package/dist/assets/TransactionDetailScreen-D87lkTI9.js +0 -5
- package/dist/assets/WiseConfirmationScreen-Ca5i9ss6.js +0 -12
- package/dist/assets/ZeniAccountRoutes-BDqvTfgU.js +0 -57
- package/dist/assets/ZeniAccountStatementScreen-iAxQqIlV.js +0 -9
- package/dist/assets/epic-Sk9LU7p7.js +0 -2
- package/dist/assets/expenseAutomationHelper-VfFbXlTC.js +0 -1
- package/dist/assets/useActualMatchingMatchDetail-DXOytDvG.js +0 -1
- package/dist/assets/useEmailConnectResultRefresh-2DUe5mQi.js +0 -1
package/dist/assets/{ExpenseAutomationRoutes-2l3STf0l.js → ExpenseAutomationRoutes-D2Y0HhSl.js}
RENAMED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{j as b}from"./liveblocks-
|
|
1
|
+
import{j as b}from"./liveblocks-Bnd7TfEn.js";import{u as he,h as nt,g as be,j as _,i as Oe,t as Yn,l as Hn,n as Kn,o as He,N as Xn}from"./core-DuhHfvEc.js";import{fF as ke,a14 as Qn,q0 as _e,Ue as Zn,A3 as es,a15 as ts,a16 as as,a17 as ns,a18 as gt,a19 as Xe,gh as bt,a1a as ca,eW as ss,g0 as os,a1b as ia,a1c as Qe,qT as cs,uR as is,gS as ls,gQ as rs,a1d as ds,r4 as us,rd as ms,qb as ps,qp as wa,gP as re,gR as hs,a1e as Ss,qL as Ra,re as gs,qm as Cs,qh as fs,uX as Is,gO as Me,a1f as tt,Cd as Da,MA as Fa,a1g as _a,Fy as Ma,a1h as ks,eZ as bs,e$ as Ts,sS as Tt,W_ as la,X0 as Ps,m2 as ys,X1 as vs,m9 as Es,dl as As,Dw as Pt,a1i as xs,a1j as ws,fm as yt,sG as ra,WT as Rs,a1k as Ds,a1l as Fs,mb as _s,a1m as Ms,Rg as Us,ma as Os,l$ as Bs,qE as Ua,rj as at,tt as Oa,tP as Vs,U4 as Ba,ri as da,rl as Va,rn as js,bE as Ls,ny as zs,nv as $s,rm as Ze,rk as pe,a1n as Gs,rE as ua,a1o as Ns,a1p as qs,sK as Js,sL as Ws,WP as Ys,VV as Hs,a0y as Ks,a1q as Xs,WV as ma,WU as Ke,a1r as pa,mq as Qs,a1s as Zs,a1t as eo,a1u as to,a1v as ao,qz as no,a1w as so,a1x as oo,a1y as co,ru as io,md as lo,m4 as ro,a1z as uo,mc as ha,Xb as mo,a1A as po,a1B as ho,us as So,u3 as go,u2 as Ct,a1C as Co,a1D as fo,a1E as Io,a1F as ko,nJ as bo,br as To,nE as Sa,nq as Po,a1G as yo,g$ as vo,nB as Eo,sU as Ao,sW as xo,sD as wo,VY as Ro,VZ as Do,F0 as Fo,E$ as _o,Fg as Mo,a1H as ga,sJ as Uo,a1I as Oo,rU as Bo,r_ as Vo,s9 as jo,rX as Lo,a1J as zo,s8 as $o,sP as Go,a1K as No,t0 as qo,sx as Jo,t6 as Wo,sC as Yo,rF as Ho,a1L as Ko,qX as Xo,qv as Qo,qC as Ca,rp as Zo,a1M as ec,a1N as tc,a1O as ac,a1P as nc,a1Q as sc,a1R as oc,a1S as cc,ta as ic,a1T as lc,a1U as rc,a1V as fa,uD as dc,tW as uc,tL as Ia,tJ as mc,a1W as pc,ty as hc,td as Sc,tM as gc,a1X as Cc,a1Y as fc,tj as Ic,a1Z as kc,te as bc,ti as Tc,tg as Pc,tS as yc}from"./zeni-epic-state-B5FlPsWC.js";import ja from"./NotFoundScreen-DcVbM1H7.js";import{a as s,R as La}from"./sentry-C4tTgPRE.js";import{n as Te,S as vc}from"./mui-CAtYecwm.js";import{o as Be,S as H,k as Q,p as te,ar as za,at as $a,dP as Ec,dQ as Ac,M as Ga,z as st,dR as xc,dS as wc,dT as Rc,af as Ue,dU as Dc,dV as ka,bb as ba,dW as Fc,a8 as Na,dX as _c,j as et,a as Mc,dY as Uc,dZ as Oc,O as Bc,K as Vc,d_ as jc,d$ as Lc,e0 as zc,b5 as $c,bt as Gc,ac as Nc,b6 as qc,b7 as Jc,G as Wc,w as Yc,e1 as Hc,aw as Ta,e2 as Kc}from"./index-BSR6syxs.js";import{u as qa}from"./useAskAiCfoHostNavButtonProps-BmrnfhUQ.js";import{g as Pa,b as Xc,c as Qc,h as Zc,a as ei,i as ti,r as ai,C as ni}from"./TransactionDetailScreen-iW49SNvH.js";import{u as si}from"./useActualMatchingMatchDetail-BS7hRXcn.js";import{d as oi}from"./decodeURIComponentSafe-BuuGDiIq.js";import{m as Ja,a as Wa}from"./expenseAutomationHelper-B5_HDAxt.js";import{u as Ya,a as Ha,w as ci}from"./withTransactionSidePanel-C37C2_tY.js";import{b as ii,S as li,a as ri,J as di}from"./ScheduleDetailsPrepaidExpensesScreen-DazVitQy.js";import{s as ya,i as Ka,h as ui,v as mi,c as pi}from"./routePaths-DY-fUoNb.js";import{a as ft}from"./accountMappingHelper-DPpfSFuE.js";import{D as hi}from"./DrawerScreen-DKrIxc45.js";import"./recharts-Ax0XVvbk.js";import"./analytics-VM2TTd1t.js";import"./plaid-DQqtphHb.js";import"./dnd-pjIs22E1.js";import"./stripe-cKAAJElX.js";import"./lottie-DnzLxz4m.js";import"./lexical-Db4_RNT4.js";import"./pdf-C4y-9f6g.js";import"./utils-BtDnAqMA.js";import"./useInitialThreadRequest-B6RfidGO.js";import"./stripSplatSuffix-C2h79EC3.js";import"./pathToGoBack-DaQqgjO2.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new t.Error().stack;n&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[n]="2d219bb3-5491-47a2-a5be-6037b8ad0589",t._sentryDebugIdIdentifier="sentry-dbid-2d219bb3-5491-47a2-a5be-6037b8ad0589")}catch{}})();const Si=()=>{const t=he(),n=nt(),f=be(),I=_((C=>ke(C))),{useFeatureGate:k}=Be(),{isFeatureEnabled:o}=k(H.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:r}=k(H.aiAuditScorePercentage),E=_((C=>C.expenseAutomationViewState.selectedPeriodByTenantId)),l=_((C=>Qn(C,I.tenantId))),{isAiCfoAccessEnabled:S,onAskAiCfoClick:R}=qa({mobileExploreReferrer:"Month-End Close Overview"}),x=s.useCallback(((C,h,L=!1)=>{t(_e({tenantId:h,period:{month:C.month,year:C.year},refreshViewInBackground:L}))}),[]),m=s.useCallback((C=>{const h=f.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(C.month,C.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,h??null),t(Zn(I.tenantId,C))}),[I.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),g=E[I.tenantId],u=s.useCallback((()=>{const C=f.state?.referrer;l.monthEndCloseChecks?.auditSummary!=null&&Q.trackMonthCloseAuditPage(g.month,g.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!0,C??null),x(g,I.tenantId,!0)}),[x,g,I.tenantId,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),F=te(f.state?.pathnameStackToGoBack,f.pathname),A=s.useCallback((()=>{if(l.monthEndCloseChecks!=null&&g!=null){const C=l.monthEndCloseChecks.monthEndCloseCheckList.find((h=>h.progress<100));if(C!=null)return void n(`./${C.id}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview"}});n(`./month_end_insights/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview"}})}}),[l.monthEndCloseChecks,g]),{areTenantIdsInSync:p}=za();return $a({isDataReady:l.fetchState==="Completed"}),s.useEffect((()=>{g!=null&&l.fetchState!=="In-Progress"&&l.fetchState!=="Completed"&&p&&x(g,I.tenantId)}),[x,g,l.fetchState,I.tenantId,p]),s.useEffect((()=>{g!=null&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="In-Progress"&&l.monthClosePerformanceTrendFetchStatus.fetchState!=="Completed"&&p&&t(es(g))}),[g,l.monthClosePerformanceTrendFetchStatus.fetchState,p]),s.useEffect((()=>{const C=setInterval((()=>{l.fetchState!=="In-Progress"&&l.fetchState==="Completed"&&u()}),3e5);return()=>clearInterval(C)}),[l.fetchState]),s.useEffect((()=>{if(l.fetchState==="Completed"&&l.monthEndCloseChecks?.auditSummary!=null){const C=f.state?.referrer;Q.trackMonthCloseAuditPage(l.selectedPeriod.month,l.selectedPeriod.year,l.monthEndCloseChecks.reportEmailSentDate!=null?"closed":"in-review",l.monthEndCloseChecks.auditSummary.auditScorePercentage,!1,C??null)}}),[l.fetchState,l.selectedPeriod,l.monthEndCloseChecks?.auditSummary,l.monthEndCloseChecks?.reportEmailSentDate]),b.jsx(gi,{children:b.jsx(Ec,{monthEndCloseChecksView:l,isRealtimeInsightsFeatureEnabled:o,onMonthEndCheckClick:C=>{n(`./${C}/${g.month}-${g.year}`,{state:{pathnameStackToGoBack:F,message:"comingFromOverview",referrer:"Expense Automation - Overview"}})},onPeriodChange:m,handleReviewButtonClick:A,onBackClick:()=>{n("../../dashboard")},onReload:u,isAiCfoAccessEnabled:S,onAskAiCfoClick:R,aiAuditScorePercentageEnabled:r})})},gi=Te.div`
|
|
2
2
|
display: flex;
|
|
3
3
|
height: 100vh;
|
|
4
4
|
width: 100%;
|
|
5
5
|
flex: 1 1 auto;
|
|
6
6
|
flex-direction: column;
|
|
7
7
|
background-color: ${t=>t.theme.colors.grey4};
|
|
8
|
-
`;function Ci({isFullView:t,matchId:n,onClose:f}){const{match:I,detailFetchState:k,handleOpenBill:o,handleContinueMatch:r,handleRefresh:E,handleUndoReversal:l,lastMatchResults:S,lastUndoResults:R,refreshStatus:x,undoReversalStatus:m}=si(n);return b.jsx(Ac,{match:I,detailFetchState:k.fetchState,isRenderedInPanel:!t,isUndoInFlight:m.fetchState==="In-Progress",refreshStatus:x.fetchState,onNavigateBack:f,onOpenBill:o,onContinueMatch:r,onRefresh:E,onUndoReversal:l,lastMatchResults:S,lastUndoResults:R})}const fi=/^match\/([^/?]+)$/,Ii=Ha({displayNamePrefix:"withActualMatchingSidePanel",usePanelSetup:function(t){const{useFeatureGate:n}=Be(),{isFeatureEnabled:f}=n(H.isTransactionDetailSplitViewEnabled),{isFeatureEnabled:I}=n(H.isAccrualEnabled),k=Ga(),o=(function(E=!0){const l=nt(),S=be(),R=Oe(),x=Ja(R),m=Ya({childPathPattern:fi,enabled:E,listPath:x}),g=m.matchGroups[0]!=null&&m.matchGroups[0]!==""?oi(m.matchGroups[0]):void 0,u=R.tenantEmailDomain??S.pathname.split("/").find(Boolean)??"",F=s.useRef({isOpen:m.isOpen,matchId:g});F.current={isOpen:m.isOpen,matchId:g};const A=s.useCallback((h=>{!m.isMobile&&E?F.current.isOpen&&F.current.matchId===h?m.closePanel():m.navigateToChild(`match/${encodeURIComponent(h)}`,{replace:F.current.isOpen}):l(`/${u}/expense-automation/actual-matching/${encodeURIComponent(h)}`)}),[l,m.isMobile,m.navigateToChild,m.closePanel,E,u]),p=s.useCallback((()=>{if(g==null)return;const h=te(S.state?.pathnameStackToGoBack,`${S.pathname}${S.search}`);l(`/${u}/expense-automation/actual-matching/${encodeURIComponent(g)}`,{state:{pathnameStackToGoBack:h}})}),[S.pathname,S.search,S.state,g,l,u]),C=m.isOpen&&g!=null;return{closePanel:m.closePanel,isOpen:C,maximize:p,matchId:E&&C?g:void 0,openPanel:A}})(t&&I===!0&&k===!0&&f===!0),r=s.useMemo((()=>{if(o.isOpen&&o.matchId!=null)return b.jsx(Ci,{isFullView:!1,matchId:o.matchId,onClose:o.closePanel},o.matchId)}),[o.closePanel,o.isOpen,o.matchId]);return{injectedProps:s.useMemo((()=>({closeMatchSidePanel:o.closePanel,isMatchPanelOpen:o.isOpen,matchPanelContent:r,matchPanelMatchId:o.matchId,openMatchPanel:o.openPanel})),[r,o.closePanel,o.isOpen,o.matchId,o.openPanel]),selectedItemId:o.matchId,sidePanel:{closePanel:o.closePanel,maximize:o.maximize}}}}),ki=La.memo((({reconciliation:t,selectedDrawerAccountId:n,onClose:f,onFetchLinkTokenClick:I,onEstablishConnectionClick:k})=>{const o=he(),{useFeatureGate:r}=Be(),{isFeatureEnabled:E}=r(H.isReconV3Enabled),{isFeatureEnabled:l}=r(H.isReconciliationCombinedStatementEnabled),S=st.getSignedInUser(),R=_((y=>ke(y))),x=s.useMemo((()=>({userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:R?.tenantId??""})),[S?.userId,S?.zeniSessionId,R?.tenantId]),{accountReconciliationsByAccountID:m,excludedAccountIDs:g,monthYearPeriod:u,statementUploadChosen:F}=t,A=m[n],p=s.useMemo((()=>ts(m,n)),[m,n]),C=s.useMemo((()=>as(m)),[m]),h=s.useMemo((()=>ns(m,n)),[m,n]),L=s.useRef(!1),G=s.useCallback((y=>{L.current=y,ka(n,y)}),[n]),q=s.useCallback((y=>{o(gt({accountId:n,selectedPeriod:u,dismissedToBackground:!0,backgroundCompletedSteps:y.completedSteps,startedAtMs:y.startedAtMs,totalDurationSeconds:y.totalDurationSeconds})),y.accountMappings!=null&&o(
|
|
8
|
+
`;function Ci({isFullView:t,matchId:n,onClose:f}){const{match:I,detailFetchState:k,handleOpenBill:o,handleContinueMatch:r,handleRefresh:E,handleUndoReversal:l,lastMatchResults:S,lastUndoResults:R,refreshStatus:x,undoReversalStatus:m}=si(n);return b.jsx(Ac,{match:I,detailFetchState:k.fetchState,isRenderedInPanel:!t,isUndoInFlight:m.fetchState==="In-Progress",refreshStatus:x.fetchState,onNavigateBack:f,onOpenBill:o,onContinueMatch:r,onRefresh:E,onUndoReversal:l,lastMatchResults:S,lastUndoResults:R})}const fi=/^match\/([^/?]+)$/,Ii=Ha({displayNamePrefix:"withActualMatchingSidePanel",usePanelSetup:function(t){const{useFeatureGate:n}=Be(),{isFeatureEnabled:f}=n(H.isTransactionDetailSplitViewEnabled),{isFeatureEnabled:I}=n(H.isAccrualEnabled),k=Ga(),o=(function(E=!0){const l=nt(),S=be(),R=Oe(),x=Ja(R),m=Ya({childPathPattern:fi,enabled:E,listPath:x}),g=m.matchGroups[0]!=null&&m.matchGroups[0]!==""?oi(m.matchGroups[0]):void 0,u=R.tenantEmailDomain??S.pathname.split("/").find(Boolean)??"",F=s.useRef({isOpen:m.isOpen,matchId:g});F.current={isOpen:m.isOpen,matchId:g};const A=s.useCallback((h=>{!m.isMobile&&E?F.current.isOpen&&F.current.matchId===h?m.closePanel():m.navigateToChild(`match/${encodeURIComponent(h)}`,{replace:F.current.isOpen}):l(`/${u}/expense-automation/actual-matching/${encodeURIComponent(h)}`)}),[l,m.isMobile,m.navigateToChild,m.closePanel,E,u]),p=s.useCallback((()=>{if(g==null)return;const h=te(S.state?.pathnameStackToGoBack,`${S.pathname}${S.search}`);l(`/${u}/expense-automation/actual-matching/${encodeURIComponent(g)}`,{state:{pathnameStackToGoBack:h}})}),[S.pathname,S.search,S.state,g,l,u]),C=m.isOpen&&g!=null;return{closePanel:m.closePanel,isOpen:C,maximize:p,matchId:E&&C?g:void 0,openPanel:A}})(t&&I===!0&&k===!0&&f===!0),r=s.useMemo((()=>{if(o.isOpen&&o.matchId!=null)return b.jsx(Ci,{isFullView:!1,matchId:o.matchId,onClose:o.closePanel},o.matchId)}),[o.closePanel,o.isOpen,o.matchId]);return{injectedProps:s.useMemo((()=>({closeMatchSidePanel:o.closePanel,isMatchPanelOpen:o.isOpen,matchPanelContent:r,matchPanelMatchId:o.matchId,openMatchPanel:o.openPanel})),[r,o.closePanel,o.isOpen,o.matchId,o.openPanel]),selectedItemId:o.matchId,sidePanel:{closePanel:o.closePanel,maximize:o.maximize}}}}),ki=La.memo((({reconciliation:t,selectedDrawerAccountId:n,onClose:f,onFetchLinkTokenClick:I,onEstablishConnectionClick:k})=>{const o=he(),{useFeatureGate:r}=Be(),{isFeatureEnabled:E}=r(H.isReconV3Enabled),{isFeatureEnabled:l}=r(H.isReconciliationCombinedStatementEnabled),S=st.getSignedInUser(),R=_((y=>ke(y))),x=s.useMemo((()=>({userId:S?.userId??"",sessionId:S?.zeniSessionId??"",tenantId:R?.tenantId??""})),[S?.userId,S?.zeniSessionId,R?.tenantId]),{accountReconciliationsByAccountID:m,excludedAccountIDs:g,monthYearPeriod:u,statementUploadChosen:F}=t,A=m[n],p=s.useMemo((()=>ts(m,n)),[m,n]),C=s.useMemo((()=>as(m)),[m]),h=s.useMemo((()=>ns(m,n)),[m,n]),L=s.useRef(!1),G=s.useCallback((y=>{L.current=y,ka(n,y)}),[n]),q=s.useCallback((y=>{o(gt({accountId:n,selectedPeriod:u,dismissedToBackground:!0,backgroundCompletedSteps:y.completedSteps,startedAtMs:y.startedAtMs,totalDurationSeconds:y.totalDurationSeconds})),y.accountMappings!=null&&o(Xe({accountId:n,selectedPeriod:u,localData:{combinedStatementAccountMappings:y.accountMappings}})),A!=null&&requestAnimationFrame((()=>{L.current||o(bt({messageSection:"statement_parsing_in_progress",messageText:"success",type:"info",showStatusIcon:!0,variables:[{variableName:"_account_name_",variableValue:xc(A)}]}))}))}),[o,u,A,n]),T=s.useCallback((()=>{o(gt({accountId:n,selectedPeriod:u,dismissedToBackground:!1}))}),[o,n,u]),J=s.useCallback((y=>{o(ca({accountId:n,selectedPeriod:u,backgroundCompletedSteps:y}))}),[o,u,n]),N=s.useCallback((()=>{o(ca({accountId:n,selectedPeriod:u,backgroundCompletedSteps:0})),o(gt({accountId:n,selectedPeriod:u,dismissedToBackground:!1}))}),[o,u,n]);s.useEffect((()=>()=>{ka(null,!1)}),[]);const e=A?.parsedStatementData?.statementUpload?.statementMeta?.statementUploadId??A?.accountReconEntity.statementMetaData?.statementUploadId,a=A?.statementDateConflict?.previousReconciliationInfo?.reconciledByUserId,i=_((y=>a!=null&&a!==""?ss(os(y.userState,a)):"")),d=s.useCallback((()=>{o(ia({accountId:n,selectedPeriod:u}))}),[o,n,u]),v=s.useCallback((()=>{o(ia({accountId:n,selectedPeriod:u})),o(Qe({statementUploadChosen:!0}))}),[o,n,u]),P=(y,z)=>{o(Is(y,z.split(".")[0]))},D=(y,z)=>{if(z===!0){const X=A?.combinedStatementGroupId??A?.parsedStatementData?.statementUpload?.statementMeta?.combinedStatementGroupId??A?.parsedStatementData?.statementUpload?.combinedStatementDetails?.combinedStatementGroupId;if(X!=null&&X!=="")return void o(Cs({accountId:n,selectedPeriod:u,combinedStatementGroupId:X,fileId:y}))}e!=null&&o(fs({accountId:n,selectedPeriod:u,fileId:y,statementUploadId:e}))},M=()=>{o(Qe({statementUploadChosen:!1}))},W=y=>{o(gs({accountId:n,selectedPeriod:u,payload:y,statementAccountScope:l===!0?A?.localData?.statementAccountScope??"single_account":"single_account"}))},Y=s.useCallback(((y,z,X)=>{o(cs({accountId:y,selectedPeriod:z,statementUploadId:X}))}),[o]),se=s.useCallback(((y,z,X,Z,ge)=>{ge!=null&&ge!==""&&o(is(ge)),o(Z==null||Z===""?rs({accountId:y,selectedPeriod:z,statementUploadId:X}):ls({accountId:y,selectedPeriod:z,statementUploadId:X,combinedStatementGroupId:Z}))}),[o]),ce=s.useCallback(((y,z)=>{z!==""&&o(ds({accountId:n,selectedPeriod:u,statementUpdateLocalData:y,statementUploadId:z}))}),[o,n,u]),Pe=s.useCallback((()=>{e!=null&&o(A?.localData?.statementAccountScope!=="multi_account"?ms({accountId:n,selectedPeriod:u,statementUploadId:e}):us({accountId:n,selectedPeriod:u,statementUploadId:e}))}),[o,A?.localData?.statementAccountScope,n,u,e]),ye=s.useCallback((y=>{e!=null&&o(ps({accountId:n,selectedPeriod:u,statementUploadId:e,accountMappings:y}))}),[o,u,n,e]),ve=s.useCallback((()=>{o(Qe({statementUploadChosen:!0}))}),[o]),K=y=>{o(Xe({accountId:n,selectedPeriod:u,localData:{accountSource:y}}))},B=y=>{o(Xe({accountId:n,selectedPeriod:u,localData:{statementAccountScope:y}}))},Ve=s.useCallback((()=>{o(wa({accountId:n}))}),[o,n]),Ee=s.useCallback((y=>{o(re(u,y,!0)),f()}),[o,u,f]),ot=s.useCallback((()=>{o(hs({accountId:n,selectedPeriod:u,statementProcessingFailed:!1})),o(Ss({accountId:n,selectedPeriod:u}))}),[o,n,u]),Se=s.useCallback((()=>{o(Ra({accountId:n}))}),[o,n]),je=g.includes(n)?t.excludedAccountReconciliationByAccountID[n]:void 0;if(je!=null)return b.jsx(va,{children:b.jsx(Ea,{$isV3:E===!0,children:b.jsx(wc,{excludedAccountReconciliation:je,includeAccountFetch:t.includeAccountFetchState,isReconV3Enabled:E,onDismissClick:f,onIncludeIntoReconciliation:Se})})});if(A!=null){const y=E===!0?b.jsx(Rc,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:A,monthYearPeriod:u,onDismissClick:f,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:I,onEstablishConnectionClick:k,onEditFileName:P,onDeleteFile:D,onSelectSourceType:K,onSelectStatementAccountScope:B,isReconciliationCombinedStatementEnabled:l===!0,ledgerAccounts:p,statementOverrideWarningAccountIds:h,unavailableLedgerAccountIds:C,onConfirmStatementMapping:ye,filesEndPoint:Ue.fileMicroServiceBaseUrl,authParams:x,openFilePicker:F,onStatementUploadSuccess:W,onUploadWindowOpenedOnce:M,onExcludeFromReconciliation:Ve,onRetryParsing:Y,onFetchStatementParseInfo:se,onReviewClicked:Ee,statementProcessingFailed:A.statementProcessingFailed,statementProcessingDismissedToBackground:A.statementProcessingDismissedToBackground,onDismissStatementProcessingFailed:ot,onContinueInBackground:q,onClearStatementProcessingDismissedToBackground:T,onResetStatementProcessingProgress:N,onStatementProcessingProgressChange:J,onStatementFlowVisibilityChange:G,onReuploadStatement:ve,onStatementFormDataChange:ce,onStatementConfirmSave:Pe,reconciledByName:i,onDismissDateConflict:d,onReuploadAfterDateConflict:v,isReconV3Enabled:E}):b.jsx(Dc,{excludeAccountFetch:t.excludeAccountFetchState,accountReconciliation:A,monthYearPeriod:u,onDismissClick:f,plaidConnectionDetails:t.plaidConnectionDetails,onFetchLinkTokenClick:I,onEstablishConnectionClick:k,onEditFileName:P,onDeleteFile:D,onSelectSourceType:K,filesEndPoint:Ue.fileMicroServiceBaseUrl,authParams:x,openFilePicker:F,onStatementUploadSuccess:W,onUploadWindowOpenedOnce:M,onExcludeFromReconciliation:Ve});return b.jsx(va,{children:b.jsx(Ea,{$isV3:E===!0,children:y})})}return null})),va=Te.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
flex-direction: column;
|
|
11
11
|
height: 100%;
|
|
@@ -31,8 +31,8 @@ import{j as b}from"./liveblocks-BF-IiX2V.js";import{u as he,h as nt,g as be,j as
|
|
|
31
31
|
min-width: 0;
|
|
32
32
|
overflow-x: hidden;
|
|
33
33
|
overflow-y: auto;
|
|
34
|
-
`,vi=/^schedule\/(prepaid_expenses|fixed_assets|accrued_expenses|one_time_accrual)\/([^/?]+)$/,Ei=Ha({displayNamePrefix:"withScheduleSidePanel",usePanelSetup:function(t){const n=(function(m=!0){const g=nt(),u=be(),F=he(),A=Oe(),p=Ya({childPathPattern:vi,enabled:m}),C=p.matchGroups[0],h=Ka(C)?C:void 0,L=p.matchGroups[1]!=null&&p.matchGroups[1]!==""?p.matchGroups[1]:void 0,G=p.isOpen&&h!=null&&L!=null,q=A.tenantEmailDomain??u.pathname.split("/").find(Boolean)??"",T=s.useRef({isOpen:G,scheduleId:L});T.current={isOpen:G,scheduleId:L};const J=s.useCallback(((e,a,i)=>{i!=null&&(a==="prepaid_expenses"||a==="fixed_assets")&&F(Ma({selectedJEScheduleKey:i})),!p.isMobile&&m?T.current.isOpen&&T.current.scheduleId===e?p.closePanel():p.navigateToChild(`schedule/${a}/${e}`,{replace:T.current.isOpen}):g(ya(a,e,q),{state:{message:"expenseAutomation",origin:"je_schedules"}})}),[F,g,p.isMobile,p.navigateToChild,p.closePanel,m,q]),N=s.useCallback((()=>{if(h==null||L==null)return;const e=te(u.state?.pathnameStackToGoBack,u.pathname);g(ya(h,L,q),{state:{pathnameStackToGoBack:e,message:"expenseAutomation",origin:"je_schedules"}})}),[g,h,L,q,u.pathname,u.state]);return{closePanel:p.closePanel,isOpen:G,maximize:N,openPanel:J,panelType:G?h:void 0,scheduleId:G?L:void 0}})(t),f=s.useRef(null),[I,k]=s.useState(null),o=s.useMemo((()=>({registerPanelDirtyGuard:m=>{f.current=m}})),[]),r=s.useCallback((m=>{f.current?.isDirty()===!0?k((()=>m)):m()}),[]),E=s.useCallback((()=>{r(n.closePanel)}),[r,n.closePanel]),l=s.useCallback((()=>{r(n.maximize)}),[r,n.maximize]),S=s.useCallback(((m,g,u)=>{r((()=>n.openPanel(m,g,u)))}),[r,n.openPanel]),R=s.useMemo((()=>{if(I!=null)return{onCancel:()=>k(null),onDiscard:()=>{f.current=null,k(null),I()}}}),[I]),x=s.useMemo((()=>{if(n.isOpen&&n.panelType!=null&&n.scheduleId!=null)return b.jsx(Fc.Provider,{value:o,children:b.jsx(bi,{panelType:n.panelType,scheduleId:n.scheduleId,onClose:E,onCloseAfterDecision:()=>{f.current=null,n.closePanel()}},`${n.panelType}:${n.scheduleId}`)})}),[n.isOpen,n.panelType,n.scheduleId,n.closePanel,E,o]);return{injectedProps:s.useMemo((()=>({closeSchedulePanel:E,isSchedulePanelOpen:n.isOpen,openSchedulePanel:S,schedulePanelContent:x,schedulePendingDiscardConfirmation:R})),[E,S,x,R,n.isOpen]),selectedItemId:n.scheduleId,sidePanel:{closePanel:E,maximize:l}}}});function Ai({companyId:t,closeCustomerRequestDrawer:n,addCustomerRequest:f,resetCustomerRequest:I}){const k=st.getSignedInUser();if(k==null)throw Error("Can't access Customer Request page without signing in...");const o=_((r=>ks(r,t,k)));return s.useEffect((()=>{I()}),[]),b.jsx(b.Fragment,{children:o.fetchState==="In-Progress"||o.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?b.jsx(Na,{fetchState:"In-Progress"}):b.jsx(_c,{onCloseClick:n,addCustomerRequest:f,snippets:o.companyMonthEndReportTemplatesData,bulletPoints:o.zeniRequestsData??[]})})}const xi={schedules:"Review Schedules",actual_matching:"Actual Matching",existing_schedules:"Existing Schedules"},wi=()=>{const t=_((R=>Me(R))),n=be(),{currentSelectedViewFetchState:f,currentSelectedView:I,selectedPeriod:k}=t,o=et(I),r=et(f.fetchState),E=t.jeSchedules.uiState.selectedPageTab??"schedules",l=et(E),S=s.useCallback((R=>{const x=n.state?.referrer;I==="transaction_categorization"&&(t.selectedTransactionCategorizationTab==="review"?X.trackTransactionsReviewPage(k.month,k.year,t.transactionView.totalCountByTab.review,0,R,x??null):X.trackTransactionsAutoCategorisedPage(k.month,k.year,t.transactionView.totalCountByTab.autoCategorized,0,R,x??null)),I==="missing_receipts"&&X.trackMissingReceiptsPage(k.month,k.year,R,t.missingReceipts.transactions.length,x??null),I==="je_schedules"&&X.trackMonthCloseScheduleListPage(k.month,k.year,R,t.jeSchedules.pendingReviewSchedules.length,t.jeSchedules.failedPostings.length,(m=>{const g={accruedCount:0,fixedAssetsCount:0,oneTimeAccrualCount:0,prepaidCount:0};return m.forEach((u=>{if(bs(u))g.oneTimeAccrualCount+=1;else switch(Ts(u)){case"prepaid_expenses":g.prepaidCount+=1;break;case"fixed_assets":g.fixedAssetsCount+=1;break;case"accrued_expenses":g.accruedCount+=1}})),g})(t.jeSchedules.pendingReviewSchedules),xi[E],x??null),I==="flux_analysis"&&X.trackFluxAnalysisPage(k.month,k.year,R,Ri(t.fluxAnalysis),x??null),I==="month_end_insights"&&t.auditSummary?.auditScorePercentage!=null&&X.trackInsightsEmailPage(k.month,k.year,R,"draft",t.auditSummary.auditScorePercentage,null,x??null)}),[k,t,E]);return s.useEffect((()=>{(r!==f.fetchState||I!==o||I==="je_schedules"&&l!=null&&E!==l)&&f.fetchState==="Completed"&&S(!1)}),[I,f.fetchState,o,E,l]),S},Ri=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Di,comma:Aa,space:Fi}},dateFormat:Qa}=Wc.getLocalizedStrings(),xa=yc,_i=Hn((function(t,n){const{uncategorizedAccounts:f,vendorSearchAutoCompleteData:I,monthEndInsightsCustomerRequestData:k,monthEndInsightsPreviewMode:o,companyId:r,isMissingReceiptsBulkUploadEnabled:E,isTransactionActivityEnabled:l,newScheduleActiveType:S}=n,R=st.getSignedInUser(),x=t.tenantState.currentTenantId,m={userId:R?.userId??"",sessionId:R?.zeniSessionId??"",tenantId:x??""},g=Me(t),{selectedTransactionCategorizationTab:u}=g,{searchTransactionsResults:F,searchTransactionsFetchState:A}=Ns(t),p=S==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",{accountListNestedAccountHierarchy:C,classListNestedAccountHierarchy:h,allDepreciationAccountListNestedAccountHierarchy:L,newScheduleLocalData:G,saveStatus:q}=qs(t,p);return{expenseAutomationViewSelector:g,accountListNestedAccountHierarchy:C,allDepreciationAccountListNestedAccountHierarchy:L,baseTransactionSearchFetchState:A,baseTransactionSearchResults:F,classListNestedAccountHierarchy:h,newScheduleLocalData:G,initialSelectedBaseTransaction:G.selectedBaseTransactionId!=null?Js(t.transactionState,Ws(G.selectedBaseTransactionId)):void 0,newAccrualAccountsView:Ys(t),newScheduleSaveStatus:q,bulkUploadSelector:E===!0?g.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:I,authParams:m,receiptUploadEndpoint:`${Ue.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ta}/transaction_attachments`,bulkUploadEndpoint:E===!0?`${Ue.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:u,selectedTransactionGroup:g.transactionView.selectedTransactionGroup,monthEndInsightsCustomerRequestData:k,monthEndInsightsPreviewMode:o,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:R,uncategorizedAccounts:f,companyId:r,isTransactionActivityEnabled:l,receiptsEmail:Ks(t.tenantState,x),downloadParams:{authParams:m,jeScheduleEndPoint:`${Ta}/jeScheduleReports`,timezone:Hs(),companyName:ke(t).companyName}}}),(function(t,n){const{themeState:f,isAccountingClassesEnabled:I,isCOTEnabled:k,isMissingReceiptsBulkUploadEnabled:o,location:r,vendorSearchAutoCompleteData:E,expenseAutomationViewSelector:l,currentTenant:S,newScheduleActiveType:R,uncategorizedAccounts:x,navigate:m,onClickCustomerRequest:g,handleEditClick:u,closeSchedulePanel:F,isSchedulePanelOpen:A,openSchedulePanel:p,setActivityLogTransactionId:C}=n,{selectedPeriod:h,currentSelectedView:L,reconciliation:{selectedAccountId:G}}=l,{accountSettingsView:q}=l.jeSchedules,T=Ua(h),J=at(T.start),N=at(T.end);return{onZeniLogoClick:()=>{f.toggle()},onUploadReceiptAttachment:e=>{X.trackMissingReceiptAttached(h.month,h.year),t(uc(e))},onUploadTransactionReceipt:(e,a,i,d,v,P)=>{t(fa(e,a,{fetchState:"In-Progress"}));const D=()=>t(fa(e,a,{fetchState:"Error"}));Kc(`${Ue.accountMicroServiceBaseUrl}/1.0/transactions/${a}/attachments`,P,a,i,d,v).then((M=>{M!=null?t(dc(e,M)):D()})).catch(D)},onMissingReceiptsRowClick:(e,a)=>{if(n.openTransactionPanel)return void n.openTransactionPanel(e,a);const i=te(r.state?.pathnameStackToGoBack,r.pathname);m(`../../transaction/${a}/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,a)=>{t(rc(e,a)),S!=null&&t(_e({tenantId:S.tenantId,period:a,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,a,i,d)=>{t(lc(e,{fetchState:a,error:i})),i!=null&&t(bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:d!=null?Fi+Di+d+Aa:Aa}]}))},onUpdateJESchedulesUIState:e=>{const a=l.jeSchedules.uiState,i=e.selectedPageTab!=null&&e.selectedPageTab!==a.selectedPageTab,d=e.selectedJETypeFilter!==void 0&&e.selectedJETypeFilter!==a.selectedJETypeFilter;i&&n.closeMatchSidePanel?.(),A===!0&&(i||d)&&F?.(),e.createdGroupCollapsed!=null?t(nc()):e.pendingGroupCollapsed!=null?t(sc()):e.failedGroupCollapsed!=null?t(oc()):e.selectedJETypeFilter!==void 0?t(cc(e.selectedJETypeFilter)):t(ic(e))},onUpdateMissingReceiptsUIState:e=>{t(ac(e))},onFetchMissingReceiptsList:()=>{N!=null&&J!=null&&t(Va({start:J,end:N},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...o===!0?{onBulkUploadFiles:e=>{t(Pc(e))},onBulkUploadProgress:e=>{t(Tc(e))},onBulkUploadSuccess:e=>{t(bc({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(kc(e))},onConfirmBulkUploadMatch:(e,a,i,d,v)=>{t(Ic(e,a,i,d,v))},onBulkUploadConfirmMatchAcknowledged:()=>{t(fc())},onSetBulkUploadResultsTab:e=>{t(Cc(e))},onSetBulkUploadCompletedSubTab:e=>{t(gc(e))},onSetBulkUploadSortConfig:(e,a)=>{t(Ia({sortKey:e,sortOrder:a}))},onClearBulkUpload:()=>{t(Sc())},onSearchTransactionsForManualMatch:(e,a)=>{t(xa(e,a??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=l.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(xa(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,a)=>{t(hc(e,a))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(pc())},onFetchBulkUploadBatches:e=>{t(Oa(e))},onFetchMoreBatchDetails:()=>{t(mc())},onResetBulkUploadSort:()=>{t(Ia({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(tc())},onSearchTextChanged:e=>{const a=l.currentSelectedView,i=l.selectedTransactionCategorizationTab;a==="transaction_categorization"&&(t(Ct({selectedTab:i,uiState:{searchString:e}})),N!=null&&J!=null&&t(pe(i,{start:J,end:N},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const a=l.selectedTransactionCategorizationTab;t(ec({filters:e,selectedTab:a}))},onRefresh:()=>{n.trackExpenseAutomationTabAnalytics(!0),t(Zo())},onClose:()=>{L==="reconciliation"&&G!=null&&t(Ca({selectedAccountId:void 0})),m("../")},onBack:()=>{L==="reconciliation"&&G!=null&&t(Ca({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Xo(e))},onSaveReconciliationReview:e=>{t(Qo(e))},onUpdateStep:e=>{const{selectedPeriod:a}=l,i=te(r.state?.pathnameStackToGoBack,r.pathname);m(`../${e}/${a.month}-${a.year}`,{state:{pathnameStackToGoBack:i,referrer:l.currentSelectedView}}),t(Ba(e))},handleLogOutClick:()=>{const e=te(r.state?.pathnameStackToGoBack,r.pathname);m("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:a}=e,{prepaidExpensesAccount:i,fixedAssetsAccount:d,accruedExpensesAccount:v}=a,P=ft(q.prepaidExpensesAccountList,i.selectedOptions),D=ft(q.fixedAssetsAccountList,d.selectedOptions),M=ft(q.accruedExpensesAccountList,v.selectedOptions),W={selectedPrepaidExpensesAccountIds:P.map((Y=>Y.accountId)),selectedFixedAssetsAccountIds:D.map((Y=>Y.accountId)),selectedAccruedExpensesAccountIds:M.map((Y=>Y.accountId))};t(Ko({data:W}))},onSaveJeAccountSettingsClick:()=>{t(Ho())},onJESchedulesFormDataChange(e,a){const{jeScheduleID:i,accumulatedDepreciationCategory:d,scheduleClass:v,scheduleExpenseCategory:P,vendor:D}=a,{allAccountList:M,allClassList:W,allDepreciationAccountList:Y}=l.jeSchedules,se=E.entityAutoCompleteView.vendor.length>0?E.entityAutoCompleteView.vendor.find((K=>K.id===D?.selectedOption)):void 0,ce={id:se?.zeniId??D?.selectedOption??"",name:se?.name??D?.defaultOptions.find((K=>K.value===D?.selectedOption))?.label??"",logo:se?.logo},Pe=P?.selectedOption!=null?M.find((K=>K.qboId===P.selectedOption)):void 0,ye=v?.selectedOption!=null?W.find((K=>K.classId===v.selectedOption)):void 0,ve=d?.selectedOption!=null?Y.find((K=>K.qboId===d.selectedOption)):void 0;t(Yo({scheduledJournalEntryID:e,localData:{jeScheduleID:i,scheduledJournalEntryID:e,updatedCategoryId:Pe?.accountId,updatedClassId:ye?.classId,updatedAccumulatedDepreciationCategoryID:ve?.accountId,updatedVendor:{id:ce.id,name:ce.name}}}))},onRevertJeSchedule(e,a,i,d,v){t(Wo(e,a,i,d,v))},ignoreRecommendedJeSchedule(e,a,i,d){t(Jo(e,a,i,d))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,a)=>{e.trim().length>=2?t(ma({searchString:e,entityType:a,searchOrigin:"common"})):e.trim().length===0&&t(Ke("common"))},onCancelAutoComplete:()=>{t(Ke("common"))}},onPostJESchedule(e,a){t(qo({scheduledJournalEntryID:e,jeScheduleTransactionKey:a}))},clearJeScheduleLocalData(){t(No())},onViewTransaction(e){if(n.tenantEmailDomain==null)return;const a=pi(e,n.tenantEmailDomain),i=te(n.location.state?.pathnameStackToGoBack,`${n.location.pathname}${n.location.search}`);n.navigate(a,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},onSearchBaseTransaction(e){t(Go({query:e,scheduleType:R==="prepaid_expenses"?"prepaid_expenses":"fixed_assets"}))},onNewScheduleFormChange(e,a){const i=yt(e)==="prepaid_expenses"?"prepaid_expenses":"fixed_assets";t(ga({scheduleType:i,localData:a}))},onOpenMatchNewModal(e){t($o(e))},onCloseMatchNewModal(){t(zo())},onClearMatchNewModal(){t(Lo())},onSearchMatchTransactions(e,a){t(jo(e,a))},onSearchMatchAccruals(e,a){t(Vo(e,a))},onMatchAndReverse(e){t(Bo(e.transactionId,e.transactionIntegrationId,e.transactionType,e.lineIds,e.transactionSyncToken,e.accrualIds))},onUpdateActualMatchingUIState(e){t(Oo(e))},onSaveSchedule(e,a){const i=e==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",{allAccountList:d,allDepreciationAccountList:v}=l.jeSchedules,P=a.selectedAccount!=null?d.find((M=>M.qboId===a.selectedAccount)):void 0,D=a.selectedAccumulatedDepreciationCategory!=null?v.find((M=>M.qboId===a.selectedAccumulatedDepreciationCategory)):void 0;t(ga({scheduleType:i,localData:{...a,selectedAccount:P?.accountId,selectedAccumulatedDepreciationCategory:D?.accountId}})),t(Uo({scheduleType:i}))},onCreateAccruedSchedule(e){const a="accrued_expenses";t(Ro()),t(Do()),t(Fo({scheduleType:a,localData:e,selectedJeScheduleDetailId:void 0})),t(_o({scheduleType:a})),t(Mo(a,void 0))},onCreateOneTimeAccrual(e){t(wo(e))},handleJeScheduleClick:(e,a,i)=>{if((function(v,P){return P!=="accrued_expenses"})(0,i)&&t(Ma({selectedJEScheduleKey:a})),p!=null&&Ka(i))return void p(e,i,a);const d=te(r.state?.pathnameStackToGoBack,r.pathname);m(`../../vendors/schedules/${i}/details/${e}`,{state:{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"je_schedules"}})},onOneTimeAccrualFeedback:(e,a,i,d)=>{t(a!=="revert"?xo(e,i,d):Ao(e,i,d))},onOneTimeAccrualClick:e=>{if(p!=null)return void p(e,"one_time_accrual");const a=te(r.state?.pathnameStackToGoBack,r.pathname);m(`../../vendors/schedules/one_time_accrual/details/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"je_schedules"}})},onOpenMatch:e=>{n.openMatchPanel?.(e)},improveMonthEndInsightsUsingZeniGPTClick:e=>{S!=null&&t(Eo(e,S.companyId,S.tenantId))},onClickCustomerRequest:g,setActivityLogTransactionId:C,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(vo())},onOpenFileAttachmentSnackBar:()=>{t(bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(yo(e))},onUpdateFileAttachment:e=>{t(Po({files:e}))},previewMonthEndReport:(e,a,i,d,v)=>{S!=null&&t(Sa(e,S.companyId,a,!0,i,d,{agentInsightEdits:v,tenantId:S.tenantId}))},saveMonthEndReport:(e,a,i,d,v)=>{S!=null&&t(Sa(e,S.companyId,a,!1,i,d,{agentInsightEdits:v,tenantId:S.tenantId}))},onEditMonthEndInsightsClick:u,sendMonthEndReport:e=>{const a=r.state?.referrer,{selectedPeriod:i,auditSummary:d}=l;S!=null&&d?.auditScorePercentage!=null&&(t(bo(S.companyId,e,S.tenantId)),X.trackInsightsEmailPage(i.month,i.year,!1,"draft",d.auditScorePercentage,To().format(Qa.analytics.MMMDDCommaYYYYformat),a??null))},onTransactionCategorizationRowClick:(e,a)=>{const i=l.transactionView.uiState.searchString??"",d=l.transactionView.transactions,v=d.findIndex((M=>M.id===e)),P=i.length>0?{resultPosition:v>=0?v+1:void 0,resultsCount:d.length,searchTerm:i}:void 0;if(n.openTransactionPanel)return void n.openTransactionPanel(e,a,P);const D=te(r.state?.pathnameStackToGoBack,r.pathname);m(`../../transaction/${a}/${e}`,{state:{pathnameStackToGoBack:D,message:"expenseAutomation",origin:"transaction_categorization",searchContext:P}})},setLocalDataForCategoryAndClass:(e,a,i,d,v,P,D,M,W,Y,se,ce)=>{t(ko(e,a,i,d,x,v,P,D,M,W,Y,se,ce))},onCancelAutoComplete:()=>{t(Ke("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(pa({scrollPosition:e}))},onUpdateTab:e=>{n.closeSidePanel?.(),N!=null&&J!=null&&(t(pe(e,{start:J,end:N},!1,!1)),t(Io(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{n.closeSidePanel?.(),N!=null&&J!=null&&(t(fo(e)),t(pe("autoCategorized",{start:J,end:N},!1,!1)))},onTransactionGroupChange:e=>{n.closeSidePanel?.(),N!=null&&J!=null&&(t(Co(e)),t(pe(n.expenseAutomationViewSelector.selectedTransactionCategorizationTab,{start:J,end:N},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,a)=>{t(Ct({selectedTab:e,uiState:a})),N!=null&&J!=null&&t(pe(e,{start:J,end:N},!1,!1,a.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,a)=>{t(Ct({selectedTab:e,uiState:a}))},onFetchTransactionCategorizationList:(e,a,i,d,v,P)=>{N!=null&&J!=null&&t(pe(e,{start:J,end:N},!0,i,a,d,v,P))},resetTransactionCategorizationLocalData:(e,a,i,d,v,P,D)=>{t(go(e,a,i,d,D??null,v,P,!1)),ai(t,a.map(String))},updateSelectedVendorForTransaction:(e,a,i,d,v)=>{t(ha({selectedTab:e,transactionId:a,lineId:i,selectedTransaction:d,uncategorizedAccounts:x,updatedVendor:v,isAccountingClassesEnabled:I}))},onSaveUpdateTransactionCategorization:(e,a,i)=>{const d=r.state?.referrer;e==="autoCategorized"?X.trackTransactionsAutoCategorisedPage(h.month,h.year,l.transactionView.totalCountByTab.autoCategorized,a.length,!1,d??null):X.trackTransactionsReviewPage(h.month,h.year,l.transactionView.totalCountByTab.review,a.length,!1,d??null),t(So(e,a,i)),ti(a.map(String))},onUpdateSelectedCheckboxTransactionIds:(e,a)=>{t(ho({selectedTab:e,transactionIds:a}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,a,i,d,v,P)=>{const{transactionId:D,transaction:M,lineIds:W}=a;P!=null&&t(mo({transactionId:D,customerUpdates:P})),t(po({selectedTab:d,transactionId:D.id,lineId:W[0],selectedTransaction:M,uncategorizedAccounts:x,updatedCustomer:P,selectedEntity:v,isAccountingClassesEnabled:I})),v!=null&&t(Pt({entity:v,amount:e,transactionDetails:a,flowType:"categorization",selectedTab:d,isFetchCOT:k}))},onFetchRecommendationsForEntityCategorization:(e,a,i,d,v,P)=>{const{transactionId:D,transaction:M,lineIds:W}=a;P!=null&&(t(lo({transactionId:D,vendorUpdates:{name:P.name,id:P.id?P.id:void 0}})),t(ro({vendorId:P.id?P.id:void 0,localData:{vendorName:P.name,vendorId:P.id?P.id:void 0}}))),P?.id?(t(ha({selectedTab:d,transactionId:D.id,lineId:W[0],selectedTransaction:M,uncategorizedAccounts:x,updatedVendor:P,selectedEntity:v,isAccountingClassesEnabled:I})),v!=null&&t(Pt({entity:v,amount:e,transactionDetails:a,flowType:"categorization",selectedTab:d,isFetchCOT:k}))):t(uo({selectedTab:d,transactionId:D.id,lineId:W[0]}))},fetchFluxViewOnScroll:(e,a)=>{t(Ze(e,!0,!1,a,!1,!0))},onFetchFluxViewList:()=>{t(Ze(h,!0,!1,null,!1,!1))},markAsReview:(e,a,i,d)=>{X.trackFluxAnalysisReviewed(i.month,i.year,d??!1,e),t(io(a,e,i,d??!1))},onUpdateFluxAnalysisUIState:e=>{t(co(e))},updateOperatingExpensesIdsForReview:e=>{t(oo({operatingExpenseIds:e,selectedPeriod:h}))},redirectToVendorDetailPage:e=>{if(n.tenantEmailDomain!=null){const a=mi(e.id,e.qboId,n.tenantEmailDomain),i=te(n.location.state?.pathnameStackToGoBack,n.location.pathname);n.navigate(a,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(so({sectionId:e,selectedPeriod:h}))},onFetchReimbursementView:(e,a,i)=>{t(Ze(e,!0,!1,a,!0,i))},onReviewClicked:e=>{t(re(h,e))},setOpenDrawerClicked:e=>{t(tt({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,a)=>{t(Da("expense_automation_reconcile",e,a))},onEstablishConnectionClick:(e,a)=>{const i=S?.companyId;i!=null&&(t(Fa(e,i,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",a)),t(_a({accountId:a,connectionInProgress:!0})))},onAddStatementClick:e=>{t(tt({selectedDrawerAccountId:e})),t(Qe({accountId:e,selectedPeriod:h,localData:{accountSource:"bank_statement"}})),t(Xe({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(re(h,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(no({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,a)=>{t(ao({sortKey:e,sortOrder:a}))},onReconReviewTabColumnSortConfigChanged:(e,a)=>{t(to({sortKey:e,sortOrder:a}))},onReconTabUpdate:e=>{n.closeSidePanel?.(),t(eo({selectedTab:e}))},updateReconReviewTabLocalData:(e,a,i)=>{const d=e.vendor?.id;i&&d!=null&&t(Xs(d)),t(Zs({data:e,transactionId:a}))},onReconMatchedTransactionClick:e=>{if(n.openTransactionPanel)return void n.openTransactionPanel(e,Tt("bill"));const a=te(r.state?.pathnameStackToGoBack,r.pathname);m(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{m(-1)},onReconListPageScroll:e=>{t(pa({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ma({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Ke("common"))},onReconNodeCollapseToggled:(e,a)=>{t(Qs({nodeId:e,collapsed:a}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(wa({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Ra({accountId:e}))}}}),((t,n,f)=>{const{isMissingReceiptsBulkUploadEnabled:I,...k}=f;return(function(o,r,E){return{...o,...r,...E,onUploadTransactionReceipt:(l,S,R,x,m)=>{r.onUploadTransactionReceipt(l,S,R,x,m,o.authParams)}}})(t,n,k)}))(Yc(Hc)),It="newScheduleMode",kt="newScheduleType",Mi=Ei(ci((function(t){const n=t.displayName??t.name??"Component",f=La.memo(t),I=k=>{const o=he(),r=(function(){const p=he(),C=_((h=>Me(h).reconciliation.selectedDrawerAccountId));return{isOpen:C!=null,selectedAccountId:C,openPanel:s.useCallback((h=>{p(tt({selectedDrawerAccountId:h}))}),[p]),closePanel:s.useCallback((()=>{p(tt({selectedDrawerAccountId:void 0}))}),[p])}})(),E=_((p=>Me(p).reconciliation)),l=_((p=>ke(p))),S=s.useCallback(((p,C)=>{o(Da("expense_automation_reconcile",p,C))}),[o]),R=s.useCallback(((p,C)=>{const h=l?.companyId;h!=null&&(o(Fa(p,h,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",C)),o(_a({accountId:C,connectionInProgress:!0})))}),[o,l?.companyId]),x=s.useMemo((()=>{if(r.isOpen&&r.selectedAccountId!=null)return b.jsx(ki,{reconciliation:E,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:R})}),[r.isOpen,r.selectedAccountId,r.closePanel,E,S,R]),m=s.useMemo((()=>({reconPanelContent:x,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel})),[x,r.isOpen,r.closePanel]),{useFeatureGate:g}=Be(),{isFeatureEnabled:u}=g(H.isReconV3Enabled),F=s.useContext(ba),A=s.useMemo((()=>r.isOpen?u===!0?{selectedItemId:r.selectedAccountId}:{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:F),[r.isOpen,r.closePanel,r.selectedAccountId,F,u]);return b.jsx(ba.Provider,{value:A,children:b.jsx(f,{...k,...m})})};return I.displayName=`withReconSidePanel(${n})`,I})(Ii((({closeMatchSidePanel:t,closeReconSidePanel:n,closeSidePanel:f,matchPanelContent:I,isMatchPanelOpen:k,openMatchPanel:o,openTransactionPanel:r,panelContent:E,reconPanelContent:l,reconSidePanelIsOpen:S,isSchedulePanelOpen:R,closeSchedulePanel:x,openSchedulePanel:m,schedulePanelContent:g,schedulePendingDiscardConfirmation:u,sidePanelIsFullView:F,sidePanelIsOpen:A})=>{const{isAiCfoOpen:p,setIsAiCfoOpen:C}=Mc(),h=Uc(),{isOpen:L}=Oc(),G=nt(),q=be(),T=he(),{isAiCfoAccessEnabled:J,onAskAiCfoClick:N}=qa({mobileExploreReferrer:"Transaction categorization"}),e=s.useCallback((()=>{k===!0&&t?.(),A===!0&&F!==!0&&f?.()}),[t,f,k,F,A]),a=_(xs);s.useEffect((()=>{a===!0&&(e(),T(ws()))}),[a,e,T]);const{areTenantIdsInSync:i}=za(),d=wi(),v=Bc(),[P,D]=s.useState(!1),[M,W]=Yn(),Y=s.useCallback((c=>{W((w=>{const $=new URLSearchParams(w);return c==null?($.delete(It),$.delete(kt),$):($.set(It,c.scheduleDetailsMode),$.set(kt,c.scheduleType),$)}),{replace:!0})}),[W]),[se,ce]=s.useState(void 0),Pe=s.useCallback(((c,w,$)=>{const j=yt(c);ce(j),Y({scheduleDetailsMode:w,scheduleType:c}),T(ra({scheduleType:j==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",shouldResetEnteredData:$}))}),[T,Y]),ye=s.useMemo((()=>{const c=M.get(It),w=M.get(kt);return c!=null&&w!=null?{scheduleDetailsMode:c,scheduleType:w}:void 0}),[M]),ve=s.useCallback((c=>{Y(c),c!=null&&T(ra({scheduleType:yt(c.scheduleType)==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",shouldResetEnteredData:!0}))}),[T,Y]),K=_((c=>la(c))),B=_((c=>ke(c))),[Ve,Ee]=s.useState(!1),[ot,Se]=s.useState(!1),[je,y]=s.useState([]),[z,Q]=s.useState(null),Z=s.useCallback((()=>{Q(null)}),[]),ge=z?.contentType==="activity"?z.detail.transactionId:void 0,ct=s.useCallback((c=>{c!=null?(p&&C(!1),h(),e(),Q({contentType:"activity",detail:{transactionId:c}})):Q((w=>w?.contentType==="activity"?null:w))}),[e,p,h,C]),Xa=s.useCallback((c=>{p&&C(!1),h(),e(),Q({contentType:"transfer",detail:c})}),[e,p,h,C]),Za=s.useCallback((()=>{h(),Z(),e(),N()}),[e,Z,N,h]),vt=s.useRef(p);s.useEffect((()=>{p===!0&&vt.current===!1&&(h(),Z(),e()),vt.current=p}),[e,Z,p,h]);const Et=s.useRef(L);s.useEffect((()=>{L===!0&&Et.current===!1&&(p&&C(!1),Z(),k===!0&&t?.(),A===!0&&F!==!0&&f?.()),Et.current=L}),[Z,t,f,L,p,k,C,F,A]);const Le=A===!0&&F!==!0||k===!0,At=s.useRef(Le);s.useEffect((()=>{Le&&!At.current&&(p&&C(!1),h(),Z()),At.current=Le}),[Z,p,Le,h,C]);const[xt,en]=s.useState(!1),wt=s.useRef(!1),{selectedTab:tn}=Oe(),{tenantEmailDomain:it}=Oe(),[lt,Rt]=s.useState(q.state?.message==="comingFromTransactionDetail"),Dt=q.state?.message==="comingFromOverview",an=Vc(),rt=st.getSignedInUser(),{useFeatureGate:oe}=Be(),{isFeatureEnabled:Ft}=oe(H.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:Ae}=oe(H.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:dt}=oe(H.isTransactionActivityEnabled),{isFeatureEnabled:_t}=oe(H.isAccrualEnabled),nn=Ga(),de=_t===!0&&nn===!0,{isFeatureEnabled:Mt}=oe(H.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:sn}=oe(H.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:on}=oe(H.isProjectsTransactionsEnabled),{isFeatureEnabled:cn}=oe(H.isReconV3Enabled),ln=s.useCallback((c=>{const w=Tt(c.transactionType??(c.view==="reconciliation"?"bill":"expense")),$=te(q.state?.pathnameStackToGoBack,q.pathname),j=new URLSearchParams({view:"full"});c.threadId!=null&&j.set("thread_id",c.threadId),c.entityType!=null&&j.set("entity_type",c.entityType),G(`/${it}/transaction/${encodeURIComponent(w)}/${c.transactionId??c.entityId}?${j.toString()}`,{state:{pathnameStackToGoBack:$,message:"expenseAutomation"}})}),[G,it,q.state,q.pathname]),rn=_((c=>Rs(c,"common"))),V=_((c=>Me(c))),{categoryOptions:dn,paymentAccountNames:un}=_((c=>Ds(c.accountState))),mn=_((c=>Fs(c.classState))),{monthEndCloseChecksView:ee,currentSelectedView:U,selectedPeriod:O,selectedTransactionCategorizationTab:ut,currentSelectedViewBackgroundRefreshFetchState:pn,currentSelectedViewFetchState:ie,jeSchedules:mt,reconciliation:Ut}=V;Qc(U==="transaction_categorization");const hn=V.transactionView.saveStatus.fetchState,ze=V.transactionView.transactions,Ot=s.useRef(ze);Ot.current=ze;const Bt=_((c=>c.expenseAutomationTransactionsViewState?.transactionCategorizationView)),Vt=_((c=>c.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab)),jt=s.useRef(Bt);jt.current=Bt;const Lt=s.useRef(Vt);Lt.current=Vt;const $e=_((c=>{const w=c.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab;return w!=null?c.expenseAutomationTransactionsViewState?.transactionCategorizationView?.[w]?.filters:void 0})),zt=s.useRef("");s.useEffect((()=>{if(U!=="transaction_categorization")return;const c=V.transactionView.uiState.searchString??"";if(ie.fetchState!=="Completed"||c.length===0||c===zt.current)return;zt.current=c;const w=$e!=null?jc($e):0,$=$e?.categories.filter((j=>j.values.length>0&&String(j.values[0]??"").trim()!=="")).map((j=>`${j.field}:${j.values.join(",")}`))??[];X.trackAiCloseTransactionSearch({filtersApplied:$,hasResults:ze.length>0,isFiltered:w>0,resultsCount:ze.length,searchTerm:c,searchType:"free_text"})}),[U,ie.fetchState,V.transactionView.uiState.searchString,V.transactionView.transactions,$e]);const le=Xc(hn,(()=>{const c=[],w=Lt.current,$=jt.current,j=$!=null&&w!=null?$[w]:void 0;if(j?.transactionReviewLocalDataById!=null)for(const fe of Object.values(j.transactionReviewLocalDataById)){const ae=fe?.transactionReviewLocalData?.lineItemById;if(ae!=null)for(const pt of Object.values(ae)){const Fe=pt?.account;Fe?.accountId!=null&&c.push(Fe.accountId)}}const Ce=Ot.current;for(const fe of Ce)for(const ae of fe.lines??[])"account"in ae&&ae.account?.accountId!=null&&c.push(ae.account.accountId);return c}));s.useEffect((()=>{U==="transaction_categorization"&&A!==!0||ct(void 0)}),[U,ct,A]),s.useEffect((()=>{S===!0&&n?.()}),[U,Ut.selectedAccountId]);const Sn=V.transactionView.selectedTransactionCategorizationCompletedSubTab,gn=V.transactionView.selectedTransactionGroup,Ge=`${ut}|${Sn}|${gn}`,Ne=s.useRef(null),$t=s.useRef(null);s.useEffect((()=>{Ne.current!==null?Ne.current!==Ge&&(Ne.current=Ge,U==="transaction_categorization"&&Z()):Ne.current=Ge}),[Z,U,Ge]);const Cn=_((c=>ge==null?void 0:_s(c.transactionState,ge))),ue=Cn?.qboId,Gt=_((c=>ue==null?void 0:Ms(c,ue)));s.useEffect((()=>{ue!=null&&T(Us(ue))}),[T,ue]);const{createTransferEntryStatus:Nt,creditCardTransferAccountsList:qt,transferAccounts:Jt}=V.transactionView,Wt=s.useCallback((c=>Zc(T,c)),[T]),Yt=s.useMemo((()=>U!=="transaction_categorization"||z==null?null:z.contentType==="activity"?dt===!0?b.jsx(Lc,{activityLogView:Gt,qboId:ue,onClose:()=>Q(null),selectedTransactionId:z.detail.transactionId,isQuickViewCardStyle:!0},String(z.detail.transactionId)):null:z.contentType==="transfer"?b.jsx(zc,{createTransferEntryStatus:Nt,creditCardTransferAccountsList:qt,transaction:z.detail,transferAccounts:Jt,onClose:()=>Q(null),onCreateTransfer:Wt,isQuickViewCardStyle:!0},String(z.detail.transactionId)):null),[U,z,dt,Gt,ue,Nt,qt,Jt,Wt]),fn=Yt!=null,{selectedAccountId:xe}=Ut,Ht=et(mt.accountSettingsView.saveState.fetchState),In=_((c=>Os(c.accountState,c.accountListState,"accountList"))),kn=_((c=>Bs(c))),we=Wa(tn)??U,bn=_((c=>c.entityAutoCompleteState.autoCompleteText.common));if($a({isDataReady:ie.fetchState==="Completed"}),rt==null)throw Error("Can't access expense automation screen without signing in...");const Kt=Ua(O),Re=at(Kt.start),De=at(Kt.end);if(Re==null||De==null)throw Error(`Invalid start - ${Re} and end - ${De} period from given ${O}`);const Tn=s.useCallback((()=>{Ee(!1)}),[]),Pn=s.useCallback((()=>{Se(!0)}),[]),yn=s.useCallback((c=>{y(c),Se(!1)}),[]),vn=s.useCallback((()=>{y([])}),[]),qe=V.missingReceipts.bulkUpload.phase,Qt=V.missingReceipts.bulkUpload.currentBatchId;s.useEffect((()=>{Ae===!0&&U==="missing_receipts"&&qe==="matching"&&Qt!=null&&T(Oa({cacheOverride:!0}))}),[Ae,U,qe,Qt,T]);const Xt=rt?.userId,En=O.month,An=O.year,Zt=B?.tenantId;s.useEffect((()=>{U==="missing_receipts"&&Ae!==!1&&qe==="idle"&&Xt!=null&&Zt!=null&&T(Vs())}),[U,Ae,qe,Xt,Zt,En,An,T]),s.useEffect((()=>{K.newVendorState?.vendorDetailLocalData?.vendorName!=null?D(!0):D(!1)}),[K.newVendorState?.vendorDetailLocalData?.vendorName]),s.useEffect((()=>{we!=null&&U!==we&&T(Ba(we))}),[we]),s.useEffect((()=>{xt===!1&&ie.fetchState==="Completed"&&i&&(en(!0),T(da(!1,!1,de)))}),[xt,ie,i,de]),s.useEffect((()=>{const c={month:O.month,year:O.year},w=$t.current;$t.current=c,w===null||w.month===c.month&&w.year===c.year||!Dt&&i&&(T(da(!1,!1,de)),T(re(O,xe,!1,!1)))}),[O.month,O.year,i,de]);const Je=s.useCallback(((c=!1,w=!1)=>{const $={start:Re,end:De};switch(U){case"transaction_categorization":T(pe(ut,$,c,!lt,void 0,void 0,w)),Rt(!1);break;case"flux_analysis":T(Ze(O,c,w,null));break;case"month_end_insights":if(w===!1){const j=new Date(O.year,O.month,0),Ce=Ls(j.toDateString()).format(Qa.analytics.YYYYDashMMDashDDFormat);T(zs(!0,B.companyId,B.tenantId,Ce)),T($s(B.companyId,B.tenantId))}break;case"je_schedules":T(js($,w,de));break;case"missing_receipts":T(Va($,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,w));break;default:T(re(O,xe,c,w))}}),[U,Re,De,B.companyId,B.tenantId,ut,O,xe,lt,Rt,de]),xn=s.useCallback((()=>{Je(!0,!0)}),[Je]);s.useEffect((()=>{U===we&&ie.fetchState==="Not-Started"&&i&&Je(!0)}),[ie,Re,De,B.companyId,B.tenantId,i]),s.useEffect((()=>{Dt||lt||wt.current||pn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(wt.current=!0,Je(!0,!0))}),[]),s.useEffect((()=>{ee.fetchState!=="In-Progress"&&ee.fetchState!=="Completed"&&ee.fetchState!=="Error"&&B?.tenantId!=null&&T(_e({tenantId:B.tenantId,period:O,refreshViewInBackground:!1}))}),[ee.fetchState,B?.tenantId]),s.useEffect((()=>{ee.fetchState!=="Completed"||!i||(ee.monthEndCloseChecks?.monthEndCloseCheckList.some((c=>c.id==="reconciliation"))??!1)&&V.reconciliation.fetchStatus.fetchState==="Not-Started"&&T(re(O,void 0,!1,!1))}),[ee.fetchState,i,O.month,O.year,V.reconciliation.fetchStatus.fetchState,T]),s.useEffect((()=>{V.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?Ee(!0):Ee(!1)}),[V.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),s.useEffect((()=>{V.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&i&&(T(_e({tenantId:B.tenantId,period:O,refreshViewInBackground:!0})),T(Gs({companyId:B.companyId})),G("../"))}),[V.monthEndInsights?.sendMonthEndReportStatus?.fetchState,B.tenantId,O,B.companyId,i]),s.useEffect((()=>{const c=setInterval((()=>{ee.fetchState!=="In-Progress"&&ee.fetchState==="Completed"&&T(_e({tenantId:B.tenantId,period:O,refreshViewInBackground:!0}))}),3e5);return()=>clearInterval(c)}),[ee.fetchState,B.tenantId,O,T]),s.useEffect((()=>{const c=setInterval((()=>{U==="reconciliation"&&xe==null&&V.reconciliation.fetchStatus.fetchState==="Completed"&&V.reconciliation.refreshStatus.fetchState!=="In-Progress"&&T(re(O,void 0,!0,!0))}),3e5);return()=>clearInterval(c)}),[U,T,V.reconciliation.fetchStatus.fetchState,V.reconciliation.refreshStatus.fetchState,re,xe,O]);const wn=Pa(),{isFeatureEnabled:Rn}=oe(H.isRecommendationFeedbackEnabled),ea=$c(),{onRecommendationSelection:ta,popup:Dn}=ei({isEnabled:Rn}),Fn=s.useMemo((()=>({...ea,onRecommendationSelection:ta})),[ea,ta]);s.useEffect((()=>{const c=(ee.monthEndCloseChecks?.monthEndCloseCheckList.find((w=>w.id==="month_end_insights"))?.isDisabled??!1)&&!Ft;U!=="month_end_insights"||!c&&ee.monthEndCloseChecks?.reportEmailSentDate==null||G("../")}),[U,ee.monthEndCloseChecks]);const _n=S===!0?l:E,Mn=S===!0||A===!0,Un=S===!0?n:f,On=S!==!0&&F;s.useEffect((()=>{Ht==="In-Progress"&&mt.accountSettingsView.saveState.fetchState==="Completed"&&T(ua())}),[Ht,mt.accountSettingsView.saveState.fetchState,ua]);const{transactionId:aa,onSaveVendor:Bn,onSaveSuccess:Vn,onCancel:jn,vendorViewDetails:Ln}=(({expenseAutomationViewSelector:c,closeDrawerHandler:w,currentSelectedView:$})=>{const j=he();let Ce,fe,ae;const pt=Pa(),Fe=c.transactionView;let na=()=>{};const{transactions:zn,selectedTransactionId:Ie,selectedTransactionLineId:We,transactionLocalData:$n}=Fe;if($==="transaction_categorization"){const ht=$n.find((me=>me.transactionId===Ie)),ne=zn.find((me=>me.id===Ie)),sa=We!=null?ht?.transactionReviewLocalData?.lineItemById[We]:void 0,oa=sa?.account;fe=sa?.class?.classId,Ce=["Uncategorized Income","Uncategorized Expense"].includes(oa?.accountName??"")?void 0:oa?.accountId;const Nn=ui(Ie,ne?.typeOfTransaction);ne!=null&&Nn&&(ae={id:Ie,type:Tt(ne.typeOfTransaction)}),na=()=>{if(Ie!=null&&We!=null&&ne!=null){const me=Fe.transactionLocalData.find((Ye=>Ye.transactionId===Ie))?.transactionReviewLocalData;if(me!=null&&ne.lines!=null&&ne.lines.length>0){const Ye=me.lineItemById[We];let St=me.selectedEntity;if(As(ne)||(St=Ye.selectedEntityLine),St!=null){const qn=St,Jn={transactionId:{id:ne.id,type:ne.type},transaction:ne,lineIds:ne.lines.map((Wn=>Wn.id))??[]};j(Pt({entity:qn,amount:Ye.amount.amount,transactionDetails:Jn,flowType:"categorization",selectedTab:c.selectedTransactionCategorizationTab,isFetchCOT:pt}))}}}}}const Gn=_((ht=>la(ht,void 0,Ce,fe)));return{transactionId:ae,onSaveVendor:()=>{j(Es(ae,void 0,!1,!0))},onSaveSuccess:na,onCancel:()=>{ae!=null&&j(Ps({transactionId:ae})),j(ys()),j(vs()),w()},vendorViewDetails:Gn}})({expenseAutomationViewSelector:V,closeDrawerHandler:()=>{D(!1)},currentSelectedView:U});return an?.loggedInUserRoleMap==null?ee.fetchState==="Error"?b.jsx(Gc,{onGoHome:()=>G("../",{replace:!0}),onReload:()=>window.location.reload()}):b.jsx(Na,{fetchState:"In-Progress"}):b.jsxs(b.Fragment,{children:[b.jsx(hi,{isOpen:ot,drawerLeftMargin:new Nc(0,0,300,650),onClose:()=>{Se(!1)},children:b.jsx(Ui,{onClick:c=>c.stopPropagation(),children:b.jsx(Ai,{companyId:B.companyId,closeCustomerRequestDrawer:()=>Se(!1),addCustomerRequest:yn,resetCustomerRequest:vn})})}),aa!=null&&P&&b.jsx(ni,{isOpen:P,transactionId:aa,onSaveVendor:Bn,onSaveSuccess:Vn,onCancel:jn,vendorViewDetails:Ln}),b.jsx(qc,{toolkit:Fn,children:b.jsx(_i,{events:[],eventCallback:(c,w,$)=>{},navigate:G,location:q,themeState:v,categoryOptions:dn,classesForFilters:mn,accountsForFilters:un,vendorSearchAutoCompleteData:{autoCompleteText:bn,entityAutoCompleteView:rn},expenseAutomationViewSelector:V,isMissingReceiptsBulkUploadEnabled:Ae,monthEndInsightsPreviewMode:Ve,monthEndInsightsCustomerRequestData:je,isRealtimeInsightsFeatureEnabled:Ft,isCreateTransferEntryFromExpenseEnabled:Mt,isAccountingClassesEnabled:kn,isProjectsTransactionsEnabled:on,isCOTEnabled:wn,currentTenant:B,companyId:B.companyId,signedInUser:rt,isTransactionActivityEnabled:dt,isRightPanelOpen:fn,rightSidePanel:Yt,onOpenTransferRightPanel:Mt===!0?Xa:void 0,uncategorizedAccounts:In,newScheduleActiveType:se,isAccrualEnabled:_t,isActualMatchingEnabled:de,newScheduleSelection:ye,onNewScheduleSelectionChange:ve,onScheduleTypeChange:Pe,onNewScheduleSaved:xn,onClickCustomerRequest:Pn,handleEditClick:Tn,tenantEmailDomain:it,trackExpenseAutomationTabAnalytics:d,setActivityLogTransactionId:ct,closeMatchSidePanel:t,closeSidePanel:Un,openTransactionPanel:r,closeSchedulePanel:x,openSchedulePanel:m,openMatchPanel:o,sidePanelIsOpen:Mn,sidePanelIsFullView:On,panelContent:_n,isAiCfoAccessEnabled:J,onAskAiCfoClick:Za,isExpenseAutomationCommentingEnabled:sn,isReconV3Enabled:cn,onExpenseAutomationCommentingThreadClick:ln,sidePanelListPercent:S===!0?66:void 0,isMatchPanelOpen:k,isSchedulePanelOpen:R,matchPanelContent:I,schedulePanelContent:g,schedulePendingDiscardConfirmation:u})}),Dn,le.showPopup&&le.popupType!=null&&b.jsx(Jc,{popupType:le.popupType,currencySymbol:le.currencySymbol,accountId:le.popupAccountId??"",accountName:le.popupAccountName??"",onSubmit:le.handleSubmit,onDismiss:le.handleDismiss})]})}))))),Ui=Te(vc)`
|
|
34
|
+
`,vi=/^schedule\/(prepaid_expenses|fixed_assets|accrued_expenses|one_time_accrual)\/([^/?]+)$/,Ei=Ha({displayNamePrefix:"withScheduleSidePanel",usePanelSetup:function(t){const n=(function(m=!0){const g=nt(),u=be(),F=he(),A=Oe(),p=Ya({childPathPattern:vi,enabled:m}),C=p.matchGroups[0],h=Ka(C)?C:void 0,L=p.matchGroups[1]!=null&&p.matchGroups[1]!==""?p.matchGroups[1]:void 0,G=p.isOpen&&h!=null&&L!=null,q=A.tenantEmailDomain??u.pathname.split("/").find(Boolean)??"",T=s.useRef({isOpen:G,scheduleId:L});T.current={isOpen:G,scheduleId:L};const J=s.useCallback(((e,a,i)=>{i!=null&&(a==="prepaid_expenses"||a==="fixed_assets")&&F(Ma({selectedJEScheduleKey:i})),!p.isMobile&&m?T.current.isOpen&&T.current.scheduleId===e?p.closePanel():p.navigateToChild(`schedule/${a}/${e}`,{replace:T.current.isOpen}):g(ya(a,e,q),{state:{message:"expenseAutomation",origin:"je_schedules"}})}),[F,g,p.isMobile,p.navigateToChild,p.closePanel,m,q]),N=s.useCallback((()=>{if(h==null||L==null)return;const e=te(u.state?.pathnameStackToGoBack,u.pathname);g(ya(h,L,q),{state:{pathnameStackToGoBack:e,message:"expenseAutomation",origin:"je_schedules"}})}),[g,h,L,q,u.pathname,u.state]);return{closePanel:p.closePanel,isOpen:G,maximize:N,openPanel:J,panelType:G?h:void 0,scheduleId:G?L:void 0}})(t),f=s.useRef(null),[I,k]=s.useState(null),o=s.useMemo((()=>({registerPanelDirtyGuard:m=>{f.current=m}})),[]),r=s.useCallback((m=>{f.current?.isDirty()===!0?k((()=>m)):m()}),[]),E=s.useCallback((()=>{r(n.closePanel)}),[r,n.closePanel]),l=s.useCallback((()=>{r(n.maximize)}),[r,n.maximize]),S=s.useCallback(((m,g,u)=>{r((()=>n.openPanel(m,g,u)))}),[r,n.openPanel]),R=s.useMemo((()=>{if(I!=null)return{onCancel:()=>k(null),onDiscard:()=>{f.current=null,k(null),I()}}}),[I]),x=s.useMemo((()=>{if(n.isOpen&&n.panelType!=null&&n.scheduleId!=null)return b.jsx(Fc.Provider,{value:o,children:b.jsx(bi,{panelType:n.panelType,scheduleId:n.scheduleId,onClose:E,onCloseAfterDecision:()=>{f.current=null,n.closePanel()}},`${n.panelType}:${n.scheduleId}`)})}),[n.isOpen,n.panelType,n.scheduleId,n.closePanel,E,o]);return{injectedProps:s.useMemo((()=>({closeSchedulePanel:E,isSchedulePanelOpen:n.isOpen,openSchedulePanel:S,schedulePanelContent:x,schedulePendingDiscardConfirmation:R})),[E,S,x,R,n.isOpen]),selectedItemId:n.scheduleId,sidePanel:{closePanel:E,maximize:l}}}});function Ai({companyId:t,closeCustomerRequestDrawer:n,addCustomerRequest:f,resetCustomerRequest:I}){const k=st.getSignedInUser();if(k==null)throw Error("Can't access Customer Request page without signing in...");const o=_((r=>ks(r,t,k)));return s.useEffect((()=>{I()}),[]),b.jsx(b.Fragment,{children:o.fetchState==="In-Progress"||o.companyMonthEndReportTemplatesData.fetchState==="In-Progress"?b.jsx(Na,{fetchState:"In-Progress"}):b.jsx(_c,{onCloseClick:n,addCustomerRequest:f,snippets:o.companyMonthEndReportTemplatesData,bulletPoints:o.zeniRequestsData??[]})})}const xi={schedules:"Review Schedules",actual_matching:"Actual Matching",existing_schedules:"Existing Schedules"},wi=()=>{const t=_((R=>Me(R))),n=be(),{currentSelectedViewFetchState:f,currentSelectedView:I,selectedPeriod:k}=t,o=et(I),r=et(f.fetchState),E=t.jeSchedules.uiState.selectedPageTab??"schedules",l=et(E),S=s.useCallback((R=>{const x=n.state?.referrer;I==="transaction_categorization"&&(t.selectedTransactionCategorizationTab==="review"?Q.trackTransactionsReviewPage(k.month,k.year,t.transactionView.totalCountByTab.review,0,R,x??null):Q.trackTransactionsAutoCategorisedPage(k.month,k.year,t.transactionView.totalCountByTab.autoCategorized,0,R,x??null)),I==="missing_receipts"&&Q.trackMissingReceiptsPage(k.month,k.year,R,t.missingReceipts.transactions.length,x??null),I==="je_schedules"&&Q.trackMonthCloseScheduleListPage(k.month,k.year,R,t.jeSchedules.pendingReviewSchedules.length,t.jeSchedules.failedPostings.length,(m=>{const g={accruedCount:0,fixedAssetsCount:0,oneTimeAccrualCount:0,prepaidCount:0};return m.forEach((u=>{if(bs(u))g.oneTimeAccrualCount+=1;else switch(Ts(u)){case"prepaid_expenses":g.prepaidCount+=1;break;case"fixed_assets":g.fixedAssetsCount+=1;break;case"accrued_expenses":g.accruedCount+=1}})),g})(t.jeSchedules.pendingReviewSchedules),xi[E],x??null),I==="flux_analysis"&&Q.trackFluxAnalysisPage(k.month,k.year,R,Ri(t.fluxAnalysis),x??null),I==="month_end_insights"&&t.auditSummary?.auditScorePercentage!=null&&Q.trackInsightsEmailPage(k.month,k.year,R,"draft",t.auditSummary.auditScorePercentage,null,x??null)}),[k,t,E]);return s.useEffect((()=>{(r!==f.fetchState||I!==o||I==="je_schedules"&&l!=null&&E!==l)&&f.fetchState==="Completed"&&S(!1)}),[I,f.fetchState,o,E,l]),S},Ri=t=>t.sections.generalExpense.vendors.length+t.sections.reimbursement.vendors.length,{common:{strings:{hyphen:Di,comma:Aa,space:Fi}},dateFormat:Xa}=Wc.getLocalizedStrings(),xa=yc,_i=Hn((function(t,n){const{uncategorizedAccounts:f,vendorSearchAutoCompleteData:I,monthEndInsightsCustomerRequestData:k,monthEndInsightsPreviewMode:o,companyId:r,isMissingReceiptsBulkUploadEnabled:E,isTransactionActivityEnabled:l,newScheduleActiveType:S}=n,R=st.getSignedInUser(),x=t.tenantState.currentTenantId,m={userId:R?.userId??"",sessionId:R?.zeniSessionId??"",tenantId:x??""},g=Me(t),{selectedTransactionCategorizationTab:u}=g,{searchTransactionsResults:F,searchTransactionsFetchState:A}=Ns(t),p=S==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",{accountListNestedAccountHierarchy:C,classListNestedAccountHierarchy:h,allDepreciationAccountListNestedAccountHierarchy:L,newScheduleLocalData:G,saveStatus:q}=qs(t,p);return{expenseAutomationViewSelector:g,accountListNestedAccountHierarchy:C,allDepreciationAccountListNestedAccountHierarchy:L,baseTransactionSearchFetchState:A,baseTransactionSearchResults:F,classListNestedAccountHierarchy:h,newScheduleLocalData:G,initialSelectedBaseTransaction:G.selectedBaseTransactionId!=null?Js(t.transactionState,Ws(G.selectedBaseTransactionId)):void 0,newAccrualAccountsView:Ys(t),newScheduleSaveStatus:q,bulkUploadSelector:E===!0?g.missingReceipts.bulkUpload:void 0,vendorSearchAutoCompleteData:I,authParams:m,receiptUploadEndpoint:`${Ue.accountMicroServiceBaseUrl}`,transactionAttachmentsEndpoint:`${Ta}/transaction_attachments`,bulkUploadEndpoint:E===!0?`${Ue.communicationAgentMicroServiceBaseUrl}/1.0/receipts/bulk-upload`:void 0,isDisabled:!1,currentTab:u,selectedTransactionGroup:g.transactionView.selectedTransactionGroup,monthEndInsightsCustomerRequestData:k,monthEndInsightsPreviewMode:o,allThreadsSectionOpen:!1,enableMonthEndInsightsZeniGPTFeature:!1,loggedInUser:R,uncategorizedAccounts:f,companyId:r,isTransactionActivityEnabled:l,receiptsEmail:Ks(t.tenantState,x),downloadParams:{authParams:m,jeScheduleEndPoint:`${Ta}/jeScheduleReports`,timezone:Hs(),companyName:ke(t).companyName}}}),(function(t,n){const{themeState:f,isAccountingClassesEnabled:I,isCOTEnabled:k,isMissingReceiptsBulkUploadEnabled:o,location:r,vendorSearchAutoCompleteData:E,expenseAutomationViewSelector:l,currentTenant:S,newScheduleActiveType:R,uncategorizedAccounts:x,navigate:m,onClickCustomerRequest:g,handleEditClick:u,closeSchedulePanel:F,isSchedulePanelOpen:A,openSchedulePanel:p,setActivityLogTransactionId:C}=n,{selectedPeriod:h,currentSelectedView:L,reconciliation:{selectedAccountId:G}}=l,{accountSettingsView:q}=l.jeSchedules,T=Ua(h),J=at(T.start),N=at(T.end);return{onZeniLogoClick:()=>{f.toggle()},onUploadReceiptAttachment:e=>{Q.trackMissingReceiptAttached(h.month,h.year),t(uc(e))},onUploadTransactionReceipt:(e,a,i,d,v,P)=>{t(fa(e,a,{fetchState:"In-Progress"}));const D=()=>t(fa(e,a,{fetchState:"Error"}));Kc(`${Ue.accountMicroServiceBaseUrl}/1.0/transactions/${a}/attachments`,P,a,i,d,v).then((M=>{M!=null?t(dc(e,M)):D()})).catch(D)},onMissingReceiptsRowClick:(e,a)=>{if(n.openTransactionPanel)return void n.openTransactionPanel(e,a);const i=te(r.state?.pathnameStackToGoBack,r.pathname);m(`../../transaction/${a}/${e}`,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"missing_receipts"}})},onUploadReceiptComplete:(e,a)=>{t(rc(e,a)),S!=null&&t(_e({tenantId:S.tenantId,period:a,refreshViewInBackground:!0}))},onUploadReceiptFetchStatus:(e,a,i,d)=>{t(lc(e,{fetchState:a,error:i})),i!=null&&t(bt({messageSection:"missing_receipts_attachment",messageText:"failed",type:"error",showStatusIcon:!0,variables:[{variableName:"__message__",variableValue:d!=null?Fi+Di+d+Aa:Aa}]}))},onUpdateJESchedulesUIState:e=>{const a=l.jeSchedules.uiState,i=e.selectedPageTab!=null&&e.selectedPageTab!==a.selectedPageTab,d=e.selectedJETypeFilter!==void 0&&e.selectedJETypeFilter!==a.selectedJETypeFilter;i&&n.closeMatchSidePanel?.(),A===!0&&(i||d)&&F?.(),e.createdGroupCollapsed!=null?t(nc()):e.pendingGroupCollapsed!=null?t(sc()):e.failedGroupCollapsed!=null?t(oc()):e.selectedJETypeFilter!==void 0?t(cc(e.selectedJETypeFilter)):t(ic(e))},onUpdateMissingReceiptsUIState:e=>{t(ac(e))},onFetchMissingReceiptsList:()=>{N!=null&&J!=null&&t(Va({start:J,end:N},{amount:75,currencyCode:"USD",currencySymbol:"$"},!0,!1))},...o===!0?{onBulkUploadFiles:e=>{t(Pc(e))},onBulkUploadProgress:e=>{t(Tc(e))},onBulkUploadSuccess:e=>{t(bc({batchId:e}))},onBulkUploadUploadedFileCount:e=>{t(kc(e))},onConfirmBulkUploadMatch:(e,a,i,d,v)=>{t(Ic(e,a,i,d,v))},onBulkUploadConfirmMatchAcknowledged:()=>{t(fc())},onSetBulkUploadResultsTab:e=>{t(Cc(e))},onSetBulkUploadCompletedSubTab:e=>{t(gc(e))},onSetBulkUploadSortConfig:(e,a)=>{t(Ia({sortKey:e,sortOrder:a}))},onClearBulkUpload:()=>{t(Sc())},onSearchTransactionsForManualMatch:(e,a)=>{t(xa(e,a??void 0))},onLoadMoreManualSearch:()=>{const{manualSearch:e}=l.missingReceipts.bulkUpload;e.nextPageToken!=null&&e.searchQuery!==""&&t(xa(e.searchQuery,e.nextPageToken))},onFetchCompletedTransactions:(e,a)=>{t(hc(e,a))},onClearBulkUploadBatchDetailsForScopeChange:()=>{t(pc())},onFetchBulkUploadBatches:e=>{t(Oa(e))},onFetchMoreBatchDetails:()=>{t(mc())},onResetBulkUploadSort:()=>{t(Ia({sortKey:void 0,sortOrder:void 0}))}}:{},onClearMissingReceiptsTabNavigation:()=>{t(tc())},onSearchTextChanged:e=>{const a=l.currentSelectedView,i=l.selectedTransactionCategorizationTab;a==="transaction_categorization"&&(t(Ct({selectedTab:i,uiState:{searchString:e}})),N!=null&&J!=null&&t(pe(i,{start:J,end:N},!0,!1,e,void 0,!1,!0)))},onFiltersChange:e=>{const a=l.selectedTransactionCategorizationTab;t(ec({filters:e,selectedTab:a}))},onRefresh:()=>{n.trackExpenseAutomationTabAnalytics(!0),t(Zo())},onClose:()=>{L==="reconciliation"&&G!=null&&t(Ca({selectedAccountId:void 0})),m("../")},onBack:()=>{L==="reconciliation"&&G!=null&&t(Ca({selectedAccountId:void 0}))},onSaveReconciliation:e=>{t(Qo(e))},onSaveReconciliationReview:e=>{t(Xo(e))},onUpdateStep:e=>{const{selectedPeriod:a}=l,i=te(r.state?.pathnameStackToGoBack,r.pathname);m(`../${e}/${a.month}-${a.year}`,{state:{pathnameStackToGoBack:i,referrer:l.currentSelectedView}}),t(Ba(e))},handleLogOutClick:()=>{const e=te(r.state?.pathnameStackToGoBack,r.pathname);m("/signout",{replace:!0,state:{pathnameStackToGoBack:e,message:"logout"}})},onJeAccountSettingsChange:e=>{const{vendorsAccountSection:a}=e,{prepaidExpensesAccount:i,fixedAssetsAccount:d,accruedExpensesAccount:v}=a,P=ft(q.prepaidExpensesAccountList,i.selectedOptions),D=ft(q.fixedAssetsAccountList,d.selectedOptions),M=ft(q.accruedExpensesAccountList,v.selectedOptions),W={selectedPrepaidExpensesAccountIds:P.map((Y=>Y.accountId)),selectedFixedAssetsAccountIds:D.map((Y=>Y.accountId)),selectedAccruedExpensesAccountIds:M.map((Y=>Y.accountId))};t(Ko({data:W}))},onSaveJeAccountSettingsClick:()=>{t(Ho())},onJESchedulesFormDataChange(e,a){const{jeScheduleID:i,accumulatedDepreciationCategory:d,scheduleClass:v,scheduleExpenseCategory:P,vendor:D}=a,{allAccountList:M,allClassList:W,allDepreciationAccountList:Y}=l.jeSchedules,se=E.entityAutoCompleteView.vendor.length>0?E.entityAutoCompleteView.vendor.find((K=>K.id===D?.selectedOption)):void 0,ce={id:se?.zeniId??D?.selectedOption??"",name:se?.name??D?.defaultOptions.find((K=>K.value===D?.selectedOption))?.label??"",logo:se?.logo},Pe=P?.selectedOption!=null?M.find((K=>K.qboId===P.selectedOption)):void 0,ye=v?.selectedOption!=null?W.find((K=>K.classId===v.selectedOption)):void 0,ve=d?.selectedOption!=null?Y.find((K=>K.qboId===d.selectedOption)):void 0;t(Yo({scheduledJournalEntryID:e,localData:{jeScheduleID:i,scheduledJournalEntryID:e,updatedCategoryId:Pe?.accountId,updatedClassId:ye?.classId,updatedAccumulatedDepreciationCategoryID:ve?.accountId,updatedVendor:{id:ce.id,name:ce.name}}}))},onRevertJeSchedule(e,a,i,d,v){t(Wo(e,a,i,d,v))},ignoreRecommendedJeSchedule(e,a,i,d){t(Jo(e,a,i,d))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(e,a)=>{e.trim().length>=2?t(ma({searchString:e,entityType:a,searchOrigin:"common"})):e.trim().length===0&&t(Ke("common"))},onCancelAutoComplete:()=>{t(Ke("common"))}},onPostJESchedule(e,a){t(qo({scheduledJournalEntryID:e,jeScheduleTransactionKey:a}))},clearJeScheduleLocalData(){t(No())},onViewTransaction(e){if(n.tenantEmailDomain==null)return;const a=pi(e,n.tenantEmailDomain),i=te(n.location.state?.pathnameStackToGoBack,`${n.location.pathname}${n.location.search}`);n.navigate(a,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",origin:"je_schedules"}})},onSearchBaseTransaction(e){t(Go({query:e,scheduleType:R==="prepaid_expenses"?"prepaid_expenses":"fixed_assets"}))},onNewScheduleFormChange(e,a){const i=yt(e)==="prepaid_expenses"?"prepaid_expenses":"fixed_assets";t(ga({scheduleType:i,localData:a}))},onOpenMatchNewModal(e){t($o(e))},onCloseMatchNewModal(){t(zo())},onClearMatchNewModal(){t(Lo())},onSearchMatchTransactions(e,a){t(jo(e,a))},onSearchMatchAccruals(e,a){t(Vo(e,a))},onMatchAndReverse(e){t(Bo(e.transactionId,e.transactionIntegrationId,e.transactionType,e.lineIds,e.transactionSyncToken,e.accrualIds))},onUpdateActualMatchingUIState(e){t(Oo(e))},onSaveSchedule(e,a){const i=e==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",{allAccountList:d,allDepreciationAccountList:v}=l.jeSchedules,P=a.selectedAccount!=null?d.find((M=>M.qboId===a.selectedAccount)):void 0,D=a.selectedAccumulatedDepreciationCategory!=null?v.find((M=>M.qboId===a.selectedAccumulatedDepreciationCategory)):void 0;t(ga({scheduleType:i,localData:{...a,selectedAccount:P?.accountId,selectedAccumulatedDepreciationCategory:D?.accountId}})),t(Uo({scheduleType:i}))},onCreateAccruedSchedule(e){const a="accrued_expenses";t(Ro()),t(Do()),t(Fo({scheduleType:a,localData:e,selectedJeScheduleDetailId:void 0})),t(_o({scheduleType:a})),t(Mo(a,void 0))},onCreateOneTimeAccrual(e){t(wo(e))},handleJeScheduleClick:(e,a,i)=>{if((function(v,P){return P!=="accrued_expenses"})(0,i)&&t(Ma({selectedJEScheduleKey:a})),p!=null&&Ka(i))return void p(e,i,a);const d=te(r.state?.pathnameStackToGoBack,r.pathname);m(`../../vendors/schedules/${i}/details/${e}`,{state:{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"je_schedules"}})},onOneTimeAccrualFeedback:(e,a,i,d)=>{t(a!=="revert"?xo(e,i,d):Ao(e,i,d))},onOneTimeAccrualClick:e=>{if(p!=null)return void p(e,"one_time_accrual");const a=te(r.state?.pathnameStackToGoBack,r.pathname);m(`../../vendors/schedules/one_time_accrual/details/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"je_schedules"}})},onOpenMatch:e=>{n.openMatchPanel?.(e)},improveMonthEndInsightsUsingZeniGPTClick:e=>{S!=null&&t(Eo(e,S.companyId,S.tenantId))},onClickCustomerRequest:g,setActivityLogTransactionId:C,onCloseAllThreadsSection:()=>{},onCloseFileAttachmentSnackBar:()=>{t(vo())},onOpenFileAttachmentSnackBar:()=>{t(bt({messageSection:"cockpit_month_end_email_attachment_upload",messageText:"failed",type:"error",showStatusIcon:!0}))},onRemoveFileAttachment:e=>{t(yo(e))},onUpdateFileAttachment:e=>{t(Po({files:e}))},previewMonthEndReport:(e,a,i,d,v)=>{S!=null&&t(Sa(e,S.companyId,a,!0,i,d,{agentInsightEdits:v,tenantId:S.tenantId}))},saveMonthEndReport:(e,a,i,d,v)=>{S!=null&&t(Sa(e,S.companyId,a,!1,i,d,{agentInsightEdits:v,tenantId:S.tenantId}))},onEditMonthEndInsightsClick:u,sendMonthEndReport:e=>{const a=r.state?.referrer,{selectedPeriod:i,auditSummary:d}=l;S!=null&&d?.auditScorePercentage!=null&&(t(bo(S.companyId,e,S.tenantId)),Q.trackInsightsEmailPage(i.month,i.year,!1,"draft",d.auditScorePercentage,To().format(Xa.analytics.MMMDDCommaYYYYformat),a??null))},onTransactionCategorizationRowClick:(e,a)=>{const i=l.transactionView.uiState.searchString??"",d=l.transactionView.transactions,v=d.findIndex((M=>M.id===e)),P=i.length>0?{resultPosition:v>=0?v+1:void 0,resultsCount:d.length,searchTerm:i}:void 0;if(n.openTransactionPanel)return void n.openTransactionPanel(e,a,P);const D=te(r.state?.pathnameStackToGoBack,r.pathname);m(`../../transaction/${a}/${e}`,{state:{pathnameStackToGoBack:D,message:"expenseAutomation",origin:"transaction_categorization",searchContext:P}})},setLocalDataForCategoryAndClass:(e,a,i,d,v,P,D,M,W,Y,se,ce)=>{t(ko(e,a,i,d,x,v,P,D,M,W,Y,se,ce))},onCancelAutoComplete:()=>{t(Ke("common"))},updateExpenseAutomationReconListScrollPosition:e=>{t(pa({scrollPosition:e}))},onUpdateTab:e=>{n.closeSidePanel?.(),N!=null&&J!=null&&(t(pe(e,{start:J,end:N},!1,!1)),t(Io(e)))},onUpdateTransactionCategorizationCompletedSubTab:e=>{n.closeSidePanel?.(),N!=null&&J!=null&&(t(fo(e)),t(pe("autoCategorized",{start:J,end:N},!1,!1)))},onTransactionGroupChange:e=>{n.closeSidePanel?.(),N!=null&&J!=null&&(t(Co(e)),t(pe(n.expenseAutomationViewSelector.selectedTransactionCategorizationTab,{start:J,end:N},!1,!1)))},onUpdateTransactionCategorizationUIState:(e,a)=>{t(Ct({selectedTab:e,uiState:a})),N!=null&&J!=null&&t(pe(e,{start:J,end:N},!1,!1,a.searchString,null,!0))},onUpdateScrollYOffSetTransactionCategorizationUIState:(e,a)=>{t(Ct({selectedTab:e,uiState:a}))},onFetchTransactionCategorizationList:(e,a,i,d,v,P)=>{N!=null&&J!=null&&t(pe(e,{start:J,end:N},!0,i,a,d,v,P))},resetTransactionCategorizationLocalData:(e,a,i,d,v,P,D)=>{t(go(e,a,i,d,D??null,v,P,!1)),ai(t,a.map(String))},updateSelectedVendorForTransaction:(e,a,i,d,v)=>{t(ha({selectedTab:e,transactionId:a,lineId:i,selectedTransaction:d,uncategorizedAccounts:x,updatedVendor:v,isAccountingClassesEnabled:I}))},onSaveUpdateTransactionCategorization:(e,a,i)=>{const d=r.state?.referrer;e==="autoCategorized"?Q.trackTransactionsAutoCategorisedPage(h.month,h.year,l.transactionView.totalCountByTab.autoCategorized,a.length,!1,d??null):Q.trackTransactionsReviewPage(h.month,h.year,l.transactionView.totalCountByTab.review,a.length,!1,d??null),t(So(e,a,i)),ti(a.map(String))},onUpdateSelectedCheckboxTransactionIds:(e,a)=>{t(ho({selectedTab:e,transactionIds:a}))},onFetchRecommendationsForEntityCategorizationWithCustomer:(e,a,i,d,v,P)=>{const{transactionId:D,transaction:M,lineIds:W}=a;P!=null&&t(mo({transactionId:D,customerUpdates:P})),t(po({selectedTab:d,transactionId:D.id,lineId:W[0],selectedTransaction:M,uncategorizedAccounts:x,updatedCustomer:P,selectedEntity:v,isAccountingClassesEnabled:I})),v!=null&&t(Pt({entity:v,amount:e,transactionDetails:a,flowType:"categorization",selectedTab:d,isFetchCOT:k}))},onFetchRecommendationsForEntityCategorization:(e,a,i,d,v,P)=>{const{transactionId:D,transaction:M,lineIds:W}=a;P!=null&&(t(lo({transactionId:D,vendorUpdates:{name:P.name,id:P.id?P.id:void 0}})),t(ro({vendorId:P.id?P.id:void 0,localData:{vendorName:P.name,vendorId:P.id?P.id:void 0}}))),P?.id?(t(ha({selectedTab:d,transactionId:D.id,lineId:W[0],selectedTransaction:M,uncategorizedAccounts:x,updatedVendor:P,selectedEntity:v,isAccountingClassesEnabled:I})),v!=null&&t(Pt({entity:v,amount:e,transactionDetails:a,flowType:"categorization",selectedTab:d,isFetchCOT:k}))):t(uo({selectedTab:d,transactionId:D.id,lineId:W[0]}))},fetchFluxViewOnScroll:(e,a)=>{t(Ze(e,!0,!1,a,!1,!0))},onFetchFluxViewList:()=>{t(Ze(h,!0,!1,null,!1,!1))},markAsReview:(e,a,i,d)=>{Q.trackFluxAnalysisReviewed(i.month,i.year,d??!1,e),t(io(a,e,i,d??!1))},onUpdateFluxAnalysisUIState:e=>{t(co(e))},updateOperatingExpensesIdsForReview:e=>{t(oo({operatingExpenseIds:e,selectedPeriod:h}))},redirectToVendorDetailPage:e=>{if(n.tenantEmailDomain!=null){const a=mi(e.id,e.qboId,n.tenantEmailDomain),i=te(n.location.state?.pathnameStackToGoBack,n.location.pathname);n.navigate(a,{state:{pathnameStackToGoBack:i,message:"expenseAutomation",referrer:"Vendor List",origin:"flux_analysis"}})}},updateSectionIdsForReview:e=>{t(so({sectionId:e,selectedPeriod:h}))},onFetchReimbursementView:(e,a,i)=>{t(Ze(e,!0,!1,a,!0,i))},onReviewClicked:e=>{t(re(h,e))},setOpenDrawerClicked:e=>{t(tt({selectedDrawerAccountId:e}))},onFetchLinkTokenClick:(e,a)=>{t(Da("expense_automation_reconcile",e,a))},onEstablishConnectionClick:(e,a)=>{const i=S?.companyId;i!=null&&(t(Fa(e,i,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",a)),t(_a({accountId:a,connectionInProgress:!0})))},onAddStatementClick:e=>{t(tt({selectedDrawerAccountId:e})),t(Xe({accountId:e,selectedPeriod:h,localData:{accountSource:"bank_statement"}})),t(Qe({statementUploadChosen:!0}))},onReloadReconciliationListPage:()=>{t(re(h,void 0,!0,!1))},onUpdateReconcileTabLocalData:e=>{t(no({selectedTransactionIds:e}))},onReconTabColumnSortConfigChanged:(e,a)=>{t(ao({sortKey:e,sortOrder:a}))},onReconReviewTabColumnSortConfigChanged:(e,a)=>{t(to({sortKey:e,sortOrder:a}))},onReconTabUpdate:e=>{n.closeSidePanel?.(),t(eo({selectedTab:e}))},updateReconReviewTabLocalData:(e,a,i)=>{const d=e.vendor?.id;i&&d!=null&&t(Qs(d)),t(Zs({data:e,transactionId:a}))},onReconMatchedTransactionClick:e=>{if(n.openTransactionPanel)return void n.openTransactionPanel(e,Tt("bill"));const a=te(r.state?.pathnameStackToGoBack,r.pathname);m(`../../transaction/bill/${e}`,{state:{pathnameStackToGoBack:a,message:"expenseAutomation",origin:"reconciliation"}})},onReloadPage:()=>{window.location.reload()},onBackClick:()=>{m(-1)},onReconListPageScroll:e=>{t(pa({scrollPosition:e}))},onVendorAutoCompleteInputChange:e=>{e.trim().length>=2?t(ma({searchString:e,searchOrigin:"common"})):e.trim().length===0&&t(Ke("common"))},onReconNodeCollapseToggled:(e,a)=>{t(Xs({nodeId:e,collapsed:a}))},updateSectionCollapseStatus:()=>{},onExcludeAccountFromReconciliation:e=>{t(wa({accountId:e}))},onIncludeAccountIntoReconciliation:e=>{t(Ra({accountId:e}))}}}),((t,n,f)=>{const{isMissingReceiptsBulkUploadEnabled:I,...k}=f;return(function(o,r,E){return{...o,...r,...E,onUploadTransactionReceipt:(l,S,R,x,m)=>{r.onUploadTransactionReceipt(l,S,R,x,m,o.authParams)}}})(t,n,k)}))(Yc(Hc)),It="newScheduleMode",kt="newScheduleType",Mi=Ei(ci((function(t){const n=t.displayName??t.name??"Component",f=La.memo(t),I=k=>{const o=he(),r=(function(){const p=he(),C=_((h=>Me(h).reconciliation.selectedDrawerAccountId));return{isOpen:C!=null,selectedAccountId:C,openPanel:s.useCallback((h=>{p(tt({selectedDrawerAccountId:h}))}),[p]),closePanel:s.useCallback((()=>{p(tt({selectedDrawerAccountId:void 0}))}),[p])}})(),E=_((p=>Me(p).reconciliation)),l=_((p=>ke(p))),S=s.useCallback(((p,C)=>{o(Da("expense_automation_reconcile",p,C))}),[o]),R=s.useCallback(((p,C)=>{const h=l?.companyId;h!=null&&(o(Fa(p,h,"expense_automation_reconcile",void 0,"link_account_no_microdeposit",C)),o(_a({accountId:C,connectionInProgress:!0})))}),[o,l?.companyId]),x=s.useMemo((()=>{if(r.isOpen&&r.selectedAccountId!=null)return b.jsx(ki,{reconciliation:E,selectedDrawerAccountId:r.selectedAccountId,onClose:r.closePanel,onFetchLinkTokenClick:S,onEstablishConnectionClick:R})}),[r.isOpen,r.selectedAccountId,r.closePanel,E,S,R]),m=s.useMemo((()=>({reconPanelContent:x,reconSidePanelIsOpen:r.isOpen,closeReconSidePanel:r.closePanel})),[x,r.isOpen,r.closePanel]),{useFeatureGate:g}=Be(),{isFeatureEnabled:u}=g(H.isReconV3Enabled),F=s.useContext(ba),A=s.useMemo((()=>r.isOpen?u===!0?{selectedItemId:r.selectedAccountId}:{closePanel:r.closePanel,selectedItemId:r.selectedAccountId}:F),[r.isOpen,r.closePanel,r.selectedAccountId,F,u]);return b.jsx(ba.Provider,{value:A,children:b.jsx(f,{...k,...m})})};return I.displayName=`withReconSidePanel(${n})`,I})(Ii((({closeMatchSidePanel:t,closeReconSidePanel:n,closeSidePanel:f,matchPanelContent:I,isMatchPanelOpen:k,openMatchPanel:o,openTransactionPanel:r,panelContent:E,reconPanelContent:l,reconSidePanelIsOpen:S,isSchedulePanelOpen:R,closeSchedulePanel:x,openSchedulePanel:m,schedulePanelContent:g,schedulePendingDiscardConfirmation:u,sidePanelIsFullView:F,sidePanelIsOpen:A})=>{const{isAiCfoOpen:p,setIsAiCfoOpen:C}=Mc(),h=Uc(),{isOpen:L}=Oc(),G=nt(),q=be(),T=he(),{isAiCfoAccessEnabled:J,onAskAiCfoClick:N}=qa({mobileExploreReferrer:"Transaction categorization"}),e=s.useCallback((()=>{k===!0&&t?.(),A===!0&&F!==!0&&f?.()}),[t,f,k,F,A]),a=_(xs);s.useEffect((()=>{a===!0&&(e(),T(ws()))}),[a,e,T]);const{areTenantIdsInSync:i}=za(),d=wi(),v=Bc(),[P,D]=s.useState(!1),[M,W]=Yn(),Y=s.useCallback((c=>{W((w=>{const $=new URLSearchParams(w);return c==null?($.delete(It),$.delete(kt),$):($.set(It,c.scheduleDetailsMode),$.set(kt,c.scheduleType),$)}),{replace:!0})}),[W]),[se,ce]=s.useState(void 0),Pe=s.useCallback(((c,w,$)=>{const j=yt(c);ce(j),Y({scheduleDetailsMode:w,scheduleType:c}),T(ra({scheduleType:j==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",shouldResetEnteredData:$}))}),[T,Y]),ye=s.useMemo((()=>{const c=M.get(It),w=M.get(kt);return c!=null&&w!=null?{scheduleDetailsMode:c,scheduleType:w}:void 0}),[M]),ve=s.useCallback((c=>{Y(c),c!=null&&T(ra({scheduleType:yt(c.scheduleType)==="prepaid_expenses"?"prepaid_expenses":"fixed_assets",shouldResetEnteredData:!0}))}),[T,Y]),K=_((c=>la(c))),B=_((c=>ke(c))),[Ve,Ee]=s.useState(!1),[ot,Se]=s.useState(!1),[je,y]=s.useState([]),[z,X]=s.useState(null),Z=s.useCallback((()=>{X(null)}),[]),ge=z?.contentType==="activity"?z.detail.transactionId:void 0,ct=s.useCallback((c=>{c!=null?(p&&C(!1),h(),e(),X({contentType:"activity",detail:{transactionId:c}})):X((w=>w?.contentType==="activity"?null:w))}),[e,p,h,C]),Qa=s.useCallback((c=>{p&&C(!1),h(),e(),X({contentType:"transfer",detail:c})}),[e,p,h,C]),Za=s.useCallback((()=>{h(),Z(),e(),N()}),[e,Z,N,h]),vt=s.useRef(p);s.useEffect((()=>{p===!0&&vt.current===!1&&(h(),Z(),e()),vt.current=p}),[e,Z,p,h]);const Et=s.useRef(L);s.useEffect((()=>{L===!0&&Et.current===!1&&(p&&C(!1),Z(),k===!0&&t?.(),A===!0&&F!==!0&&f?.()),Et.current=L}),[Z,t,f,L,p,k,C,F,A]);const Le=A===!0&&F!==!0||k===!0,At=s.useRef(Le);s.useEffect((()=>{Le&&!At.current&&(p&&C(!1),h(),Z()),At.current=Le}),[Z,p,Le,h,C]);const[xt,en]=s.useState(!1),wt=s.useRef(!1),{selectedTab:tn}=Oe(),{tenantEmailDomain:it}=Oe(),[lt,Rt]=s.useState(q.state?.message==="comingFromTransactionDetail"),Dt=q.state?.message==="comingFromOverview",an=Vc(),rt=st.getSignedInUser(),{useFeatureGate:oe}=Be(),{isFeatureEnabled:Ft}=oe(H.isRealtimeInsightsFeatureEnabled),{isFeatureEnabled:Ae}=oe(H.isMissingReceiptsBulkUploadEnabled),{isFeatureEnabled:dt}=oe(H.isTransactionActivityEnabled),{isFeatureEnabled:_t}=oe(H.isAccrualEnabled),nn=Ga(),de=_t===!0&&nn===!0,{isFeatureEnabled:Mt}=oe(H.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:sn}=oe(H.isExpenseAutomationCommentingEnabled),{isFeatureEnabled:on}=oe(H.isProjectsTransactionsEnabled),{isFeatureEnabled:cn}=oe(H.isReconV3Enabled),ln=s.useCallback((c=>{const w=Tt(c.transactionType??(c.view==="reconciliation"?"bill":"expense")),$=te(q.state?.pathnameStackToGoBack,q.pathname),j=new URLSearchParams({view:"full"});c.threadId!=null&&j.set("thread_id",c.threadId),c.entityType!=null&&j.set("entity_type",c.entityType),G(`/${it}/transaction/${encodeURIComponent(w)}/${c.transactionId??c.entityId}?${j.toString()}`,{state:{pathnameStackToGoBack:$,message:"expenseAutomation"}})}),[G,it,q.state,q.pathname]),rn=_((c=>Rs(c,"common"))),V=_((c=>Me(c))),{categoryOptions:dn,paymentAccountNames:un}=_((c=>Ds(c.accountState))),mn=_((c=>Fs(c.classState))),{monthEndCloseChecksView:ee,currentSelectedView:U,selectedPeriod:O,selectedTransactionCategorizationTab:ut,currentSelectedViewBackgroundRefreshFetchState:pn,currentSelectedViewFetchState:ie,jeSchedules:mt,reconciliation:Ut}=V;Xc(U==="transaction_categorization");const hn=V.transactionView.saveStatus.fetchState,ze=V.transactionView.transactions,Ot=s.useRef(ze);Ot.current=ze;const Bt=_((c=>c.expenseAutomationTransactionsViewState?.transactionCategorizationView)),Vt=_((c=>c.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab)),jt=s.useRef(Bt);jt.current=Bt;const Lt=s.useRef(Vt);Lt.current=Vt;const $e=_((c=>{const w=c.expenseAutomationTransactionsViewState?.selectedTransactionCategorizationTab;return w!=null?c.expenseAutomationTransactionsViewState?.transactionCategorizationView?.[w]?.filters:void 0})),zt=s.useRef("");s.useEffect((()=>{if(U!=="transaction_categorization")return;const c=V.transactionView.uiState.searchString??"";if(ie.fetchState!=="Completed"||c.length===0||c===zt.current)return;zt.current=c;const w=$e!=null?jc($e):0,$=$e?.categories.filter((j=>j.values.length>0&&String(j.values[0]??"").trim()!=="")).map((j=>`${j.field}:${j.values.join(",")}`))??[];Q.trackAiCloseTransactionSearch({filtersApplied:$,hasResults:ze.length>0,isFiltered:w>0,resultsCount:ze.length,searchTerm:c,searchType:"free_text"})}),[U,ie.fetchState,V.transactionView.uiState.searchString,V.transactionView.transactions,$e]);const le=Qc(hn,(()=>{const c=[],w=Lt.current,$=jt.current,j=$!=null&&w!=null?$[w]:void 0;if(j?.transactionReviewLocalDataById!=null)for(const fe of Object.values(j.transactionReviewLocalDataById)){const ae=fe?.transactionReviewLocalData?.lineItemById;if(ae!=null)for(const pt of Object.values(ae)){const Fe=pt?.account;Fe?.accountId!=null&&c.push(Fe.accountId)}}const Ce=Ot.current;for(const fe of Ce)for(const ae of fe.lines??[])"account"in ae&&ae.account?.accountId!=null&&c.push(ae.account.accountId);return c}));s.useEffect((()=>{U==="transaction_categorization"&&A!==!0||ct(void 0)}),[U,ct,A]),s.useEffect((()=>{S===!0&&n?.()}),[U,Ut.selectedAccountId]);const Sn=V.transactionView.selectedTransactionCategorizationCompletedSubTab,gn=V.transactionView.selectedTransactionGroup,Ge=`${ut}|${Sn}|${gn}`,Ne=s.useRef(null),$t=s.useRef(null);s.useEffect((()=>{Ne.current!==null?Ne.current!==Ge&&(Ne.current=Ge,U==="transaction_categorization"&&Z()):Ne.current=Ge}),[Z,U,Ge]);const Cn=_((c=>ge==null?void 0:_s(c.transactionState,ge))),ue=Cn?.qboId,Gt=_((c=>ue==null?void 0:Ms(c,ue)));s.useEffect((()=>{ue!=null&&T(Us(ue))}),[T,ue]);const{createTransferEntryStatus:Nt,creditCardTransferAccountsList:qt,transferAccounts:Jt}=V.transactionView,Wt=s.useCallback((c=>Zc(T,c)),[T]),Yt=s.useMemo((()=>U!=="transaction_categorization"||z==null?null:z.contentType==="activity"?dt===!0?b.jsx(Lc,{activityLogView:Gt,qboId:ue,onClose:()=>X(null),selectedTransactionId:z.detail.transactionId,isQuickViewCardStyle:!0},String(z.detail.transactionId)):null:z.contentType==="transfer"?b.jsx(zc,{createTransferEntryStatus:Nt,creditCardTransferAccountsList:qt,transaction:z.detail,transferAccounts:Jt,onClose:()=>X(null),onCreateTransfer:Wt,isQuickViewCardStyle:!0},String(z.detail.transactionId)):null),[U,z,dt,Gt,ue,Nt,qt,Jt,Wt]),fn=Yt!=null,{selectedAccountId:xe}=Ut,Ht=et(mt.accountSettingsView.saveState.fetchState),In=_((c=>Os(c.accountState,c.accountListState,"accountList"))),kn=_((c=>Bs(c))),we=Wa(tn)??U,bn=_((c=>c.entityAutoCompleteState.autoCompleteText.common));if($a({isDataReady:ie.fetchState==="Completed"}),rt==null)throw Error("Can't access expense automation screen without signing in...");const Kt=Ua(O),Re=at(Kt.start),De=at(Kt.end);if(Re==null||De==null)throw Error(`Invalid start - ${Re} and end - ${De} period from given ${O}`);const Tn=s.useCallback((()=>{Ee(!1)}),[]),Pn=s.useCallback((()=>{Se(!0)}),[]),yn=s.useCallback((c=>{y(c),Se(!1)}),[]),vn=s.useCallback((()=>{y([])}),[]),qe=V.missingReceipts.bulkUpload.phase,Xt=V.missingReceipts.bulkUpload.currentBatchId;s.useEffect((()=>{Ae===!0&&U==="missing_receipts"&&qe==="matching"&&Xt!=null&&T(Oa({cacheOverride:!0}))}),[Ae,U,qe,Xt,T]);const Qt=rt?.userId,En=O.month,An=O.year,Zt=B?.tenantId;s.useEffect((()=>{U==="missing_receipts"&&Ae!==!1&&qe==="idle"&&Qt!=null&&Zt!=null&&T(Vs())}),[U,Ae,qe,Qt,Zt,En,An,T]),s.useEffect((()=>{K.newVendorState?.vendorDetailLocalData?.vendorName!=null?D(!0):D(!1)}),[K.newVendorState?.vendorDetailLocalData?.vendorName]),s.useEffect((()=>{we!=null&&U!==we&&T(Ba(we))}),[we]),s.useEffect((()=>{xt===!1&&ie.fetchState==="Completed"&&i&&(en(!0),T(da(!1,!1,de)))}),[xt,ie,i,de]),s.useEffect((()=>{const c={month:O.month,year:O.year},w=$t.current;$t.current=c,w===null||w.month===c.month&&w.year===c.year||!Dt&&i&&(T(da(!1,!1,de)),T(re(O,xe,!1,!1)))}),[O.month,O.year,i,de]);const Je=s.useCallback(((c=!1,w=!1)=>{const $={start:Re,end:De};switch(U){case"transaction_categorization":T(pe(ut,$,c,!lt,void 0,void 0,w)),Rt(!1);break;case"flux_analysis":T(Ze(O,c,w,null));break;case"month_end_insights":if(w===!1){const j=new Date(O.year,O.month,0),Ce=Ls(j.toDateString()).format(Xa.analytics.YYYYDashMMDashDDFormat);T(zs(!0,B.companyId,B.tenantId,Ce)),T($s(B.companyId,B.tenantId))}break;case"je_schedules":T(js($,w,de));break;case"missing_receipts":T(Va($,{amount:75,currencyCode:"USD",currencySymbol:"$"},c,w));break;default:T(re(O,xe,c,w))}}),[U,Re,De,B.companyId,B.tenantId,ut,O,xe,lt,Rt,de]),xn=s.useCallback((()=>{Je(!0,!0)}),[Je]);s.useEffect((()=>{U===we&&ie.fetchState==="Not-Started"&&i&&Je(!0)}),[ie,Re,De,B.companyId,B.tenantId,i]),s.useEffect((()=>{Dt||lt||wt.current||pn.fetchState==="In-Progress"||ie.fetchState!=="Completed"||(wt.current=!0,Je(!0,!0))}),[]),s.useEffect((()=>{ee.fetchState!=="In-Progress"&&ee.fetchState!=="Completed"&&ee.fetchState!=="Error"&&B?.tenantId!=null&&T(_e({tenantId:B.tenantId,period:O,refreshViewInBackground:!1}))}),[ee.fetchState,B?.tenantId]),s.useEffect((()=>{ee.fetchState!=="Completed"||!i||(ee.monthEndCloseChecks?.monthEndCloseCheckList.some((c=>c.id==="reconciliation"))??!1)&&V.reconciliation.fetchStatus.fetchState==="Not-Started"&&T(re(O,void 0,!1,!1))}),[ee.fetchState,i,O.month,O.year,V.reconciliation.fetchStatus.fetchState,T]),s.useEffect((()=>{V.monthEndInsights?.previewMonthEndReportStatus?.fetchState==="Completed"?Ee(!0):Ee(!1)}),[V.monthEndInsights?.previewMonthEndReportStatus?.fetchState]),s.useEffect((()=>{V.monthEndInsights?.sendMonthEndReportStatus?.fetchState==="Completed"&&i&&(T(_e({tenantId:B.tenantId,period:O,refreshViewInBackground:!0})),T(Gs({companyId:B.companyId})),G("../"))}),[V.monthEndInsights?.sendMonthEndReportStatus?.fetchState,B.tenantId,O,B.companyId,i]),s.useEffect((()=>{const c=setInterval((()=>{ee.fetchState!=="In-Progress"&&ee.fetchState==="Completed"&&T(_e({tenantId:B.tenantId,period:O,refreshViewInBackground:!0}))}),3e5);return()=>clearInterval(c)}),[ee.fetchState,B.tenantId,O,T]),s.useEffect((()=>{const c=setInterval((()=>{U==="reconciliation"&&xe==null&&V.reconciliation.fetchStatus.fetchState==="Completed"&&V.reconciliation.refreshStatus.fetchState!=="In-Progress"&&T(re(O,void 0,!0,!0))}),3e5);return()=>clearInterval(c)}),[U,T,V.reconciliation.fetchStatus.fetchState,V.reconciliation.refreshStatus.fetchState,re,xe,O]);const wn=Pa(),{isFeatureEnabled:Rn}=oe(H.isRecommendationFeedbackEnabled),ea=$c(),{onRecommendationSelection:ta,popup:Dn}=ei({isEnabled:Rn}),Fn=s.useMemo((()=>({...ea,onRecommendationSelection:ta})),[ea,ta]);s.useEffect((()=>{const c=(ee.monthEndCloseChecks?.monthEndCloseCheckList.find((w=>w.id==="month_end_insights"))?.isDisabled??!1)&&!Ft;U!=="month_end_insights"||!c&&ee.monthEndCloseChecks?.reportEmailSentDate==null||G("../")}),[U,ee.monthEndCloseChecks]);const _n=S===!0?l:E,Mn=S===!0||A===!0,Un=S===!0?n:f,On=S!==!0&&F;s.useEffect((()=>{Ht==="In-Progress"&&mt.accountSettingsView.saveState.fetchState==="Completed"&&T(ua())}),[Ht,mt.accountSettingsView.saveState.fetchState,ua]);const{transactionId:aa,onSaveVendor:Bn,onSaveSuccess:Vn,onCancel:jn,vendorViewDetails:Ln}=(({expenseAutomationViewSelector:c,closeDrawerHandler:w,currentSelectedView:$})=>{const j=he();let Ce,fe,ae;const pt=Pa(),Fe=c.transactionView;let na=()=>{};const{transactions:zn,selectedTransactionId:Ie,selectedTransactionLineId:We,transactionLocalData:$n}=Fe;if($==="transaction_categorization"){const ht=$n.find((me=>me.transactionId===Ie)),ne=zn.find((me=>me.id===Ie)),sa=We!=null?ht?.transactionReviewLocalData?.lineItemById[We]:void 0,oa=sa?.account;fe=sa?.class?.classId,Ce=["Uncategorized Income","Uncategorized Expense"].includes(oa?.accountName??"")?void 0:oa?.accountId;const Nn=ui(Ie,ne?.typeOfTransaction);ne!=null&&Nn&&(ae={id:Ie,type:Tt(ne.typeOfTransaction)}),na=()=>{if(Ie!=null&&We!=null&&ne!=null){const me=Fe.transactionLocalData.find((Ye=>Ye.transactionId===Ie))?.transactionReviewLocalData;if(me!=null&&ne.lines!=null&&ne.lines.length>0){const Ye=me.lineItemById[We];let St=me.selectedEntity;if(As(ne)||(St=Ye.selectedEntityLine),St!=null){const qn=St,Jn={transactionId:{id:ne.id,type:ne.type},transaction:ne,lineIds:ne.lines.map((Wn=>Wn.id))??[]};j(Pt({entity:qn,amount:Ye.amount.amount,transactionDetails:Jn,flowType:"categorization",selectedTab:c.selectedTransactionCategorizationTab,isFetchCOT:pt}))}}}}}const Gn=_((ht=>la(ht,void 0,Ce,fe)));return{transactionId:ae,onSaveVendor:()=>{j(Es(ae,void 0,!1,!0))},onSaveSuccess:na,onCancel:()=>{ae!=null&&j(Ps({transactionId:ae})),j(ys()),j(vs()),w()},vendorViewDetails:Gn}})({expenseAutomationViewSelector:V,closeDrawerHandler:()=>{D(!1)},currentSelectedView:U});return an?.loggedInUserRoleMap==null?ee.fetchState==="Error"?b.jsx(Gc,{onGoHome:()=>G("../",{replace:!0}),onReload:()=>window.location.reload()}):b.jsx(Na,{fetchState:"In-Progress"}):b.jsxs(b.Fragment,{children:[b.jsx(hi,{isOpen:ot,drawerLeftMargin:new Nc(0,0,300,650),onClose:()=>{Se(!1)},children:b.jsx(Ui,{onClick:c=>c.stopPropagation(),children:b.jsx(Ai,{companyId:B.companyId,closeCustomerRequestDrawer:()=>Se(!1),addCustomerRequest:yn,resetCustomerRequest:vn})})}),aa!=null&&P&&b.jsx(ni,{isOpen:P,transactionId:aa,onSaveVendor:Bn,onSaveSuccess:Vn,onCancel:jn,vendorViewDetails:Ln}),b.jsx(qc,{toolkit:Fn,children:b.jsx(_i,{events:[],eventCallback:(c,w,$)=>{},navigate:G,location:q,themeState:v,categoryOptions:dn,classesForFilters:mn,accountsForFilters:un,vendorSearchAutoCompleteData:{autoCompleteText:bn,entityAutoCompleteView:rn},expenseAutomationViewSelector:V,isMissingReceiptsBulkUploadEnabled:Ae,monthEndInsightsPreviewMode:Ve,monthEndInsightsCustomerRequestData:je,isRealtimeInsightsFeatureEnabled:Ft,isCreateTransferEntryFromExpenseEnabled:Mt,isAccountingClassesEnabled:kn,isProjectsTransactionsEnabled:on,isCOTEnabled:wn,currentTenant:B,companyId:B.companyId,signedInUser:rt,isTransactionActivityEnabled:dt,isRightPanelOpen:fn,rightSidePanel:Yt,onOpenTransferRightPanel:Mt===!0?Qa:void 0,uncategorizedAccounts:In,newScheduleActiveType:se,isAccrualEnabled:_t,isActualMatchingEnabled:de,newScheduleSelection:ye,onNewScheduleSelectionChange:ve,onScheduleTypeChange:Pe,onNewScheduleSaved:xn,onClickCustomerRequest:Pn,handleEditClick:Tn,tenantEmailDomain:it,trackExpenseAutomationTabAnalytics:d,setActivityLogTransactionId:ct,closeMatchSidePanel:t,closeSidePanel:Un,openTransactionPanel:r,closeSchedulePanel:x,openSchedulePanel:m,openMatchPanel:o,sidePanelIsOpen:Mn,sidePanelIsFullView:On,panelContent:_n,isAiCfoAccessEnabled:J,onAskAiCfoClick:Za,isExpenseAutomationCommentingEnabled:sn,isReconV3Enabled:cn,onExpenseAutomationCommentingThreadClick:ln,sidePanelListPercent:S===!0?66:void 0,isMatchPanelOpen:k,isSchedulePanelOpen:R,matchPanelContent:I,schedulePanelContent:g,schedulePendingDiscardConfirmation:u})}),Dn,le.showPopup&&le.popupType!=null&&b.jsx(Jc,{popupType:le.popupType,currencySymbol:le.currencySymbol,accountId:le.popupAccountId??"",accountName:le.popupAccountName??"",onSubmit:le.handleSubmit,onDismiss:le.handleDismiss})]})}))))),Ui=Te(vc)`
|
|
35
35
|
display: flex;
|
|
36
36
|
min-height: 100%;
|
|
37
37
|
flex-direction: column;
|
|
38
|
-
`;function Oi(){const t=be(),{selectedTab:n,tenantEmailDomain:f}=Oe(),I=_((r=>ke(r))),k=_((r=>r.expenseAutomationViewState.selectedPeriodByTenantId[I.tenantId]));if(Wa(n)==null)return b.jsx(ja,{});const o=Ja({tenantEmailDomain:f,selectedTab:n,selectedPeriod:k!=null?`${k.month}-${k.year}`:void 0});return o==null?null:b.jsx(
|
|
38
|
+
`;function Oi(){const t=be(),{selectedTab:n,tenantEmailDomain:f}=Oe(),I=_((r=>ke(r))),k=_((r=>r.expenseAutomationViewState.selectedPeriodByTenantId[I.tenantId]));if(Wa(n)==null)return b.jsx(ja,{});const o=Ja({tenantEmailDomain:f,selectedTab:n,selectedPeriod:k!=null?`${k.month}-${k.year}`:void 0});return o==null?null:b.jsx(Xn,{to:o,replace:!0,state:t.state})}function ml(){return b.jsxs(Kn,{children:[b.jsx(He,{index:!0,element:b.jsx(Si,{})}),b.jsx(He,{path:"/:selectedTab/:selectedPeriod/*",element:b.jsx(Mi,{})}),b.jsx(He,{path:"/:selectedTab",element:b.jsx(Oi,{})}),b.jsx(He,{path:"*",element:b.jsx(ja,{})})]})}export{ml as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{j as s}from"./liveblocks-Bnd7TfEn.js";import{a as r}from"./sentry-C4tTgPRE.js";import{ax as l,ay as p,R as m,a5 as b}from"./index-BSR6syxs.js";import"./mui-CAtYecwm.js";import f from"./NotFoundScreen-DcVbM1H7.js";import{h as c,g as u}from"./core-DuhHfvEc.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]="84290e3a-b5eb-4a67-b663-116401857d00",e._sentryDebugIdIdentifier="sentry-dbid-84290e3a-b5eb-4a67-b663-116401857d00")}catch{}})();const _=()=>{const e=c(),a=u(),t=r.useCallback((()=>{window.open("https://www.zeni.ai/demo/request","_blank")}),[]),i=r.useCallback((()=>{(()=>{const n=b(a.state?.pathnameStackToGoBack),d=n.poppedPathname??k();e(d,{state:{pathnameStackToGoBack:n.newStack}})})()}),[]),o=l(a.pathname);return o!=null?s.jsx(p,{menuItem:m(o),onDemoClick:t,onGoBack:i}):s.jsx(f,{})},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-C4tTgPRE.js";import{u as l,h as f,g as m}from"./core-DuhHfvEc.js";import{hY as p,UB as g,UC as _}from"./zeni-epic-state-B5FlPsWC.js";import{u as b,L as h,z as y}from"./index-BSR6syxs.js";import"./liveblocks-Bnd7TfEn.js";import"./recharts-Ax0XVvbk.js";import"./mui-CAtYecwm.js";import"./analytics-VM2TTd1t.js";import"./plaid-DQqtphHb.js";import"./dnd-pjIs22E1.js";import"./stripe-cKAAJElX.js";import"./lottie-DnzLxz4m.js";import"./lexical-Db4_RNT4.js";import"./pdf-C4y-9f6g.js";import"./utils-BtDnAqMA.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]="2a93d830-e3af-449b-98b3-7756e027ec7c",e._sentryDebugIdIdentifier="sentry-dbid-2a93d830-e3af-449b-98b3-7756e027ec7c")}catch{}})();function j(){const e=l(),n=f(),o=m(),{setLoading:i,clearAllLoading:d}=b(),s=r.useRef(!1);return r.useLayoutEffect((()=>{i(h.CONNECTION_AUTH)}),[i]),r.useEffect((()=>{if(s.current)return;s.current=!0;const a=new URLSearchParams(o.search).get("code"),c=sessionStorage.getItem("hubspot_oauth_pending");if(sessionStorage.removeItem("hubspot_oauth_pending"),a!=null&&c!=null){const t=JSON.parse(c);e(p(t.tenant_id,t.connection_id,g("revenue"),_("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{j as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{n as s}from"./liveblocks-
|
|
1
|
+
import{n as s}from"./liveblocks-Bnd7TfEn.js";import{j as d}from"./core-DuhHfvEc.js";import{fF as a}from"./zeni-epic-state-B5FlPsWC.js";import"./sentry-C4tTgPRE.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]="7ecf9165-dd2c-4040-9e65-c840c8a3aad6",e._sentryDebugIdIdentifier="sentry-dbid-7ecf9165-dd2c-4040-9e65-c840c8a3aad6")}catch{}})();const h=()=>d((e=>a(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};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{j as a}from"./liveblocks-Bnd7TfEn.js";import{a as r}from"./sentry-C4tTgPRE.js";import{u as L,h as A,i as R,j as C,t as G,l as O,s as H,g as Z,N as B,n as te,o as x}from"./core-DuhHfvEc.js";import{a9 as nt,k as p,ar as _,V as m,cd as tt,ce as it,cf as ot,cg as at,ch as st,ci as ct,cj as rt,ck as lt,cl as dt,cm as ut,cn as gt,co as mt,p as W,cp as vt,cq as pt,af as ae,cr as St,cs as ft,z as ke,ct as ht,cu as It,cv as Ct,cw as Et,cx as kt,cy as yt,cz as xt,cA as bt,K as jt,aj as ln,cB as Dt,cC as Lt,cD as At,cE as Pt,cF as $t,cG as Ft,cH as wt,cI as Rt,cJ as _t,cK as Tt,cL as Ot,t as Ve,j as dn,cM as Mt,cN as Nt,cO as Ut,cP as Bt,cQ as Vt,cR as Ht,cS as qt}from"./index-BSR6syxs.js";import"./mui-CAtYecwm.js";import{A as Q}from"./AddressScreen-I8Rs-MIn.js";import M from"./NotFoundScreen-DcVbM1H7.js";import{ZQ as zt,ZR as Qt,vp as He,ZS as K,vS as se,ZT as Ae,ZU as ce,wt as ye,wA as Kt,wF as un,ZV as Pe,wx as gn,y7 as qe,vR as ze,ZW as Gt,ZX as mn,wQ as xe,ZY as re,wU as Zt,ZZ as Wt,Z_ as vn,wX as pn,z2 as Xt,Z$ as ve,_0 as Qe,_1 as Sn,vP as Jt,_2 as Yt,vJ as ei,_3 as ni,yk as ti,_4 as fn,yt as Ke,_5 as ii,yq as oi,_6 as $e,gh as ai,_7 as ee,_8 as ne,xa as si,vX as Ge,w0 as hn,v_ as ci,vU as ri,x3 as li,w2 as di,xc as ui,_9 as be,xl as In,xj as X,xh as le,xg as gi,_a as Cn,yz as Ze,_b as mi,vQ as En,_c as Fe,wb as je,w8 as De,wl as kn,wk as we,w5 as vi,we as yn,wn as ie,fF as Re,VC as xn,vT as _e,wi as pi,wj as Si,wh as fi,_d as hi,wV as Ii,wR as bn,_e as jn,vD as We,_f as Ci,vz as Ei,_g as ki,yF as yi,yJ as q,yE as xi,xN as Te,_h as bi,_i as Dn,yS as Xe,_j as ji,yP as Di,_k as Ln,xQ as Li,xR as V,xU as Ai,_l as An,y2 as Ie,_m as Pi,xb as Pn,U8 as $n,_n as $i,yc as Fi,_o as Fn,_p as wi,_q as Ri,_r as _i,zH as Ti,_s as Oi,_t as wn,yZ as Rn,_u as _n,zF as Ce,_v as Mi,zC as Ni,_w as Ui,_x as Bi,_y as Vi,_z as Hi,_A as qi,_B as Je,_C as zi,eg as Qi,zL as Ki,_D as Oe,xv as Gi,xq as Zi,_E as de,xG as Tn,xy as ue,xx as Wi,xB as On,_F as Xi,xw as Ji,_G as Mn,z3 as Nn,zu as Ye,zp as Yi,_H as eo,z4 as no,_I as to,zv as io,zz as oo,_J as Me,wv as Un,zg as ao,ww as so,_K as co,_L as Bn,c8 as ro,ms as lo,mt as uo,_M as en,wu as ge,gl as go,mz as mo,zm as Vn,zX as vo,zj as Hn,uX as po,zU as nn,uL as So,zR as tn,hS as fo,UB as on,UC as ho,Gh as qn,hK as Io,_N as Co,Vr as Eo,_O as ko,A0 as Ee,A1 as yo,_P as xo,_Q as zn,z_ as bo,_R as jo,_S as Do,yg as Lo,_T as Ao}from"./zeni-epic-state-B5FlPsWC.js";import{M as Po}from"./MobileAppDrawer-7ZhbRmu1.js";import{q as me}from"./QBOConnectionScreen-B-S6pmPF.js";import"./recharts-Ax0XVvbk.js";import"./analytics-VM2TTd1t.js";import"./plaid-DQqtphHb.js";import"./dnd-pjIs22E1.js";import"./stripe-cKAAJElX.js";import"./lottie-DnzLxz4m.js";import"./lexical-Db4_RNT4.js";import"./pdf-C4y-9f6g.js";import"./utils-BtDnAqMA.js";import"./InboxNotificationsProvider-Cqk-hq7Y.js";import"./useTaskManagerAccess-CSigDKkg.js";import"./empty-DH6a4LIS.js";import"./pdf-lib-BWugleNz.js";import"./index-iYJnyyes.js";import"./url-Cf1wHOjT.js";import"./index-DLhjtHx_.js";import"./decodeURIComponentSafe-BuuGDiIq.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new t.Error().stack;e&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[e]="fdd16e8d-e4d1-4d89-9266-7259722e3c69",t._sentryDebugIdIdentifier="sentry-dbid-fdd16e8d-e4d1-4d89-9266-7259722e3c69")}catch{}})();const $=({event:t,isReady:e=!0})=>e?a.jsx(nt,{analytics:p,onLoad:n=>n.trackPageLoaded(t)}):null;function N(...t){return t.some((e=>e==="Error"))}function $o(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),[s,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),{fetchState:g,hasMore:f,items:S,nextCursor:h,auditLogEntityRouteOptions:D,auditLogListSortFieldOptions:b}=C(zt),k=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),y=`/${n??""}/invoicing`,I=r.useCallback(((P,U)=>{const T=Qt(y,P,U,D);T!=null&&(p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{entity:P,entityId:U,fromScreen:"audit_log"}),e(T))}),[D,e,y]);r.useEffect((()=>{const P=setTimeout((()=>d(s)),300);return()=>clearTimeout(P)}),[s]),r.useEffect((()=>{i&&t(He({filters:k,keepExistingListItems:!1,sort:u}))}),[i,k,u,t]);const j=g==="Not-Started"||g==="In-Progress"&&S.length===0,E=g==="In-Progress"&&S.length>0,F=g==="Completed";return N(g)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingAuditLogPage,isReady:F}),a.jsx(tt,{auditLogEntityRouteOptions:D,auditLogListSortFieldOptions:b,entries:S,hasMore:f,isLoading:j,isLoadingMore:E,searchValue:s,sortState:l,onEntityLinkClick:I,onLoadMore:()=>{f&&h!=null&&t(He({cursor:h,filters:k,keepExistingListItems:!0,sort:u}))},onSearchChange:o,onSortChange:v})]})}function pe(t,e=!1){const n=L(),i=C((c=>K(c).productNextCursor!=null)),s=C((c=>K(c).productNextCursor)),o=C((c=>K(c).productFetchState.fetchState));r.useEffect((()=>{t&&(e&&o!=="Not-Started"||n(se({filters:{type:"addon|charge"},keepExistingListItems:!1})))}),[t,n,e]),r.useEffect((()=>{t&&o!=="In-Progress"&&i&&s!=null&&n(se({cursor:s,filters:{type:"addon|charge"},keepExistingListItems:!0}))}),[t,n,o,i,s])}function Se(t,e,n,i){const[s,o]=r.useState(0),[c,d]=r.useState(!1),l=r.useRef(t);return r.useEffect((()=>{const v=l.current==="In-Progress";l.current=t,t==="Completed"&&v&&n!=null&&(d(!0),i(n))}),[t,n,i]),r.useEffect((()=>{c&&!e&&(d(!1),o((v=>v+1)))}),[c,e]),s}const Fo=new Set(["plan"]),wo=O((function(t,e){const{view:n}=e;return{applicableItemOptions:n.applicableItemOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboClassHierarchy:n.qboClassHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds,catalogItemLifecycleActionOptions:n.catalogItemLifecycleActionOptions,catalogProductLifecycleActionOptions:n.catalogProductLifecycleActionOptions,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,periodUnitOptions:n.periodUnitOptions,trialEndActionOptions:n.trialEndActionOptions,trialUnitOptions:n.trialUnitOptions,typeOptions:n.typeOptions,isLoading:e.isLoading,isRunningLifecycleAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",itemId:e.itemId,localData:n.localData,plan:n.plan}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{itemId:i}=e;return{onBack:()=>e.navigate(`${n}/catalog`),onLifecycleAction:i!==""?s=>{i!==""&&t(gn({action:s,id:i}))}:void 0,onEditChange:s=>{i!==""&&t(Pe({id:i,localData:s}))},onSaveEdit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemEdited,{itemId:i}),t(un({id:i}))},onSubFamilyLifecycleAction:(s,o)=>{i!==""&&t(Kt({action:o,id:s,parentItemId:i}))}}}))(it);function Ro(){const t=L(),e=A(),{item_id:n,tenantEmailDomain:i}=R(),[s]=G(),{areTenantIdsInSync:o}=_(),c=(d=s.get("kind"))!=null&&Fo.has(d)?d:"plan";var d;const l=C((k=>Ae(k,n))),{pageFetchState:v}=l,u=v.fetchState;r.useEffect((()=>(t(ce({id:n})),()=>{t(ce({id:n}))})),[t,n]),r.useEffect((()=>{o&&t(ye({id:n,kind:c}))}),[o,n,c,t]);const g=r.useCallback((k=>t(ye({cacheOverride:!0,id:k,kind:c}))),[t,c]),f=Se(l.fetchState,l.isFormLoading,n,g),S=u==="Completed"&&!l.isFormLoading;pe(o,!0);const[h,D]=r.useState(S?n:void 0);r.useEffect((()=>{n!=null&&S&&D(n)}),[n,S]);const b=h!==n&&(u==="Not-Started"||u==="In-Progress"||l.isFormLoading);return N(u)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingCatalogItemDetailPage,isReady:S}),a.jsx(wo,{navigate:e,tenantEmailDomain:i,itemId:n??"",kind:c,isLoading:b,view:l},f)]})}const _o=new Set(["addon","charge","plan"]),To=new Set(["plan"]),Oo=O((function(t,e){const n=Ae(t,e.itemId);return{fieldHelp:n.fieldHelp,qboClassHierarchy:n.qboClassHierarchy,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds,applicabilityValues:n.applicabilityValues,periodUnitOptions:n.periodUnitOptions,trialEndActionOptions:n.trialEndActionOptions,trialUnitOptions:n.trialUnitOptions,typeOptions:n.typeOptions,applicableItemOptions:n.applicableItemOptions,defaultType:e.isEdit?void 0:e.defaultType,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save catalog item.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,pricingModelValues:n.pricingModelValues,prorationValues:n.prorationValues,tierTypeOptionsByPricingModel:n.catalogTierTypeOptionsByPricingModel,tierTypeValues:n.tierTypeValues}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.isEdit?"edit":"create",{itemId:s}=e,o=s!=null?`${n}/catalog/${encodeURIComponent(s)}`:`${n}/catalog`;return{onBack:()=>e.navigate(o),onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemFormCancelled),t(ce({id:s})),e.navigate(`${n}/catalog`)},onChange:c=>{t(Pe({id:s,localData:c}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemSaved,{mode:i}),t(un({id:s}))}}}))(ot);function Mo(){const t=L(),e=A(),{item_id:n,tenantEmailDomain:i}=R(),[s]=G(),{areTenantIdsInSync:o}=_(),c=n!=null,d=s.get("type"),l=d!=null&&_o.has(d)?d:void 0,v=(u=s.get("kind"))!=null&&To.has(u)?u:"plan";var u;const g=C((f=>Ae(f,n)));return pe(o,!0),r.useEffect((()=>{o&&t(ye({id:n,kind:v}))}),[o,n,v,t]),r.useEffect((()=>{c||l==null||g.localData.catalogType===l||t(Pe({localData:{...g.localData,catalogType:l}}))}),[c,l,g.localData?.catalogType,t]),r.useEffect((()=>{if(g.fetchState==="Completed"){const f=g.savedItemId??n,S=f!=null?`/${i}/invoicing/catalog/${encodeURIComponent(f)}`:`/${i}/invoicing/catalog`;e(S),t(ce({id:n}))}}),[g.fetchState,g.savedItemId,n,t,e,i]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingCatalogItemFormPage}),a.jsx(Oo,{navigate:e,tenantEmailDomain:i,defaultType:l,isEdit:c,itemId:n})]})}const No={addons:"addon",all:"item",charges:"charge",plans:"plan"},Uo=O((function(t,e){const n=K(t),i=e.activeTab==="plans",s=e.activeTab==="all",o=i?n.plans:s?[...n.plans,...n.products]:n.products,c=i||s&&n.fetchState==="In-Progress"?n.fetchState:n.productFetchState.fetchState;return{catalogItemLifecycleActionOptions:n.catalogItemLifecycleActionOptions,counts:n.count,countsLoading:n.countsFetchState.fetchState==="Not-Started"||n.countsFetchState.fetchState==="In-Progress",hasMore:i?n.planNextCursor!=null:s&&n.planNextCursor!=null||n.productNextCursor!=null,isLoading:c==="Not-Started"||c==="In-Progress"&&o.length===0,isLoadingMore:c==="In-Progress"&&o.length>0,plans:n.plans,productColumns:n.productColumns,products:n.products}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=e.activeTab==="plans",s=e.activeTab==="all",o=i?e.planNextCursor:e.productNextCursor;return{activeTab:e.activeTab,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTabChange:e.onTabChange,onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"catalog"}),e.navigate(`${n}/data_import`)},onAddItem:()=>{const c=No[e.activeTab];p.trackInvoicingActionClick(m.Event.invoicingAddCatalogItemClicked,{itemType:c}),e.navigate(`${n}/catalog/new?type=${c}`)},onItemClick:(c,d)=>{p.trackInvoicingActionClick(m.Event.invoicingCatalogItemRowClicked,{itemId:d}),e.navigate(`${n}/catalog/${encodeURIComponent(d)}`)},onCatalogItemLifecycleAction:(c,d)=>{t(gn({action:Gt(d),id:c}))},onLoadMore:()=>{if(s)return e.planNextCursor!=null&&t(ze({cursor:e.planNextCursor,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort})),void(e.productNextCursor!=null&&t(se({cursor:e.productNextCursor,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort})));o!=null&&t(i?ze({cursor:o,filters:e.planFilters,keepExistingListItems:!0,sort:e.sort}):se({cursor:o,filters:e.productFilters,keepExistingListItems:!0,sort:e.sort}))}}}))(at);function Bo(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),[s,o]=r.useState(""),[c,d]=r.useState("plans"),[l,v]=r.useState(""),[u,g]=r.useState(null),f=r.useMemo((()=>u!=null?{dir:u.direction,field:u.columnKey}:void 0),[u]),S=l.trim()!==""?l.trim():void 0,h=r.useMemo((()=>({search:S,type:"plan"})),[S]),D=r.useMemo((()=>({search:S,type:"addon|charge"})),[S]),b=C((P=>K(P))),k=b.planFilters.search,y=b.planSort,I=b.planNextCursor,j=b.productNextCursor,E=b.fetchState==="Completed",F=b.runningActionId??null;return r.useEffect((()=>{const P=setTimeout((()=>v(s)),300);return()=>clearTimeout(P)}),[s]),r.useEffect((()=>{i&&t(qe({cacheOverride:!1,planFilters:h,productFilters:D,planSort:f,productSort:f}))}),[i,t,h,D,f]),r.useEffect((()=>{i&&(S!==k||f?.field!==y?.field||f?.dir!==y?.dir)&&t(qe({cacheOverride:!0,planFilters:h,productFilters:D,planSort:f,productSort:f}))}),[k,y,i,t,h,D,S,f]),N(b.fetchState)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingCatalogPage,isReady:E}),a.jsx(Uo,{navigate:e,tenantEmailDomain:n,activeTab:c,searchValue:s,sortState:u,planFilters:h,productFilters:D,sort:f,planNextCursor:I,productNextCursor:j,runningCatalogItemActionId:F,onSearchChange:o,onTabChange:d,onSortChange:g})]})}const Vo=O((function(t,e){const n=mn(t,e.couponId);return{fieldHelp:n.fieldHelp,applyOnOptions:n.applyOnOptions,discountTypeOptions:n.discountTypeOptions,durationTypeOptions:n.durationTypeOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save coupon.":void 0,isQboConnected:n.isQboConnected,isQboPickerDataLoading:n.isQboPickerDataLoading,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,periodUnitOptions:n.periodUnitOptions,qboAccountHierarchy:n.qboAccountHierarchy,qboIncomeAccountIds:n.qboIncomeAccountIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e,s=i!=null?"edit":"create",o=i!=null?`${n}/discounts/${encodeURIComponent(i)}`:`${n}/discounts`;return{onBack:()=>e.navigate(o),onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCouponFormCancelled),t(re({id:i})),e.navigate(`${n}/discounts`)},onChange:c=>{t(Wt({id:i,localData:c}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCouponSaved,{mode:s}),t(Zt({id:i}))}}}))(st);function Ho(){const t=L(),e=A(),{coupon_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:s}=_(),{fetchState:o,savedCouponId:c}=C((d=>mn(d,n)));return r.useEffect((()=>{s&&t(xe({id:n}))}),[s,n,t]),r.useEffect((()=>{if(o==="Completed"){const d=c??n,l=d!=null?`/${i}/invoicing/discounts/${encodeURIComponent(d)}`:`/${i}/invoicing/discounts`;e(l),t(re({id:n}))}}),[o,c,n,t,e,i]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingCouponFormPage}),a.jsx(Vo,{couponId:n,navigate:e,tenantEmailDomain:i})]})}const qo=O((function(t){const e=vn(t);return{fieldHelp:e.fieldHelp,customers:e.customers,planNames:e.planNames,errorMessage:e.fetchState==="Error"?e.error?.message??"Failed to create invoice. Please try again.":void 0,isSubmitting:e.fetchState==="In-Progress",localData:e.localData,settings:e.settings}}),(function(t){return{dispatch:t}}),(function(t,{dispatch:e},n){const i=`/${n.tenantEmailDomain}/invoicing`;return{...t,onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreateInvoiceCancelled),n.navigate(`${i}/invoices`)},onChange:s=>{e(Sn(s))},onSubmit:()=>{const s=Yt(t.localData);p.trackInvoicingActionClick(m.Event.invoicingInvoiceCreated,{customerId:s.customer_id,lineItemCount:s.line_items?.length}),e(ei(s))}}}))(rt);function zo(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),[i]=G(),{areTenantIdsInSync:s}=_(),o=i.get("customerId"),c=C((I=>vn(I))),d=c.fetchState,l=c.localData,v=c.savedInvoiceId,u=C(pn),g=C((I=>Xt(I))),f=C(ve),S=g.fetchState==="Not-Started"||g.fetchState==="In-Progress"&&u==null,h=f.fetchState==="Not-Started"||f.fetchState==="In-Progress"&&f.customers.length===0,D=S||h,b=g.fetchState==="Completed"&&f.fetchState==="Completed";r.useEffect((()=>(t(Qe()),()=>{t(Qe())})),[t]);const k=r.useRef(!1);r.useEffect((()=>{k.current||o==null||o===""||l.customerId!==""||(k.current=!0,t(Sn({...l,customerId:o})))}),[o,l,t]),r.useEffect((()=>{s&&t(Jt({cacheOverride:!1}))}),[s,t]);const y=r.useRef(d);return r.useEffect((()=>{const I=y.current;if(y.current=d,I!=="Completed"&&d==="Completed"){const j=v!=null?`/${n}/invoicing/invoices/${encodeURIComponent(v)}`:`/${n}/invoicing/invoices`;e(j)}}),[d,v,e,n]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingCreateInvoicePage,isReady:b}),D?a.jsx(ct,{}):a.jsx(qo,{navigate:e,tenantEmailDomain:n})]})}const Qo=O((function(t,e){const{detailView:n}=e;return{fieldHelp:e.detailView.fieldHelp,creditNote:n.creditNote,creditNoteId:e.creditNoteId,isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onBack:()=>e.navigate(`${n}/credits`),onCustomerClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:i,fromScreen:"credit_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onInvoiceClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",invoiceId:i,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onSubscriptionClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"credit_detail",subscriptionId:i,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)}}}))(lt);function Ko(){const t=L(),e=A(),{credit_note_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:s}=_(),o=C((d=>ni(d,n??""))),c=o.fetchState==="Completed";return r.useEffect((()=>{s&&n!=null&&t(ti({id:n}))}),[s,n,t]),N(o.fetchState)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingCreditDetailPage,isReady:c}),a.jsx(Qo,{navigate:e,tenantEmailDomain:i,creditNoteId:n??"",detailView:o})]})}const Go=O((function(t){const e=fn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",creditNotes:e.creditNotes,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.creditNotes.length===0,isLoadingMore:n==="In-Progress"&&e.creditNotes.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"credits"}),e.navigate(`${n}/data_import`)},onCreditNoteClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingCreditNoteRowClicked,{creditNoteId:i}),e.navigate(`${n}/credits/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&t(oi({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(dt);function Zo(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),[s,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:f,appliedSearch:S,appliedSort:h,nextCursor:D,creditNoteListFetchState:b}=C((y=>{const I=fn(y);return{activeStatus:I.activeTab,appliedSearch:I.filters.search,appliedSort:I.sort,nextCursor:I.nextCursor,creditNoteListFetchState:I.fetchState}}),H),k=b==="Completed";return r.useEffect((()=>{const y=setTimeout((()=>d(s)),300);return()=>clearTimeout(y)}),[s]),r.useEffect((()=>{i&&t(Ke({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Ke({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,S,h]),N(b)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingCreditsListPage,isReady:k}),a.jsx(Go,{navigate:e,tenantEmailDomain:n,activeStatus:f,searchValue:s,sortState:l,filters:g,sort:u,nextCursor:D,onSearchChange:o,onStatusChange:y=>t(ii(y)),onSortChange:v})]})}const Qn=(t,e,n)=>{const i=`/${t}/invoicing/customers/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Wo=O((function(t,e){const{editView:n,hasLoadedRecord:i}=e;return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,hasUnsavedBillingAddress:n.hasUnsavedBillingAddress,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,customer:n.record.invoicingCustomer,invoices:n.record.invoices.slice(0,5),isLoading:!i&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"||n.isFormLoading),hasPaymentLinkEmailPreviewFailed:n.emailPreviewFetchState.fetchState==="Error",isPaymentLinkEmailPreviewLoading:n.emailPreviewFetchState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",paymentLinkEmailPreview:n.emailPreview,isSendingPaymentLink:n.record.sendLinkState.fetchState==="In-Progress",localData:n.localData,paymentMethods:n.record.paymentMethods,sendPaymentLinkErrorMessage:n.record.sendLinkState.fetchState==="Error"?n.record.sendLinkState.error?.message??"Failed to send payment link.":void 0,sentPaymentLinkEmail:n.record.sendLinkState.fetchState==="Completed"?n.record.sentPaymentLinkEmail:void 0,sentPaymentLinkMagicUrl:n.record.sendLinkState.fetchState==="Completed"?n.record.sentPaymentLinkMagicUrl:void 0,stripeConnected:n.record.stripeConnected}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e;return{onBack:()=>e.navigate(`${n}/customers`),onChange:s=>{t(be({id:i,localData:s}))},onCreateInvoice:()=>e.navigate(`${n}/invoices/create`),onInvoiceClick:s=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",invoiceId:s,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(s)}`)},onCreatePromotionalCredits:()=>e.onCreatePromotionalCredits(),onNewSubscription:()=>e.navigate(`${n}/subscriptions/new`),onDiscardEdit:()=>{t(X(le)),t(gi({id:i}))},onOpenAddress:()=>{const s=Qn(e.tenantEmailDomain??"",le,i),o=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(s,{state:{pathnameStackToGoBack:o}})},onOpenPaymentSettings:()=>e.navigate(`${n}/settings/payment-destination`),onSaveEdit:s=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerEdited,{customerId:i}),t(be({id:i,localData:s})),t(In({id:i}))},onFetchPaymentLinkEmailPreview:s=>t(ui({cacheOverride:s,customerId:i})),onSendPaymentLink:(s,o,c)=>t(di({body:c,customerId:i,email:s,subject:o})),onSubscriptionClick:s=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"customer_detail",subscriptionId:s,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(s)}`)}}}))(mt);function Xo(){const t=L(),e=A(),n=Z(),{customer_id:i,tenantEmailDomain:s}=R(),{areTenantIdsInSync:o}=_(),c=C((T=>$e(T,i))),d=c.pageFetchState.fetchState,l=d==="Completed"&&!c.isFormLoading,[v,u]=r.useState(!1),[g,f]=r.useState(!1),[S,h]=r.useState(l?i:void 0);r.useEffect((()=>{i!=null&&l&&h(i)}),[i,l]);const D=S===i,{plaidTokenFetchState:b,promotionalCreditSubmitState:k}=c,{paymentMethodSaveState:y,setupIntentFetchState:I,stripeConnected:j}=c.record,E=r.useRef(c.record.sendLinkState.fetchState);r.useEffect((()=>{const T=c.record.sendLinkState.fetchState;E.current!=="Error"&&T==="Error"&&t(ai({messageSection:"common",messageText:"failed",showStatusIcon:!0,type:"error"})),E.current=T}),[t,c.record.sendLinkState.fetchState]);const F=I.fetchState==="Error"?I.error?.message??"Failed to start card setup.":y.fetchState==="Error"?y.error?.message??"Failed to save payment method.":b.fetchState==="Error"?b.error?.message??"Failed to connect bank account.":void 0;r.useEffect((()=>(t(ee()),t(ne()),()=>{t(ee()),t(ne())})),[t]),r.useEffect((()=>{n.state?.openPromotionalCreditsDialog===!0&&(f(!0),e(n.pathname,{replace:!0,state:null}))}),[n.pathname,n.state,e]),r.useEffect((()=>{o&&i!=null&&t(si({id:i}))}),[o,i,t]),r.useEffect((()=>{o&&i!=null&&j&&t(Ge({customerId:i}))}),[o,i,t,j]);const P=r.useCallback((T=>t(hn({id:T}))),[t]),U=Se(c.fetchState,c.isFormLoading,i,P);return N(d)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingCustomerDetailPage,isReady:l}),a.jsx(Wo,{customerId:i??"",editView:c,hasLoadedRecord:D,location:n,navigate:e,tenantEmailDomain:s,onAddPaymentMethod:()=>{t(ee()),i!=null&&j&&t(Ge({customerId:i})),u(!0)},onCreatePromotionalCredits:()=>{t(ne()),f(!0)}},U),a.jsx(ut,{errorMessage:F,isCreatingSetupIntent:I.fetchState==="In-Progress",isSaving:y.fetchState==="In-Progress",open:v,plaidLinkToken:c.record.plaidLinkToken,saveSucceeded:y.fetchState==="Completed",setupIntent:c.record.setupIntent,stripeConnected:j,onChooseCard:()=>{i!=null&&t(ri({customerId:i}))},onClose:()=>{u(!1),t(ee())},onSavePaymentMethod:T=>{i!=null&&t(ci({customerId:i,data:T}))}}),a.jsx(gt,{currentBalance:c.record.invoicingCustomer?.promotionalCredits,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,errorMessage:k.fetchState==="Error"?k.error?.message??"Failed to add promotional credits.":void 0,isSubmitting:k.fetchState==="In-Progress",open:g,submitSucceeded:k.fetchState==="Completed",onClose:()=>{f(!1),t(ne())},onSubmit:({amount:T,description:Y})=>{i!=null&&t(li({amount:T,customerId:i,currencyCode:c.record.invoicingCustomer?.preferredCurrencyCode,description:Y}))}})]})}const Jo=O((function(t,e){const n=$e(t,e.customerId);return{fieldHelp:n.fieldHelp,billingAddressLabel:n.billingAddressLabel,customerTypeOptions:n.customerTypeOptions,netTermDayOptions:n.netTermDayOptions,taxabilityOptions:n.taxabilityOptions,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save customer.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{customerId:i}=e,s=i!=null?"edit":"create",o=i!=null?`${n}/customers/${encodeURIComponent(i)}`:`${n}/customers`;return{onBack:()=>e.navigate(o),onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerFormCancelled),t(Cn({id:i})),t(X(le)),e.navigate(`${n}/customers`)},onChange:c=>{t(be({id:i,localData:c}))},onOpenAddress:()=>{const c=Qn(e.tenantEmailDomain??"",le,i),d=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerSaved,{mode:s}),t(In({id:i}))}}}))(vt);function Yo(){const t=L(),e=A(),n=Z(),{customer_id:i,tenantEmailDomain:s}=R(),{areTenantIdsInSync:o}=_(),{fetchState:c,savedCustomerId:d}=C((l=>$e(l,i)));return r.useEffect((()=>{o&&i!=null&&t(hn({id:i}))}),[o,i,t]),r.useEffect((()=>{if(c==="Completed"){const l=d??i,v=l!=null?`/${s}/invoicing/customers/${encodeURIComponent(l)}`:`/${s}/invoicing/customers`;e(v),t(Cn({id:i}))}}),[c,d,i,t,e,s]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingCustomerFormPage}),a.jsx(Jo,{customerId:i,location:n,navigate:e,tenantEmailDomain:s})]})}const ea=O((function(t){const e=ve(t),{fetchState:n}=e;return{addressesById:t.addressState.addressesById,columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",customers:e.customers,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.customers.length===0,isLoadingMore:n==="In-Progress"&&e.customers.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onAddCustomer:()=>{p.trackInvoicingActionClick(m.Event.invoicingAddCustomerClicked),e.navigate(`${n}/customers/new`)},onCustomerClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingCustomerRowClicked,{customerId:i}),e.navigate(`${n}/customers/${encodeURIComponent(i)}`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"customers"}),e.navigate(`${n}/data_import`)},onRowAction:(i,s)=>{switch(s){case"createInvoice":e.navigate(`${n}/invoices/create?customerId=${encodeURIComponent(i)}`);break;case"newSubscription":e.navigate(`${n}/subscriptions/new?customerId=${encodeURIComponent(i)}`);break;case"createPromotionalCredits":e.navigate(`${n}/customers/${encodeURIComponent(i)}`,{state:{openPromotionalCreditsDialog:!0}})}},onLoadMore:()=>{e.nextCursor!=null&&t(En({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(pt);function na(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),[s,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:f,appliedSearch:S,appliedSort:h,nextCursor:D,customerListFetchState:b}=C((y=>{const I=ve(y);return{activeStatus:I.activeTab,appliedSearch:I.filters.search,appliedSort:I.sort,nextCursor:I.nextCursor,customerListFetchState:I.fetchState}}),H),k=b==="Completed";return r.useEffect((()=>{const y=setTimeout((()=>d(s)),300);return()=>clearTimeout(y)}),[s]),r.useEffect((()=>{i&&t(Ze({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Ze({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,S,h]),N(b)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingCustomersListPage,isReady:k}),a.jsx(ea,{navigate:e,tenantEmailDomain:n,activeStatus:f,searchValue:s,sortState:l,filters:g,sort:u,nextCursor:D,onSearchChange:o,onStatusChange:y=>t(mi(y)),onSortChange:v})]})}const Le=(t,e)=>e==null?void 0:t.sessionDetail[e]??t.sessions.find((n=>n.id===e)),ta=O((function(t,e){const{filters:n,sessionId:i,view:s}=e,o=i==null?void 0:s.diagnosticsBySession[i],c=o?.fetch.fetchState??"Not-Started";return{diagnostics:o?.items??[],errorMessage:c==="Error"?o?.fetch.error?.message:void 0,expired:o?.expired??!1,filters:n,hasMore:o?.nextCursor!=null,isLoading:c==="Not-Started"||c==="In-Progress",isLoadingMore:c==="In-Progress"&&(o?.items.length??0)>0,session:Le(s,i)}}),(function(t,e){const{downloadUrl:n,filters:i,navigate:s,sessionId:o,tenantEmailDomain:c,view:d}=e,l=o==null?void 0:d.diagnosticsBySession[o],v=Le(d,o),u=d.actionStateByKind.retry?.fetchState==="In-Progress",g=d.actionStateByKind.rollback?.fetchState==="In-Progress",f=v?.status==="done"&&v.rollback_available_until!=null&&new Date(v.rollback_available_until).getTime()>Date.now()&&!g;return{onBack:()=>s(`/${c}/invoicing/data_import`),onDownloadCsv:()=>{n!=null&&window.open(n,"_blank","noopener")},onFiltersChange:e.onFiltersChange,onLoadMore:()=>{o!=null&&l?.nextCursor!=null&&t(De({...i,cursor:l.nextCursor,sessionId:o}))},onRetry:v?.status!=="failed"||u?void 0:()=>{o!=null&&t(we(o))},onRollback:f?()=>{o!=null&&t(kn(o))}:void 0}}))(St);function ia(){const t=L(),e=A(),{sessionId:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:s}=_(),[o,c]=r.useState({}),d=C(Fe),l=Le(d,n),v=n==null?void 0:d.diagnosticsBySession[n];r.useEffect((()=>{s&&n!=null&&t(je(n))}),[s,t,n]),r.useEffect((()=>{if(!s||n==null)return;const S=setTimeout((()=>{t(De({...o,sessionId:n}))}),300);return()=>clearTimeout(S)}),[s,t,o,n]);const u=l?.status==="scanning"||l?.status==="importing";r.useEffect((()=>{if(!s||n==null||!u)return;const S=setInterval((()=>{t(je(n)),t(De({...o,sessionId:n}))}),3e3);return()=>clearInterval(S)}),[s,t,o,u,n]);const g=r.useMemo((()=>{if(n==null)return;const S=new URLSearchParams;o.moduleId!=null&&S.set("module_id",o.moduleId),o.level!=null&&S.set("level",o.level),o.outcome!=null&&S.set("outcome",o.outcome),o.search!=null&&o.search.trim()!==""&&S.set("search",o.search.trim());const h=S.toString();return`${ae?.invoicingMicroServiceBaseUrl??""}/1.0/data-import/${encodeURIComponent(n)}/issues.csv${h===""?"":`?${h}`}`}),[o,n]),f=v?.fetch.fetchState??"Not-Started";return N(f)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingDataImportHubPage,isReady:l!=null&&f!=="Not-Started"}),a.jsx(ta,{downloadUrl:g,filters:o,navigate:e,sessionId:n,tenantEmailDomain:i,view:d,onFiltersChange:c})]})}const Kn=t=>`invoicing_active_migration:${t}`,oe=(t,e)=>{if(t!=null&&t!=="")try{const n=Kn(t);e==null?sessionStorage.removeItem(n):sessionStorage.setItem(n,e)}catch{}},oa=O((function(t,e){const{sessions:n,sessionsFetch:i,statusFetch:s,statusRows:o}=e.view;return{isLoading:!(s.fetchState!=="Not-Started"&&s.fetchState!=="In-Progress"||o.length!==0||i.fetchState!=="Not-Started"&&i.fetchState!=="In-Progress"),sessions:n,statusRows:o}}),(function(t,e){const{navigate:n,tenantEmailDomain:i}=e,s=o=>{const c=o??null;t(ie(c)),oe(i,c),n(`/${i}/invoicing/data_import/migrate`)};return{onContinueSession:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"continue",sessionId:o}),s(o)},onNewImport:()=>{p.trackInvoicingActionClick(m.Event.invoicingNewImportClicked),s()},onRetrySession:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"retry",sessionId:o}),t(we(o)),s(o)},onRollbackSession:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"rollback",sessionId:o}),t(kn(o))},onViewSession:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportSessionAction,{action:"view_details",sessionId:o}),n(`/${i}/invoicing/data_import/${encodeURIComponent(o)}`)}}}))(ft);function aa(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),s=C(Fe);r.useEffect((()=>{i&&(t(vi()),t(yn()))}),[i,t]);const o=s.statusFetch.fetchState==="Completed"&&s.sessionsFetch.fetchState==="Completed";return a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingDataImportHubPage,isReady:o}),a.jsx(oa,{navigate:e,tenantEmailDomain:n,view:s})]})}const sa=O((function(t,e){const{activeId:n,integrationsView:i,settings:s,view:o}=e,{actionStateByKind:c,sessionDetail:d,sessions:l}=o,v=i.externalConnections?.revenue?.find((g=>g.connectionName==="chargebee")),u=n!=null?d[n]:void 0;return{chargebeeConnected:s?.chargebee_connected===!0||(v?.isValid??!1),chargebeeConnectorAvailable:v!=null,chargebeeSite:s?.chargebee_site,connectError:c.connect?.error?.message,connecting:c.connect?.fetchState==="In-Progress",retrying:c.retry?.fetchState==="In-Progress",session:u??l.find((g=>g.id===n)),starting:c.start?.fetchState==="In-Progress",uploading:c.upload?.fetchState==="In-Progress"}}),(function(t,e){const{activeId:n,navigate:i,tenantEmailDomain:s}=e;return{onBack:e.onBack,onDownloadTemplates:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportTemplatesDownloaded);const o=ae?.invoicingMicroServiceBaseUrl,c=o!=null&&o.length>0?o:"";window.open(`${c}/1.0/data-import/templates`,"_blank","noopener")},onFetchFromChargebee:()=>{p.trackInvoicingActionClick(m.Event.invoicingChargebeeConnectClicked),t(fi())},onGoToIntegrations:()=>{i(`/${s}/invoicing/settings`)},onGoToOverview:()=>i(`/${s}/invoicing/overview`),onRetry:()=>{n!=null&&t(we(n))},onSaveLater:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportSavedForLater),e.onBack()},onStartImport:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportStarted),n!=null&&t(Si(n))},onUpload:o=>{p.trackInvoicingActionClick(m.Event.invoicingImportFileUploaded),t(pi({files:o}))},onViewDetails:n==null?void 0:()=>i(`/${s}/invoicing/data_import/${encodeURIComponent(n)}`)}}))(ht);function ca(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),s=C(pn),o=C(Re).companyId??ke.getSignedInUserTenant(n??"")?.companyId,c=C((S=>xn(S,o))),d=C(Fe),{activeMigrationSessionId:l}=d,v=l??void 0,u=v!=null?d.sessionDetail[v]??d.sessions.find((S=>S.id===v)):void 0;r.useEffect((()=>{i&&(t(_e()),t(yn()))}),[i,t]),r.useEffect((()=>{if(l!=null)return;const S=(h=>{if(h==null||h==="")return null;try{return sessionStorage.getItem(Kn(h))}catch{return null}})(n);S!=null&&t(ie(S))}),[l,t,n]),r.useEffect((()=>{oe(n,l)}),[l,n]);const g=u?.status,f=g==="scanning"||g==="importing";return r.useEffect((()=>{if(!i||v==null||!f)return;const S=setInterval((()=>{t(je(v))}),3e3);return()=>clearInterval(S)}),[i,v,f,t]),r.useEffect((()=>{g==="done"&&(t(ie(null)),oe(n,null))}),[t,g,n]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingDataImportMigratePage}),a.jsx(sa,{activeId:v,integrationsView:c,navigate:e,settings:s,tenantEmailDomain:n,view:d,onBack:()=>{t(ie(null)),oe(n,null),e(`/${n}/invoicing/data_import`)}})]})}const ra=O((function(t,e){const{editView:n}=e;return{fieldHelp:n.fieldHelp,coupon:n.coupon,discountLifecycleActionOptions:e.discountLifecycleActionOptions,discountsAccountName:n.discountsAccountName,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isRunningLifecycleAction:e.isRunningLifecycleAction,isSaving:n.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{couponId:i}=e;return{onBack:()=>e.navigate(`${n}/discounts`),onLifecycleAction:s=>{t(bn({action:s,id:i}))},onSaveEdit:s=>{p.trackInvoicingActionClick(m.Event.invoicingCouponEdited,{couponId:i}),t(Ii({data:s,id:i}))}}}))(It);function la(){const t=L(),e=A(),{coupon_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:s}=_(),o=C((h=>hi(h,n))),c=o.actionState.fetchState==="In-Progress",d=o.pageFetchState.fetchState,l=d==="Completed",[v,u]=r.useState(l?n:void 0);r.useEffect((()=>{n!=null&&l&&u(n)}),[n,l]);const g=v===n;r.useEffect((()=>(t(re({id:n})),()=>{t(re({id:n}))})),[n,t]),r.useEffect((()=>{s&&t(xe({id:n}))}),[s,n,t]);const f=r.useCallback((h=>t(xe({cacheOverride:!0,id:h}))),[t]),S=Se(o.fetchState,o.isFormLoading,n,f);return N(d)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingDiscountDetailPage,isReady:l}),a.jsx(ra,{hasLoadedRecord:g,couponId:n??"",discountLifecycleActionOptions:o.discountLifecycleActionOptions,editView:o,isRunningLifecycleAction:c,navigate:e,tenantEmailDomain:i},S)]})}const da=O((function(t){const e=jn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,discountLifecycleActionOptions:e.discountLifecycleActionOptions,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",coupons:e.coupons,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.coupons.length===0,isLoadingMore:n==="In-Progress"&&e.coupons.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onStatusChange:e.onStatusChange,onSortChange:e.onSortChange,onCouponClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingDiscountRowClicked,{couponId:i}),e.navigate(`${n}/discounts/${encodeURIComponent(i)}`)},onCreateCoupon:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreateCouponClicked),e.navigate(`${n}/discounts/new`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"discounts"}),e.navigate(`${n}/data_import`)},onDiscountLifecycleAction:(i,s)=>{t(bn({action:s,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&t(Ei({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Ct);function ua(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),[s,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:f,appliedSearch:S,appliedSort:h,nextCursor:D,couponListFetchState:b,runningDiscountActionId:k}=C((I=>{const j=jn(I);return{activeStatus:j.activeTab,appliedSearch:j.filters.search,appliedSort:j.sort,nextCursor:j.nextCursor,couponListFetchState:j.fetchState,runningDiscountActionId:j.runningActionId??null}}),H),y=b==="Completed";return r.useEffect((()=>{const I=setTimeout((()=>d(s)),300);return()=>clearTimeout(I)}),[s]),r.useEffect((()=>{i&&t(We({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==h?.field||u?.dir!==h?.dir)&&t(We({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,S,h]),N(b)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingDiscountsListPage,isReady:y}),a.jsx(da,{navigate:e,tenantEmailDomain:n,activeStatus:f,searchValue:s,sortState:l,filters:g,sort:u,nextCursor:D,runningDiscountActionId:k,onSearchChange:o,onStatusChange:I=>t(Ci(I)),onSortChange:v})]})}const ga=O((function(t,e){const{readView:n}=e;return{fieldHelp:e.readView.fieldHelp,caseId:e.caseId,dunningAttempts:e.dunningAttempts,dunningCase:n.dunningCase,isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress",isRunningAction:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{caseId:i}=e,s=i!=="";return{onBack:()=>e.navigate(`${n}/dunning`),onInvoiceClick:o=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{caseId:i,fromScreen:"dunning_detail",invoiceId:o,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(o)}`)},onCancel:s?()=>t(q({action:"cancel",id:i})):void 0,onResolve:s?()=>{p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"resolve",caseId:i}),t(q({action:"resolve",id:i}))}:void 0,onResume:s?()=>{p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"resume",caseId:i}),t(q({action:"resume",id:i}))}:void 0,onRetry:s?()=>{p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"retry",caseId:i}),t(q({action:"retry",id:i}))}:void 0}}))(kt);function ma(){const t=L(),e=A(),{case_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:s}=_(),o=C((E=>ki(E,n??""))),c=o.fetchState==="Completed",d=o.dunningCase?.invoiceID,[l,v]=r.useState("idle"),[u,g]=r.useState(!1),[f,S]=r.useState(),[h,D]=r.useState(!1),b=r.useCallback((()=>{v("idle"),g(!1),S(void 0),D(!1)}),[]),k=r.useCallback((()=>{if(n==null)return;t(yi({id:n})),v("idle"),g(!1);const E=o.emailPreview.preview;S(E==null?void 0:{body:E.body,cc:E.cc,subject:E.subject,to:E.to}),D(!0)}),[n,t,o.emailPreview.preview]),y=r.useCallback((E=>{n!=null&&l!=="pending"&&(g(!1),v("pending"),p.trackInvoicingActionClick(m.Event.invoicingDunningAction,{action:"send-email",caseId:n}),t(q({action:"send-email",body:E,id:n})))}),[n,t,l]),I=r.useMemo((()=>o.emailPreview.preview==null?void 0:{bodyToken:o.emailPreview.preview.bodyToken,renderedHtmlTemplate:o.emailPreview.preview.renderedHtmlTemplate,subjectToken:o.emailPreview.preview.subjectToken}),[o.emailPreview.preview]);r.useEffect((()=>{s&&n!=null&&t(xi({id:n}))}),[s,n,t]),r.useEffect((()=>{s&&d!=null&&t(Te({invoiceId:d}))}),[s,d,t]),r.useEffect((()=>{v("idle"),g(!1),S(void 0),D(!1)}),[n]),r.useEffect((()=>{s||(v("idle"),g(!1),S(void 0),D(!1))}),[s]),r.useEffect((()=>{h&&f==null&&o.emailPreview.preview!=null&&S({body:o.emailPreview.preview.body,cc:o.emailPreview.preview.cc,subject:o.emailPreview.preview.subject,to:o.emailPreview.preview.to})}),[o.emailPreview.preview,f,h]),r.useEffect((()=>{l==="pending"&&(o.actionState.fetchState!=="In-Progress"?u&&o.actionState.fetchState==="Completed"?(n!=null&&t(bi({id:n})),b()):u&&o.actionState.fetchState==="Error"&&v("failed"):g(!0))}),[n,b,t,l,u,o.actionState.fetchState]);const j=d!=null&&o.linkedInvoice?.id===d?o.linkedInvoice.dunningAttempts:void 0;return N(o.fetchState)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingDunningDetailPage,isReady:c}),a.jsx(ga,{navigate:e,tenantEmailDomain:i,caseId:n??"",readView:o,dunningAttempts:j,onSendEmail:k}),a.jsx(Et,{initialDraft:f,isPreviewLoading:o.emailPreview.fetchState==="Not-Started"||o.emailPreview.fetchState==="In-Progress",isSending:l==="pending",onClose:b,onSend:y,open:h,preview:I,previewErrorMessage:o.emailPreview.fetchState==="Error"?o.emailPreview.error?.message:void 0,sendErrorMessage:l==="failed"?o.actionState.error?.message:void 0})]})}const va=O((function(t){const e=Dn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",dunningCases:e.dunningCases,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.dunningCases.length===0,isLoadingMore:n==="In-Progress"&&e.dunningCases.length>0,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onImportCsv:()=>e.navigate(`${n}/data_import`),onDunningCaseClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingDunningCaseRowClicked,{caseId:i}),e.navigate(`${n}/dunning/${encodeURIComponent(i)}`)},onRowAction:(i,s)=>{s!=="retry"&&s!=="resume"&&s!=="resolve"&&s!=="cancel"||t(q({action:s,id:i}))},onLoadMore:()=>{e.nextCursor!=null&&t(Di({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(yt);function pa(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),[s,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:f,appliedSearch:S,appliedSort:h,nextCursor:D,dunningCaseListFetchState:b}=C((y=>{const I=Dn(y);return{activeStatus:I.activeTab,appliedSearch:I.filters.search,appliedSort:I.sort,nextCursor:I.nextCursor,dunningCaseListFetchState:I.fetchState}}),H),k=b==="Completed";return r.useEffect((()=>{const y=setTimeout((()=>d(s)),300);return()=>clearTimeout(y)}),[s]),r.useEffect((()=>{i&&t(Xe({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Xe({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,S,h]),N(b)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingDunningListPage,isReady:k}),a.jsx(va,{navigate:e,tenantEmailDomain:n,activeStatus:f,searchValue:s,sortState:l,filters:g,sort:u,nextCursor:D,onSearchChange:o,onStatusChange:y=>t(ji(y)),onSortChange:v})]})}const Sa=O((function(t,e){const{view:n}=e;return{fieldHelp:e.view.fieldHelp,billingAddress:n.billingAddress,invoice:n.invoice,invoiceId:e.invoiceId,shippingAddress:n.shippingAddress,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"),isSaving:n.actionState.fetchState==="In-Progress",isVoiding:n.actionState.fetchState==="In-Progress"}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{invoiceId:i}=e;return{onBack:()=>e.navigate(`${n}/invoices`),onCustomerClick:s=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:s,fromScreen:"invoice_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(s)}`)},onIssueCreditNote:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreditNoteIssued,{invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`)},onRecordPayment:()=>{p.trackInvoicingActionClick(m.Event.invoicingRecordPaymentClicked,{fromScreen:"invoice_detail",invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`)},onRegenerate:()=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceRegenerated,{invoiceId:i}),t(V({action:"regenerate",invoiceId:i}))},onSaveEdit:s=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceEdited,{invoiceId:i}),t(Ai({data:{due_date:s.due_date!==""?s.due_date:void 0,notes:s.notes.trim()!==""?s.notes.split(`
|
|
2
|
+
`).map((o=>o.trim())).filter((o=>o!=="")).map((o=>({note:o}))):void 0,po_number:s.po_number!==""?s.po_number:null},invoiceId:i}))},onSendReminder:()=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceReminderSent,{invoiceId:i}),t(V({action:"send-reminder",invoiceId:i}))},onSubscriptionClick:s=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"invoice_detail",subscriptionId:s,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(s)}`)},onVoid:s=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceVoided,{invoiceId:i}),t(V({action:"void",invoiceId:i,body:s}))}}}))(xt);function fa(){const t=L(),e=A(),{invoice_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:s}=_(),o=C((g=>Ln(g,n??""))),c=o.pageFetchState.fetchState,d=c==="Completed",[l,v]=r.useState(d?n:void 0);r.useEffect((()=>{n!=null&&d&&v(n)}),[n,d]);const u=l===n;return r.useEffect((()=>{s&&n!=null&&t(Li({invoiceId:n}))}),[s,n,t]),N(c)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingInvoiceDetailPage,isReady:d}),a.jsx(Sa,{invoiceId:n??"",hasLoadedRecord:u,navigate:e,tenantEmailDomain:i,view:o})]})}const ha=O((function(t){const e=An(t),{fetchState:n}=e;return{counts:e.counts,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,invoices:e.invoices,statusOptions:e.statusOptions,isLoading:n==="Not-Started"||n==="In-Progress"&&e.invoices.length===0,isLoadingMore:n==="In-Progress"&&e.invoices.length>0,kpis:e.kpis,kpisLoading:e.kpisFetchState.fetchState==="Not-Started"||e.kpisFetchState.fetchState==="In-Progress"&&e.kpis==null,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onCreateInvoice:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreateInvoiceClicked),e.navigate(`${n}/invoices/create`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"invoices"}),e.navigate(`${n}/data_import`)},onInvoiceClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceRowClicked,{invoiceId:i}),e.navigate(`${n}/invoices/${encodeURIComponent(i)}`)},onRowAction:(i,s)=>{switch(s){case"recordPayment":e.navigate(`${n}/invoices/${encodeURIComponent(i)}/record-payment`);break;case"issueCreditNote":e.navigate(`${n}/invoices/${encodeURIComponent(i)}/issue-credit-note`);break;case"sendReminder":t(V({action:"send-reminder",invoiceId:i}));break;case"regenerate":t(V({action:"regenerate",invoiceId:i}));break;case"void":t(V({action:"void",invoiceId:i}))}},onVoidInvoice:(i,s)=>{p.trackInvoicingActionClick(m.Event.invoicingInvoiceVoided,{invoiceId:i}),t(V({action:"void",invoiceId:i,body:s}))},onLoadMore:()=>{e.nextCursor!=null&&t(Pn({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(bt);function Ia(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),[s,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:f,appliedSearch:S,appliedSort:h,nextCursor:D,invoiceListFetchState:b,voidingInvoiceId:k}=C((I=>{const j=An(I);return{activeStatus:j.activeTab,appliedSearch:j.filters.search,appliedSort:I.invoicingInvoiceListState.sort,nextCursor:j.nextCursor,invoiceListFetchState:j.fetchState,voidingInvoiceId:j.runningActionId}}),H),y=b==="Completed";return r.useEffect((()=>{const I=setTimeout((()=>d(s)),300);return()=>clearTimeout(I)}),[s]),r.useEffect((()=>{i&&t(Ie({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Ie({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,S,h]),N(b)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingInvoicesListPage,isReady:y}),a.jsx(ha,{navigate:e,tenantEmailDomain:n,activeStatus:f,searchValue:s,sortState:l,filters:g,sort:u,nextCursor:D,voidingInvoiceId:k,onSearchChange:o,onStatusChange:I=>{t(Pi(I)),t(Ie({cacheOverride:!1,filters:g,sort:u}))},onSortChange:v})]})}function an(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),i=jt(),s=ln(),[o,c]=r.useState(!1),{acceptTermsState:d,status:l}=C($n),v=$i(i?.loggedInUserRoleMap),u=`/${n}/invoicing`,g=f=>{c(f)};return l==="completed"?a.jsx(B,{to:`${u}/overview`,replace:!0}):l==="settings"&&v?a.jsx(B,{to:`${u}/settings`,replace:!0}):a.jsxs(a.Fragment,{children:[a.jsx(Po,{isAppContentDrawerOpen:o,handleDrawerToggle:g}),a.jsx(Dt,{analytics:p,isAccepting:d.fetchState==="In-Progress",isReadOnlyUser:!v,meetingUrl:s("invoicing_promo"),onAcceptClick:()=>{t(Fi())},onBackClick:()=>{e(`/${n}`)},onClickMenuIcon:()=>{g(!0)}})]})}const Ca=O((function(t,e){const n=Fn(t,e.invoiceId),{invoice:i,localData:s,reasonCodeOptions:o,submitState:c,typeOptions:d}=n;return{fieldHelp:n.fieldHelp,amountDue:i?.amountDue,currencyCode:i?.currencyCode??"USD",customerName:i?.customerName??"",errorMessage:c.fetchState==="Error"?c.error?.message??"Failed to issue credit note. Please try again.":void 0,invoiceNumber:i?.invoiceNumber??e.invoiceId,isSubmitting:c.fetchState==="In-Progress",localData:s,reasonCodeOptions:o,typeOptions:d}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing/invoices/${encodeURIComponent(e.invoiceId)}`,i=()=>e.navigate(n);return{onBack:i,onCancel:i,onChange:s=>{t(Oi({localData:s}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingCreditNoteIssued,{invoiceId:e.invoiceId}),t(Ti())}}}))(Lt);function Ea(){const t=L(),e=A(),{invoice_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:s}=_(),{fetchState:o,invoice:c,isPageReady:d,issuedCreditNoteId:l,submitState:v}=C((S=>Fn(S,n??""))),u=`/${i}/invoicing`,g=r.useRef(null);r.useEffect((()=>{t(wi()),g.current=null}),[t,n]),r.useEffect((()=>{s&&n!=null&&t(Te({invoiceId:n}))}),[s,t,n]),r.useEffect((()=>{c!=null&&n!=null&&o==="Completed"&&g.current!==n&&(g.current=n,t(Ri({localData:_i(c)})))}),[t,o,c,n]);const f=r.useRef(v.fetchState);return r.useEffect((()=>{const S=f.current;f.current=v.fetchState,S!=="Completed"&&v.fetchState==="Completed"&&l!=null&&e(`${u}/credits/${encodeURIComponent(l)}`)}),[l,e,v.fetchState,u]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingInvoiceDetailPage,isReady:d}),a.jsx(Ca,{invoiceId:n??"",navigate:e,tenantEmailDomain:i})]})}const ka=O((function(t){return{invoicingOverview:wn(t)}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{onRefresh:()=>{t(Rn(e.selectedPeriod,!0))},onSubscriptionClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionTileClicked,{subscriptionId:i}),e.navigate(`${n}/subscriptions/${i}`)},onViewInvoices:()=>{p.trackInvoicingActionClick(m.Event.invoicingViewInvoicesClicked),e.navigate(`${n}/invoices`)},onViewPayments:()=>{p.trackInvoicingActionClick(m.Event.invoicingViewPaymentsClicked),e.navigate(`${n}/payments`)}}}))(At);function ya(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),[s]=r.useState((()=>{const c=new Date;return{month:c.getMonth()+1,year:c.getFullYear()}})),o=C((c=>wn(c).fetchState))==="Completed";return r.useEffect((()=>{i&&t(Rn(s))}),[i,t,s]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingOverviewPage,isReady:o}),a.jsx(ka,{navigate:e,selectedPeriod:s,tenantEmailDomain:n})]})}const xa=O((function(t){const e=_n(t),{fetchState:n}=e;return{columns:e.columns,hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.transactions.length===0,isLoadingMore:n==="In-Progress"&&e.transactions.length>0,tabIds:e.tabIds,transactions:e.transactions}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`;return{activeType:e.activeType,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onTypeChange:e.onTypeChange,onViewTransactionCustomer:e.onViewTransactionCustomer,onViewTransactionInvoice:e.onViewTransactionInvoice,onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"payments"}),e.navigate(`${n}/data_import`)},onTransactionClick:i=>{p.trackInvoicingActionClick(m.Event.invoicingPaymentRowClicked,{transactionId:i}),e.navigate(`${n}/payments/${encodeURIComponent(i)}`)},onLoadMore:()=>{e.nextCursor!=null&&t(Ni({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Pt);function ba(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),[s,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeType:f,appliedSearch:S,appliedSort:h,nextCursor:D,transactionListFetchState:b,transactions:k}=C((F=>{const P=_n(F);return{activeType:P.activeTab,appliedSearch:P.filters.search,appliedSort:P.sort,nextCursor:P.nextCursor,transactionListFetchState:P.fetchState,transactions:P.transactions}}),H),y=b==="Completed",I=`/${n}/invoicing`,j=r.useCallback((F=>{const P=k.find((T=>T.id===F)),U=P?.linkedInvoices?.[0]?.invoiceID??P?.invoiceID;U!=null&&(p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"payments_list",invoiceId:U,toScreen:"invoice"}),e(`${I}/invoices/${encodeURIComponent(U)}`))}),[e,I,k]),E=r.useCallback((F=>{const P=k.find((U=>U.id===F))?.customerID;P!=null&&(p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:P,fromScreen:"payments_list",toScreen:"customer"}),e(`${I}/customers/${encodeURIComponent(P)}`))}),[e,I,k]);return r.useEffect((()=>{const F=setTimeout((()=>d(s)),300);return()=>clearTimeout(F)}),[s]),r.useEffect((()=>{i&&t(Ce({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Ce({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,S,h]),N(b)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingPaymentsListPage,isReady:y}),a.jsx(xa,{navigate:e,tenantEmailDomain:n,activeType:f,searchValue:s,sortState:l,filters:g,sort:u,nextCursor:D,onSearchChange:o,onTypeChange:F=>{t(Mi(F)),t(Ce({cacheOverride:!1,filters:g,sort:u}))},onSortChange:v,onViewTransactionCustomer:E,onViewTransactionInvoice:j})]})}const ja=t=>{const e=[t.firstName,t.lastName].filter((n=>n!=null&&n.trim()!=="")).join(" ").trim();return(t.company!=null&&t.company.trim()!==""?t.company.trim():"")||e||(t.email!=null&&t.email.trim()!==""?t.email.trim():"")||t.id};function sn(){const t=L(),e=A(),{invoice_id:n,tenantEmailDomain:i}=R(),{areTenantIdsInSync:s}=_(),o=n!=null&&n!=="",c=C(ve),d=C((E=>Ui(E))),l=C(Bi),v=C((E=>Ln(E,n??""))),u=v.invoice,g=`/${i}/invoicing`,f=r.useRef(null),S=r.useRef("");r.useEffect((()=>{t(Vi()),f.current=null,S.current=""}),[t,n]),r.useEffect((()=>{s&&t(o&&n!=null?Te({invoiceId:n}):En({filters:{},keepExistingListItems:!1}))}),[s,t,n,o]),r.useEffect((()=>{o&&u!=null&&n!=null&&v.fetchState==="Completed"&&f.current!==n&&(f.current=n,t(Hi({contextInvoiceId:n,localData:qi(u)})))}),[t,u,n,v.fetchState,o]),r.useEffect((()=>{if(o)return;const E=d.localData.customerId;E!==""&&E!==S.current&&(S.current=E,t(Pn({filters:{customerId:E},keepExistingListItems:!1})),d.localData.invoiceToLink!==""&&t(Je({localData:{...d.localData,customerId:E,invoiceToLink:""}})))}),[t,d.localData,o]);const h=r.useRef(l.fetchState);r.useEffect((()=>{const E=h.current;if(h.current=l.fetchState,E!=="Completed"&&l.fetchState==="Completed"){if(l.recordedInvoiceId!=null)return void e(`${g}/invoices/${encodeURIComponent(l.recordedInvoiceId)}`);e(`${g}/payments`)}}),[e,l.fetchState,l.recordedInvoiceId,g]);const D=r.useMemo((()=>c.customers.map((E=>({id:E.id,name:ja(E)})))),[c.customers]),b=C((E=>zi(E,d.localData.customerId))),k=r.useMemo((()=>b.map((E=>{return{amountDue:(F=E.amountDue,P=Qi.currencySymbol,wt("0,0.00",F,P)),amountDueValue:E.amountDue,id:E.id,label:E.invoiceNumber};var F,P}))),[b]),y=r.useMemo((()=>{if(!o||u==null)return;const E=u.currencyCode??"USD",F=u.amountDue?.amount??0;return{amountDue:$t("0,0.00",u.amountDue),amountDueValue:F,currencyCode:E,customerName:u.customerName??u.customerID,invoiceId:u.id,invoiceNumber:u.invoiceNumber??u.id}}),[u,o]),I=o?`${g}/invoices/${encodeURIComponent(n??"")}`:`${g}/payments`,j=!o||v.fetchState==="Completed"&&d.localData.invoiceToLink!=="";return a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingRecordPaymentPage,isReady:j}),a.jsx(Ft,{customers:D,fieldHelp:d.fieldHelp,errorMessage:l.fetchState==="Error"?l.error?.message??"Failed to record payment. Please try again.":void 0,gatewayOptions:d.gatewayOptions,invoiceContext:y,invoiceOptions:k,isSubmitting:l.fetchState==="In-Progress",localData:d.localData,mode:o?"invoice":"customer",paymentMethodOptions:d.paymentMethodOptions,onBack:()=>{e(I)},onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingRecordPaymentCancelled),e(I)},onChange:E=>{t(Je({localData:E}))},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingPaymentRecorded,{customerId:d.localData.customerId,invoiceId:o?n:d.localData.invoiceToLink,paymentMethod:d.localData.paymentMethod}),t(Ki(o?n??void 0:void 0))}})]})}const Gn=(t,e,n)=>{const i=`/${t}/invoicing/subscriptions/`;return n!=null?`${i}${encodeURIComponent(n)}/${e}/`:`${i}new/${e}/`},Da=O((function(t,e){const{editView:n}=e,i=n.subscription,s=i?.status,o=s!=null&&e.commercialEditAllowedFromStatuses.includes(s);return{cancelReasonCodeOptions:n.cancelReasonCodeOptions,fieldHelp:n.fieldHelp,addons:n.addons,canEditCommercial:o,charges:n.charges,coupons:n.coupons,isLoading:!e.hasLoadedRecord&&(n.pageFetchState.fetchState==="Not-Started"||n.pageFetchState.fetchState==="In-Progress"||n.isFormLoading),isRunningAction:n.actionState.fetchState==="In-Progress",isSaving:n.fetchState==="In-Progress",lifecycleActionOptions:e.lifecycleActionOptions,localData:n.localData,plans:n.plans,shippingAddressLabel:n.shippingAddressLabel,hasUnsavedShippingAddress:n.hasUnsavedShippingAddress,subscription:i}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,s=i!=="",o=(c,d)=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionLifecycleAction,{action:c,subscriptionId:i}),t(On({action:c,id:i,body:d}))};return{onBack:()=>e.navigate(`${n}/subscriptions`),onChange:c=>{t(de({id:i,localData:c}))},onChangeTermEnd:s?c=>{const d=c?.trim()??"";d!==""&&o("change_term_end",{term_ends_at:d})}:void 0,onCustomerClick:c=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:c,fromScreen:"subscription_detail",toScreen:"customer"}),window.open(`${n}/customers/${encodeURIComponent(c)}`,"_blank","noopener,noreferrer")},onDiscardEdit:()=>{t(X(ue)),t(Wi({id:i}))},onOpenAddress:()=>{const c=Gn(e.tenantEmailDomain??"",ue,i),d=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(c,{state:{pathnameStackToGoBack:d}})},onViewInvoices:()=>e.navigate(`${n}/invoices`),onSaveEdit:c=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionEdited,{subscriptionId:i}),t(de({id:i,localData:c})),t(Tn({id:i}))},onCancelSubscription:s?c=>{o("cancel",{cancel_reason_code:c.cancelReasonCode,end_of_term:!1,...c.cancelReason!=null&&c.cancelReason.trim()!==""?{cancel_reason:c.cancelReason.trim()}:{}})}:void 0,onLifecycleAction:s?(c,d)=>{c!=="pause"?o(c):o(c,d!=null&&d.trim()!==""?{resume_date:d.trim()}:void 0)}:void 0}}))(Rt);function La(){const t=L(),e=A(),n=Z(),{subscription_id:i,tenantEmailDomain:s}=R(),{areTenantIdsInSync:o}=_(),c=C((k=>Oe(k,i))),{subscriptionCommercialEditAllowedFromStatuses:d,subscriptionLifecycleActionOptions:l,subscriptionMetadataEditAllowedFromStatuses:v}=c,u=c.pageFetchState.fetchState,g=u==="Completed"&&!c.isFormLoading,[f,S]=r.useState(g?i:void 0);r.useEffect((()=>{i!=null&&g&&S(i)}),[i,g]);const h=f===i;pe(o),r.useEffect((()=>{o&&i!=null&&t(Gi({id:i}))}),[o,i,t]);const D=r.useCallback((k=>t(Zi({id:k}))),[t]),b=Se(c.fetchState,c.isFormLoading,i,D);return N(u)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingSubscriptionDetailPage,isReady:g}),a.jsx(Da,{hasLoadedRecord:h,commercialEditAllowedFromStatuses:d,editView:c,lifecycleActionOptions:l,location:n,metadataEditAllowedFromStatuses:v,navigate:e,subscriptionId:i??"",tenantEmailDomain:s},b)]})}const Aa=O((function(t,e){const n=Oe(t,e.subscriptionId);return{fieldHelp:n.fieldHelp,addons:n.addons,charges:n.charges,coupons:n.coupons,customers:n.customers,errorMessage:n.fetchState==="Error"?n.error?.message??"Failed to save subscription.":void 0,isSubmitting:n.fetchState==="In-Progress",isLoading:n.isFormLoading,localData:n.localData,mode:n.mode,plans:n.plans,shippingAddressLabel:n.shippingAddressLabel}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{subscriptionId:i}=e,s=i!=null?"edit":"create";return{onCancel:()=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionFormCancelled),t(Mn({id:i})),t(X(ue)),i==null?e.navigate(`${n}/subscriptions`):e.navigate(`${n}/subscriptions/${encodeURIComponent(i)}`)},onChange:o=>{t(de({id:i,localData:o}))},onOpenAddress:()=>{const o=Gn(e.tenantEmailDomain??"",ue,i),c=W(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(o,{state:{pathnameStackToGoBack:c}})},onSubmit:()=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionSaved,{mode:s}),t(Tn({id:i}))}}}))(_t);function Pa(){const t=L(),e=A(),n=Z(),{subscription_id:i,tenantEmailDomain:s}=R(),[o]=G(),{areTenantIdsInSync:c}=_(),d=o.get("customerId"),{fetchState:l,savedSubscriptionId:v}=C((f=>Xi(f,i))),u=C((f=>Oe(f,i).localData));pe(c),r.useEffect((()=>{c&&t(Ji({subscriptionId:i}))}),[c,i,t]);const g=r.useRef(!1);return r.useEffect((()=>{g.current||i!=null||d==null||d===""||u.customerId!==""||(g.current=!0,t(de({id:i,localData:{...u,customerId:d}})))}),[d,i,u,t]),r.useEffect((()=>{if(l==="Completed"){const f=v??i,S=f!=null?`/${s}/invoicing/subscriptions/${encodeURIComponent(f)}`:`/${s}/invoicing/subscriptions`;e(S),t(Mn({id:i}))}}),[l,v,i,t,e,s]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingSubscriptionFormPage}),a.jsx(Aa,{location:n,navigate:e,subscriptionId:i,tenantEmailDomain:s})]})}const $a=O((function(t){const e=Nn(t),{fetchState:n}=e;return{columns:e.columns,counts:e.count,countsLoading:e.countsFetchState.fetchState==="Not-Started"||e.countsFetchState.fetchState==="In-Progress",hasMore:e.nextCursor!=null,isLoading:n==="Not-Started"||n==="In-Progress"&&e.subscriptions.length===0,isLoadingMore:n==="In-Progress"&&e.subscriptions.length>0,cancelReasonCodeOptions:e.cancelReasonCodeOptions,lifecycleActionOptions:e.subscriptionLifecycleActionOptions,subscriptions:e.subscriptions,tabIds:e.tabIds}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,i=(s,o,c)=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionLifecycleAction,{action:o,subscriptionId:s}),t(On({action:o,id:s,body:c}))};return{activeStatus:e.activeStatus,searchValue:e.searchValue,sortState:e.sortState,onSearchChange:e.onSearchChange,onSortChange:e.onSortChange,onStatusChange:e.onStatusChange,onAddSubscription:()=>{p.trackInvoicingActionClick(m.Event.invoicingAddSubscriptionClicked),e.navigate(`${n}/subscriptions/new`)},onImportCsv:()=>{p.trackInvoicingActionClick(m.Event.invoicingImportCsvClicked,{entity:"subscriptions"}),e.navigate(`${n}/data_import`)},onChangeTermEnd:(s,o)=>{const c=o?.trim()??"";c!==""&&i(s,"change_term_end",{term_ends_at:c})},onSubscriptionAction:(s,o,c)=>{o!=="pause"?i(s,o):i(s,o,c!=null&&c.trim()!==""?{resume_date:c.trim()}:void 0)},onCancelSubscription:(s,o)=>{i(s,"cancel",{cancel_reason_code:o.cancelReasonCode,end_of_term:!1,...o.cancelReason!=null&&o.cancelReason.trim()!==""?{cancel_reason:o.cancelReason.trim()}:{}})},onSubscriptionClick:s=>{p.trackInvoicingActionClick(m.Event.invoicingSubscriptionRowClicked,{subscriptionId:s}),e.navigate(`${n}/subscriptions/${encodeURIComponent(s)}`)},onViewSubscriptionInvoices:()=>{e.navigate(`${n}/invoices`)},onLoadMore:()=>{e.nextCursor!=null&&t(no({cursor:e.nextCursor,filters:e.filters,keepExistingListItems:!0,sort:e.sort}))}}}))(Tt);function Fa(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),[s,o]=r.useState(""),[c,d]=r.useState(""),[l,v]=r.useState(null),u=r.useMemo((()=>l!=null?{dir:l.direction,field:l.columnKey}:void 0),[l]),g=r.useMemo((()=>({search:c.trim()!==""?c.trim():void 0})),[c]),{activeStatus:f,appliedSearch:S,appliedSort:h,nextCursor:D,subscriptionListFetchState:b,runningActionSubscriptionId:k}=C((j=>{const E=Nn(j);return{activeStatus:E.activeTab,appliedSearch:E.filters.search,appliedSort:E.sort,nextCursor:E.nextCursor,subscriptionListFetchState:E.fetchState,runningActionSubscriptionId:E.runningActionId??null}}),H),y=b==="Completed";r.useEffect((()=>{const j=setTimeout((()=>d(s)),300);return()=>clearTimeout(j)}),[s]),r.useEffect((()=>{i&&t(Ye({cacheOverride:!1}))}),[i,t]),r.useEffect((()=>{i&&(g.search!==S||u?.field!==h?.field||u?.dir!==h?.dir)&&t(Ye({cacheOverride:!0,filters:g,sort:u}))}),[i,t,g,u,S,h]);const I=r.useRef(k);return r.useEffect((()=>{const j=I.current!=null&&k==null;I.current=k,j&&i&&t(Yi())}),[k,i,t]),N(b)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingSubscriptionsListPage,isReady:y}),a.jsx($a,{navigate:e,tenantEmailDomain:n,activeStatus:f,searchValue:s,sortState:l,filters:g,sort:u,nextCursor:D,runningActionSubscriptionId:k,onSearchChange:o,onStatusChange:j=>t(eo(j)),onSortChange:v})]})}const wa=O((function(t,e){const{readView:n}=e;return{isLoading:n.fetchState==="Not-Started"||n.fetchState==="In-Progress",isRunningAction:n.actionState.fetchState==="In-Progress",transaction:n.transaction,transactionId:e.transactionId}}),(function(t,e){const n=`/${e.tenantEmailDomain}/invoicing`,{transactionId:i}=e;return{onBack:()=>e.navigate(`${n}/payments`),onCustomerClick:s=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{customerId:s,fromScreen:"transaction_detail",toScreen:"customer"}),e.navigate(`${n}/customers/${encodeURIComponent(s)}`)},onInvoiceClick:s=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",invoiceId:s,toScreen:"invoice"}),e.navigate(`${n}/invoices/${encodeURIComponent(s)}`)},onSubscriptionClick:s=>{p.trackInvoicingActionClick(m.Event.invoicingEntityLinkClicked,{fromScreen:"transaction_detail",subscriptionId:s,toScreen:"subscription"}),e.navigate(`${n}/subscriptions/${encodeURIComponent(s)}`)},onCapture:i!==""?()=>{p.trackInvoicingActionClick(m.Event.invoicingTransactionCaptured,{transactionId:i}),t(oo({action:"capture",id:i}))}:void 0}}))(Ot);function Ra(){const t=L(),e=A(),{tenantEmailDomain:n,transaction_id:i}=R(),{areTenantIdsInSync:s}=_(),o=C((d=>to(d,i??""))),c=o.fetchState==="Completed";return r.useEffect((()=>{s&&i!=null&&t(io({id:i}))}),[s,i,t]),N(o.fetchState)?a.jsx(M,{}):a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingTransactionDetailPage,isReady:c}),a.jsx(wa,{navigate:e,tenantEmailDomain:n,transactionId:i??"",readView:o})]})}function Zn(t={}){const{enabled:e=!0,fetchSyncHealth:n=!1,loadAccountingPickers:i=!1,reuseCached:s=!1}=t,o=L(),{areTenantIdsInSync:c}=_(),d=C(Me),l=d.connection?.connected===!0,v=d.connectionFetchState.fetchState;return r.useEffect((()=>{e&&c&&(s&&v!=="Not-Started"||o(Un()),n&&o(ao()))}),[c,o,e,n,s]),r.useEffect((()=>{e&&c&&l&&i&&o(so())}),[c,o,e,l,i]),{isQboConnected:l,qboView:d}}const _a={branding:"invoicing_branding_save",dunning:"invoicing_dunning_settings_save",quickbooks:"invoicing_qbo_settings_save"};function J(t){const e=L(),{areTenantIdsInSync:n}=_(),{tenantEmailDomain:i}=R(),{fetchState:s,fieldHelp:o,logoFile:c,saveState:d,settings:l,stripeConnectState:v}=C(co),{configError:u,configFetchState:g,dunningScheduleActionOptions:f,qboAccountMappingKindOptions:S,qboCustomerMatchingOptions:h,qboSyncStatusOptions:D}=C(Bn),b=C(Me);Zn({enabled:t==="quickbooks",fetchSyncHealth:!0,loadAccountingPickers:!0});const k=C(Re),y=t==="dunning"||t==="quickbooks",I=k.companyId??ke.getSignedInUserTenant(i??"")?.companyId,j=C((w=>xn(w,I))),E=ro(k.userRole??[]),F=k.tenantId??"",P=ke.getSignedInUser(),U={userId:P?.userId??"",sessionId:P?.zeniSessionId??"",tenantId:F},T=c?.fileId,Y=C((w=>T!=null&&T!==""?lo(w,T):void 0)),Ne=C((w=>T!=null&&T!==""?uo(w,T):void 0)),Wn=T!=null&&T!==""&&Y!=null?{[T]:Y}:{},Xn=T!=null&&T!==""&&Ne!=null?{[T]:Ne}:{};r.useEffect((()=>(e(en()),()=>{e(en())})),[e]),r.useEffect((()=>{n&&(s!=="Not-Started"&&s!=="Error"||e(_e()))}),[n,e,s]),r.useEffect((()=>{n&&y&&g==="Not-Started"&&e(ge())}),[n,e,g,y]),r.useEffect((()=>{if(!n)return;const w=P?.userId;w!=null&&w!==""&&F!==""&&Ve.shouldFetchActiveTenant(F)&&(Ve.markActiveTenantFetchStarted(F),e(go(w,F,P?.zeniSessionId)))}),[n,e,P?.userId,P?.zeniSessionId,F]);const Jn=f.length>0||S.length>0,Yn=s==="Not-Started"||s==="In-Progress"&&l==null||y&&!Jn&&(g==="Not-Started"||g==="In-Progress"),et=s==="Completed"&&(!y||g==="Completed"),Ue=j.externalConnections?.revenue?.find((w=>w.connectionName==="chargebee"))?.connectionId,fe=ae?.invoicingMicroServiceBaseUrl,Be=fe!=null&&fe.length>0?`${fe}/1.0/webhooks/stripe`:"",he={deleteConnectionError:j.externalConnections?.deleteConnectionError?.message,deleteConnectionState:j.externalConnections?.deleteConnectionState??"Not-Started",integrationsView:j,isAdmin:E,isStripeBusy:v.fetchState==="In-Progress",onConnectStripe:w=>e(tn(w)),onDisconnect:(w,z)=>{F!==""&&e(Io(F,w,on(z)))},onDisconnectStripe:()=>e(nn()),onReconnectQBO:()=>{const w=k.tenantEmailDomain??i??"";me.init("/connection/auth",w),me.handleClick()},onRefreshQBO:()=>{j.integrations.refreshQBO.fetchState!=="In-Progress"&&e(qn())},onSaveChargeBeeCredentials:(w,z)=>{Ue!=null&&F!==""&&e(fo(F,Ue,on("revenue"),ho("chargebee"),{api_key:w,site:z}))},saveChargeBeeError:j.externalConnections?.saveAPIKeyConnectionError?.message,saveChargeBeeState:j.externalConnections?.saveAPIKeyConnectionState??"Not-Started",settings:l,stripeError:v.fetchState==="Error"?v.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:Be};return{authParams:U,deleteFileStatusById:Wn,fieldHelp:o,dunningScheduleActionOptions:f,filesEndPoint:ae?.fileMicroServiceBaseUrl??"",integrationsSectionProps:he,isInvoicingPageReady:et,isLoading:Yn,isSaving:d.fetchState==="In-Progress",isStripeBusy:v.fetchState==="In-Progress",logoFile:c,qboAccountMappingKindOptions:S,qboCustomerMatchingOptions:h,qboSyncStatusOptions:D,qboView:b,saveErrorMessage:d.fetchState==="Error"?d.error?.message??"Failed to save settings.":y&&g==="Error"?u?.message??"Failed to load invoicing configuration.":void 0,settings:l,stripeError:v.fetchState==="Error"?v.error?.message??"Failed to connect Stripe. Check your keys and try again.":void 0,stripeWebhookUrl:Be,updateFileStatusById:Xn,onConnectStripe:w=>e(tn(w)),onDeleteFile:w=>e(So(w,F)),onDisconnectStripe:()=>e(nn()),onEditFileName:(w,z)=>e(po(w,z.split(".")[0],F)),onReconnectQBO:he.onReconnectQBO,onRefreshQBO:he.onRefreshQBO,onRetryQboSyncTask:w=>e(Hn(w)),onSave:w=>{p.trackInvoicingActionClick(m.Event.invoicingSettingsSaved,{tab:t??"hub"}),e(vo({settings:w,snackbarSection:_a[t??""]}))},onStartQboBackfill:w=>e(Vn(w)),updateFilesEntity:w=>{p.trackInvoicingActionClick(m.Event.invoicingLogoUploaded),e(mo({files:w}))}}}function cn({appContent:t}){const e=A(),n=Z(),i=L(),{tenantEmailDomain:s}=R(),o=J("branding"),c=C((v=>Co(v))),d=C((v=>Eo(Ee,v)?.addressToCreate));r.useEffect((()=>{c.saveState.fetchState==="Completed"&&(i(ko()),i(X(Ee)))}),[c.saveState.fetchState,i]);const l=dn(c.saveState.fetchState);return r.useEffect((()=>{l==="In-Progress"&&c.saveState.fetchState==="Completed"&&e("..")}),[l,c.saveState.fetchState,e]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingSettingsPage,isReady:o.isInvoicingPageReady}),a.jsx(Mt,{address:d,fieldHelp:c.fieldHelp,addressLabel:c.addressLabel,appContent:t,authParams:o.authParams,dateFormatOptions:c.dateFormatOptions,deleteFileStatusById:o.deleteFileStatusById,filesEndPoint:o.filesEndPoint,isLoading:o.isLoading,isSaving:o.isSaving,localData:c.localData,logoFile:o.logoFile,saveErrorMessage:o.saveErrorMessage,settings:o.settings,updateFileStatusById:o.updateFileStatusById,onBackClick:()=>e(".."),onChange:v=>{i(xo({localData:v}))},onDeleteFile:o.onDeleteFile,onEditFileName:o.onEditFileName,onOpenAddress:()=>{const v=`/${s}/invoicing/settings/branding/${Ee}/`,u=W(n.state?.pathnameStackToGoBack,n.pathname);e(v,{state:{pathnameStackToGoBack:u}})},onSubmit:()=>i(yo()),updateFilesEntity:o.updateFilesEntity})]})}function Ta(){const t=A(),e=J("dunning");return a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),a.jsx(Nt,{dunningScheduleActionOptions:e.dunningScheduleActionOptions,isLoading:e.isLoading,isSaving:e.isSaving,saveErrorMessage:e.saveErrorMessage,settings:e.settings,onBackClick:()=>t(".."),onSave:e.onSave})]})}function Oa(){const t=A(),e=J("integrations");return a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),a.jsx(Ut,{integrationsSectionProps:{...e.integrationsSectionProps,onConfigureQBO:()=>t("../quickbooks"),onOpenPaymentDestination:()=>t("../payment-destination")},isLoading:e.isLoading,onBackClick:()=>t("..")})]})}function Ma(){const t=A(),e=J("payment-destination");return a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingSettingsPage,isReady:e.isInvoicingPageReady}),a.jsx(Bt,{fieldHelp:e.fieldHelp,isLoading:e.isLoading,isStripeBusy:e.isStripeBusy,saveErrorMessage:e.saveErrorMessage,settings:e.settings,stripeError:e.stripeError,stripeWebhookUrl:e.stripeWebhookUrl,onBackClick:()=>t(".."),onConnectStripe:e.onConnectStripe})]})}const Na=O((function(t){const e=zn(t);return{accountMappingKindOptions:e.accountMappingKindOptions,fieldHelp:e.fieldHelp,accounts:e.accounts,connection:e.connection,customerMatchingOptions:e.customerMatchingOptions,isBackfilling:e.backfillState.fetchState==="In-Progress",isLoading:e.isLoading,isSaving:e.saveState.fetchState==="In-Progress",isSyncEnabledSaved:e.isSyncEnabledSaved,localData:e.localData,nestedAccountHierarchy:e.nestedAccountHierarchy,retryFetchStateByTaskId:e.retryFetchStateByTaskId,saveErrorMessage:e.saveState.fetchState==="Error"?e.saveState.error?.message:void 0,syncHealth:e.syncHealth,syncStatusOptions:e.syncStatusOptions}}),(function(t){return{onChange:e=>{t(Do({localData:e}))},onReset:()=>{t(jo())},onRetryTask:e=>{t(Hn(e))},onSave:()=>{p.trackInvoicingActionClick(m.Event.invoicingSettingsSaved,{tab:"quickbooks"}),t(bo())},onStartBackfill:e=>{t(Vn(e))}}}))(Vt);function Ua(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),i=C(Re),{configFetchState:s,settingsFetchState:o}=C(zn);return r.useEffect((()=>{o!=="Not-Started"&&o!=="Error"||t(_e())}),[t,o]),r.useEffect((()=>{s==="Not-Started"&&t(ge())}),[s,t]),Zn({fetchSyncHealth:!0,loadAccountingPickers:!0}),a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingSettingsPage}),a.jsx(Na,{onBackClick:()=>e(".."),onReconnect:()=>{me.init("/connection/auth",i.tenantEmailDomain??n??""),me.handleClick()},onRefresh:()=>t(qn())})]})}const Ba={"payment-destination":"payment-destination",general:"branding",integrations:null,dunning:"dunning"};function Va(){const t=ln(),e=L(),n=A(),[i,s]=G(),o=J(),{canEnableInvoicing:c,isEnablingInvoicing:d,isInvoicingEnabled:l,isQboConfigured:v,isStripeConnected:u}=C(Bn),g=i.get("tab");return r.useEffect((()=>{if(g==null)return;const f=Ba[g];s({},{replace:!0}),f!=null&&n(f,{replace:!0})}),[g,n,s]),a.jsxs(a.Fragment,{children:[a.jsx($,{event:m.Event.invoicingSettingsPage,isReady:o.isInvoicingPageReady}),a.jsx(Ht,{analytics:p,integrationsSectionProps:{...o.integrationsSectionProps,onConfigureQBO:()=>n("quickbooks"),onOpenPaymentDestination:()=>n("payment-destination")},isEnablingInvoicing:d,isLoading:o.isLoading,meetingUrl:t("invoicing_settings"),settings:o.settings,onBrandingClick:()=>n("branding"),onDunningClick:()=>n("dunning"),canEnableInvoicing:c,isQboConfigured:v,isStripePaymentsReady:u,onEnableInvoicingClick:l?void 0:()=>{e(Lo())}})]})}function rn(){return a.jsxs(te,{children:[a.jsx(x,{index:!0,element:a.jsx(Va,{})}),a.jsx(x,{path:"payment-destination",element:a.jsx(Ma,{})}),a.jsx(x,{path:"branding",element:a.jsx(cn,{})}),a.jsx(x,{path:"branding/:addressType",element:a.jsx(cn,{appContent:a.jsx(Q,{isSubPage:!0,hideAddressBackButton:!0})})}),a.jsx(x,{path:"integrations",element:a.jsx(Oa,{})}),a.jsx(x,{path:"dunning",element:a.jsx(Ta,{})}),a.jsx(x,{path:"quickbooks",element:a.jsx(Ua,{})}),a.jsx(x,{path:"*",element:a.jsx(B,{to:"..",replace:!0})})]})}function Ss(){const t=L(),e=A(),{tenantEmailDomain:n}=R(),{areTenantIdsInSync:i}=_(),{enableState:s,fetchState:o,status:c}=C($n),d=dn(s.fetchState),l=`/${n}/invoicing`,v=r.useRef(!1),u=C((g=>Me(g).connectionFetchState.fetchState));return r.useEffect((()=>{i&&(o!=="Not-Started"?o!=="Error"||v.current||(v.current=!0,t(ge({cacheOverride:!1}))):t(ge({cacheOverride:!1})))}),[i,t,o]),r.useEffect((()=>{i&&u==="Not-Started"&&t(Un())}),[i,t,u]),r.useEffect((()=>{d==="In-Progress"&&s.fetchState==="Completed"&&(e(`${l}/catalog`),t(Ao()))}),[d,s.fetchState,l,t,e]),c==null&&o!=="Error"?a.jsx(qt,{fetchState:"In-Progress"}):c==="not_started"?a.jsxs(te,{children:[a.jsx(x,{path:"promo",element:a.jsx(an,{})}),a.jsx(x,{path:"*",element:a.jsx(B,{to:`${l}/promo`,replace:!0})})]}):c==="settings"?a.jsxs(te,{children:[a.jsx(x,{path:"promo",element:a.jsx(an,{})}),a.jsx(x,{path:"settings/*",element:a.jsx(rn,{})}),a.jsx(x,{path:"*",element:a.jsx(B,{to:`${l}/settings`,replace:!0})})]}):a.jsxs(te,{children:[a.jsx(x,{path:"/",element:a.jsx(B,{to:"overview",replace:!0})}),a.jsx(x,{path:"overview",element:a.jsx(ya,{})}),a.jsx(x,{path:"promo",element:a.jsx(B,{to:`${l}/overview`,replace:!0})}),a.jsx(x,{path:"customers",element:a.jsx(na,{})}),a.jsx(x,{path:"customers/new",element:a.jsx(Yo,{})}),a.jsx(x,{path:"customers/new/:addressType",element:a.jsx(Q,{})}),a.jsx(x,{path:"customers/:customer_id",element:a.jsx(Xo,{})}),a.jsx(x,{path:"customers/:customer_id/:addressType",element:a.jsx(Q,{})}),a.jsx(x,{path:"subscriptions",element:a.jsx(Fa,{})}),a.jsx(x,{path:"subscriptions/new",element:a.jsx(Pa,{})}),a.jsx(x,{path:"subscriptions/new/:addressType",element:a.jsx(Q,{})}),a.jsx(x,{path:"subscriptions/:subscription_id",element:a.jsx(La,{})}),a.jsx(x,{path:"subscriptions/:subscription_id/:addressType",element:a.jsx(Q,{})}),a.jsx(x,{path:"invoices",element:a.jsx(Ia,{})}),a.jsx(x,{path:"invoices/create",element:a.jsx(zo,{})}),a.jsx(x,{path:"invoices/:invoice_id",element:a.jsx(fa,{})}),a.jsx(x,{path:"invoices/:invoice_id/record-payment",element:a.jsx(sn,{})}),a.jsx(x,{path:"invoices/:invoice_id/issue-credit-note",element:a.jsx(Ea,{})}),a.jsx(x,{path:"payments",element:a.jsx(ba,{})}),a.jsx(x,{path:"payments/record",element:a.jsx(sn,{})}),a.jsx(x,{path:"payments/:transaction_id",element:a.jsx(Ra,{})}),a.jsx(x,{path:"credits",element:a.jsx(Zo,{})}),a.jsx(x,{path:"credits/:credit_note_id",element:a.jsx(Ko,{})}),a.jsx(x,{path:"discounts",element:a.jsx(ua,{})}),a.jsx(x,{path:"discounts/new",element:a.jsx(Ho,{})}),a.jsx(x,{path:"discounts/:coupon_id",element:a.jsx(la,{})}),a.jsx(x,{path:"dunning",element:a.jsx(pa,{})}),a.jsx(x,{path:"dunning/:case_id",element:a.jsx(ma,{})}),a.jsx(x,{path:"catalog",element:a.jsx(Bo,{})}),a.jsx(x,{path:"catalog/new",element:a.jsx(Mo,{})}),a.jsx(x,{path:"catalog/:item_id",element:a.jsx(Ro,{})}),a.jsx(x,{path:"settings/*",element:a.jsx(rn,{})}),a.jsx(x,{path:"audit_log",element:a.jsx($o,{})}),a.jsx(x,{path:"data_import",element:a.jsx(aa,{})}),a.jsx(x,{path:"data_import/migrate",element:a.jsx(ca,{})}),a.jsx(x,{path:"data_import/:sessionId",element:a.jsx(ia,{})}),a.jsx(x,{path:"*",element:a.jsx(M,{})})]})}export{Ss as default};
|