@zeniai/web-app-ui 5.0.18-dev → 5.0.19-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.
Files changed (124) hide show
  1. package/dist/assets/AddressRoutes-lf9ZdyZf.js +1 -0
  2. package/dist/assets/AddressScreen-DA--hhk1.js +9 -0
  3. package/dist/assets/AiCfoScreen-CpMH_v6j.js +11 -0
  4. package/dist/assets/{BillPayApprovalRoutes-HXwT6b11.js → BillPayApprovalRoutes-ACmK2fpu.js} +1 -1
  5. package/dist/assets/{BillPayRoutes-BzBCviB6.js → BillPayRoutes-CPY6ZKpy.js} +8 -8
  6. package/dist/assets/{BusinessVerificationPageScreen-BzeS5V7y.js → BusinessVerificationPageScreen-CPLYT88K.js} +2 -2
  7. package/dist/assets/{ChargeCardRoutes-DtPcohMS.js → ChargeCardRoutes-DOis3HXK.js} +8 -8
  8. package/dist/assets/CompanyPassportScreen-1lIV_EdW.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-DHGQw_my.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-4Hi3p1F8.js +1 -0
  11. package/dist/assets/{CustomerOnboardingRoutes-BM2T5OAa.js → CustomerOnboardingRoutes-DhJnOIRO.js} +6 -6
  12. package/dist/assets/{DashboardRoutes-Izc8auCt.js → DashboardRoutes-vrWzSKRl.js} +3 -3
  13. package/dist/assets/{DefaultTenantHome-bI_Ouscm.js → DefaultTenantHome-kc3CT_nT.js} +1 -1
  14. package/dist/assets/DomesticWireDetailScreen-CDSHWzpK.js +18 -0
  15. package/dist/assets/DrawerScreen-DAAT8x3I.js +1 -0
  16. package/dist/assets/{EntityDetailRoutes-BGq4IsYj.js → EntityDetailRoutes-Bi-1SYK-.js} +1 -1
  17. package/dist/assets/ExpenseAutomationRoutes-BfDOYW44.js +20 -0
  18. package/dist/assets/FeaturePreviewScreen-6mma8zAR.js +1 -0
  19. package/dist/assets/MagicLinkRoutes-36BHS8jO.js +72 -0
  20. package/dist/assets/MagicLinkSignInScreen-DuUZLbz-.js +12 -0
  21. package/dist/assets/{MobileAppDrawer-Cm7-zimG.js → MobileAppDrawer-CchbWOro.js} +1 -1
  22. package/dist/assets/NotFoundScreen-D48p5_Tl.js +1 -0
  23. package/dist/assets/NotificationRoutes-dJdWvevB.js +1 -0
  24. package/dist/assets/{PandLWithForecastRoutes-saOHMj25.js → PandLWithForecastRoutes-BTQ6Xc5d.js} +1 -1
  25. package/dist/assets/PeopleRoutes-DCfmw9iX.js +22 -0
  26. package/dist/assets/PerformanceRoutes-CrrVdKJV.js +1 -0
  27. package/dist/assets/{Preview-CCtVCHIh.js → Preview-CRwVXjMO.js} +1 -1
  28. package/dist/assets/{QBOConnectionScreen-6RSZcUN8.js → QBOConnectionScreen-Bl-77XMi.js} +1 -1
  29. package/dist/assets/ReferralListScreen-DYwPmxe6.js +5 -0
  30. package/dist/assets/{ReimbursementApprovalRoutes-CxqpNXGz.js → ReimbursementApprovalRoutes-C-lm1J1e.js} +1 -1
  31. package/dist/assets/{ReimbursementApprovalRuleDetailScreen-CecV3XDw.js → ReimbursementApprovalRuleDetailScreen-D0iEwDNr.js} +1 -1
  32. package/dist/assets/{ReimbursementRoutes-DW0zR6gG.js → ReimbursementRoutes-9Mw6bkhH.js} +6 -6
  33. package/dist/assets/{ReportsRoutes-DP1_RwWS.js → ReportsRoutes-BOl2MoUD.js} +1 -1
  34. package/dist/assets/RewardsRoutes-DEjJQiOC.js +1 -0
  35. package/dist/assets/ScreenRoutes-DS8EaGmY.js +2 -0
  36. package/dist/assets/{SettingsRoutes-B0cIgWbj.js → SettingsRoutes-C43mkLVL.js} +7 -7
  37. package/dist/assets/{SetupPagesScreen-twRyusK_.js → SetupPagesScreen-DH25TE2h.js} +1 -1
  38. package/dist/assets/{SignInScreen-CvwTOGOJ.js → SignInScreen-RIqK36zY.js} +1 -1
  39. package/dist/assets/SignOutScreen-DktV1cFV.js +9 -0
  40. package/dist/assets/TaskListScreen-Ll5JA5ok.js +9 -0
  41. package/dist/assets/TaskRoutes-DyF3dtET.js +9 -0
  42. package/dist/assets/TransactionDetailRoutes-Dny0EJtn.js +1 -0
  43. package/dist/assets/{TransactionDetailScreen-5MngqnVF.js → TransactionDetailScreen-C0rjhkZ-.js} +1 -1
  44. package/dist/assets/{TransactionListRoutes-DqBQRJfn.js → TransactionListRoutes-DN1_oOBd.js} +1 -1
  45. package/dist/assets/{TreasuryRoutes-DQeLsmFI.js → TreasuryRoutes-CnKLqfNH.js} +6 -6
  46. package/dist/assets/{VendorsRoutes-CfJfrnc7.js → VendorsRoutes-B2SjWnhx.js} +13 -13
  47. package/dist/assets/WiseConfirmationScreen-B4sWyuw5.js +12 -0
  48. package/dist/assets/{ZeniAccountRoutes-C234xTpq.js → ZeniAccountRoutes-DfInPzr6.js} +10 -10
  49. package/dist/assets/ZeniAccountStatementScreen-DLa3OFvs.js +9 -0
  50. package/dist/assets/{accountMappingHelper-DxgbU7sx.js → accountMappingHelper-DXGp115l.js} +1 -1
  51. package/dist/assets/{analytics-CALyM-hh.js → analytics-BKunqsaf.js} +1 -1
  52. package/dist/assets/{analyticsHelper-CNEn8Hd5.js → analyticsHelper-CEk9SeZV.js} +1 -1
  53. package/dist/assets/{core-DGtRv-5L.js → core-C1FHFtWE.js} +1 -1
  54. package/dist/assets/{decodeURIComponentSafe-D45efNq9.js → decodeURIComponentSafe-BjGCfGPp.js} +1 -1
  55. package/dist/assets/{dnd-Bts1hC9q.js → dnd-CKPinqKo.js} +1 -1
  56. package/dist/assets/{empty-B8GlEZnh.js → empty-DCBZxZdT.js} +1 -1
  57. package/dist/assets/{empty-B0MTj6gY.js → empty-QDWy3Sbb.js} +1 -1
  58. package/dist/assets/{emptyVideoElement-DIDd1D81.js → emptyVideoElement-CDVJdqXJ.js} +1 -1
  59. package/dist/assets/{epic-Ddra04XC.js → epic-DW6sm_Xz.js} +2 -2
  60. package/dist/assets/getLocaleForTenant-B4sKOYZh.js +1 -0
  61. package/dist/assets/{index-oJG7aYjB.js → index-BKQLnVw8.js} +1 -1
  62. package/dist/assets/{index-CrJKzVqy.js → index-CHRX9-rv.js} +2 -2
  63. package/dist/assets/{index-CI_EK7HU.js → index-D8T6lc_N.js} +1 -1
  64. package/dist/assets/{index-qMA2LgL2.js → index-DfYl8X58.js} +11564 -11575
  65. package/dist/assets/{index-ktcuBvep.js → index-Dg4Gln7w.js} +1 -1
  66. package/dist/assets/{index-Cq17jLR1.js → index-oonNPnkE.js} +1 -1
  67. package/dist/assets/{index-BzTrf-Pv.js → index-v7N-NvrE.js} +1 -1
  68. package/dist/assets/{lexical-DcQz2ToX.js → lexical-BhAbdael.js} +1 -1
  69. package/dist/assets/{liveblocks-1thjzoaw.js → liveblocks-BZlOk8zk.js} +1 -1
  70. package/dist/assets/{lottie-TdNUPve2.js → lottie-ciaQJ7oN.js} +1 -1
  71. package/dist/assets/{mui-C-9qGevS.js → mui-CZhjlxyT.js} +1 -1
  72. package/dist/assets/{pathToGoBack-BxDzY9Wz.js → pathToGoBack-BQU-ldKZ.js} +1 -1
  73. package/dist/assets/{pdf-DhqCrjXb.js → pdf-9d-sooX0.js} +3 -3
  74. package/dist/assets/{pdf-lib-DmaaVbvY.js → pdf-lib-Bm3ZpH2B.js} +1 -1
  75. package/dist/assets/{plaid-DRyXOtiU.js → plaid-BYUv-poR.js} +1 -1
  76. package/dist/assets/{pusher-BfiexiZ0.js → pusher-DcPGAlRO.js} +1 -1
  77. package/dist/assets/{react-DHT2lmLc.js → react-BNNcFe-e.js} +1 -1
  78. package/dist/assets/{react-B7CiQw1L.js → react-BtwEgXWF.js} +1 -1
  79. package/dist/assets/{react-md9nq4qh.js → react-DERPQWfC.js} +1 -1
  80. package/dist/assets/{react-KFiz_tR6.js → react-Du_nCFym.js} +1 -1
  81. package/dist/assets/{react-D00Xl-Dr.js → react-JYEN_7jf.js} +1 -1
  82. package/dist/assets/{react-B82EMGAf.js → react-rXZAT_kh.js} +1 -1
  83. package/dist/assets/{recharts-a2B9SbBf.js → recharts-BBpjoK43.js} +1 -1
  84. package/dist/assets/{routePaths-D4gSBLnj.js → routePaths-DgVtUTp9.js} +1 -1
  85. package/dist/assets/{sentry-CooVhpit.js → sentry-BfJuQlQx.js} +1 -1
  86. package/dist/assets/{url-BC3SAbOG.js → url-C8S_Lh_c.js} +1 -1
  87. package/dist/assets/{url-D12sxYA1.js → url-CpMpWu4x.js} +1 -1
  88. package/dist/assets/useAskAiCfoHostNavButtonProps-D1RMvC2X.js +1 -0
  89. package/dist/assets/{useDeviceId-Bxt0bF-y.js → useDeviceId-CjFCWE4s.js} +1 -1
  90. package/dist/assets/useFetchSuggestedQuestionsWhenReady-CgY0vmfG.js +1 -0
  91. package/dist/assets/{useInitialThreadRequest-D8IyoM_c.js → useInitialThreadRequest-CLPAmutD.js} +1 -1
  92. package/dist/assets/{utils-DYt83G2V.js → utils-B1VtuHQw.js} +1 -1
  93. package/dist/assets/{withTransactionSidePanel-DGvNPHaC.js → withTransactionSidePanel-CPT6QJLl.js} +2 -2
  94. package/dist/assets/{zeni-epic-state-DNuuo8ZV.js → zeni-epic-state-BEdHTWyp.js} +3 -3
  95. package/dist/index.html +1 -1
  96. package/package.json +3 -3
  97. package/dist/assets/AddressRoutes-BXSq2UYK.js +0 -1
  98. package/dist/assets/AddressScreen-DjAh8cOG.js +0 -9
  99. package/dist/assets/AiCfoScreen-Cw9gN4YM.js +0 -11
  100. package/dist/assets/CompanyPassportScreen-BymThTkX.js +0 -1
  101. package/dist/assets/ConnectionAuthScreen-gRL_xHi_.js +0 -11
  102. package/dist/assets/CustomerOnboardingAuthScreen-DYGq06--.js +0 -1
  103. package/dist/assets/DomesticWireDetailScreen-CmnkkBcn.js +0 -18
  104. package/dist/assets/DrawerScreen-D9Gfh7Os.js +0 -1
  105. package/dist/assets/ExpenseAutomationRoutes-D13llzPb.js +0 -20
  106. package/dist/assets/FeaturePreviewScreen-BOOSrzh0.js +0 -1
  107. package/dist/assets/MagicLinkRoutes-DRHdwAj0.js +0 -72
  108. package/dist/assets/MagicLinkSignInScreen-BX1xrano.js +0 -12
  109. package/dist/assets/NotFoundScreen-Dcn8itM6.js +0 -1
  110. package/dist/assets/NotificationRoutes-BzSi9mna.js +0 -1
  111. package/dist/assets/PeopleRoutes-CemCnUW5.js +0 -22
  112. package/dist/assets/PerformanceRoutes-DaDpWqGX.js +0 -1
  113. package/dist/assets/ReferralListScreen-k_UJZOUV.js +0 -5
  114. package/dist/assets/RewardsRoutes-DZOLEk5b.js +0 -1
  115. package/dist/assets/ScreenRoutes-D6JPliOs.js +0 -2
  116. package/dist/assets/SignOutScreen-LPUmfPuE.js +0 -9
  117. package/dist/assets/TaskListScreen-BturUVdg.js +0 -9
  118. package/dist/assets/TaskRoutes-DgvxE0eR.js +0 -9
  119. package/dist/assets/TransactionDetailRoutes-Bk0EMgeu.js +0 -1
  120. package/dist/assets/WiseConfirmationScreen-Ir5P5nep.js +0 -12
  121. package/dist/assets/ZeniAccountStatementScreen-BFcLjyKC.js +0 -9
  122. package/dist/assets/getLocaleForTenant-CBo4HCpo.js +0 -1
  123. package/dist/assets/useAskAiCfoHostNavButtonProps-CCf6ftES.js +0 -1
  124. package/dist/assets/useFetchSuggestedQuestionsWhenReady-C1j3vNVn.js +0 -1
@@ -1,4 +1,4 @@
1
- import{j as I}from"./liveblocks-1thjzoaw.js";import{a as d}from"./sentry-CooVhpit.js";import{h as K,g as S,u as re,j as le,l as de,N as Ke,k as je}from"./core-DGtRv-5L.js";import{bm as Me,eM as W,cM as ue,bu as me,pf as H,Jn as B,Ko as pe,Kp as Y,JN as he,jw as fe,Kq as ge,JS as Q,JT as X,kl as Se,Gv as Z,Jh as _,jq as Te,jo as ye,jA as $e,Kr as Je,Ks as qe,t4 as G,jv as ve,FS as Ee,cS as We,cT as He,Kt as Ye,Jg as Qe,Ku as Xe,t8 as Ze,Kv as ea,Kw as aa,Kx as ta,Ky as na,Kz as oa,jz as sa,KA as ia,KB as ca,Ji as ra,KC as la,KD as da,KE as ua,FM as ma,FA as pa,G2 as ha,jB as fa,Gw as ie,FJ as ga}from"./zeni-epic-state-DNuuo8ZV.js";import{z as Ce,l as ee,c as V,aI as De,h as Sa,K as Ta,aJ as ya,A as va,n as J,C as Ea,aK as Ca,r as q,I as Da,d as be,aL as ba,ao as Ia,Q as $}from"./index-qMA2LgL2.js";import{n as ka,S as Aa,D as Ua}from"./mui-C-9qGevS.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-CCf6ftES.js";import{c as _a}from"./useFetchSuggestedQuestionsWhenReady-C1j3vNVn.js";import{d as Ie}from"./decodeURIComponentSafe-D45efNq9.js";import{h as ke,g as Va,d as wa,b as Fa}from"./routePaths-D4gSBLnj.js";import{t as Ba}from"./utils-DYt83G2V.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="a2a93797-4dcd-40c2-90d0-9d1850eae2b8",a._sentryDebugIdIdentifier="sentry-dbid-a2a93797-4dcd-40c2-90d0-9d1850eae2b8")}catch{}})();const ae=()=>{const a=Ce.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(V.isChainOfThoughtEnabled);return d.useMemo(()=>Me(a)&&s,[a,s])};function Ae(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Za(a,e){const s=K(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>W(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:b}=t(V.isExpenseAutomationEnabled),{configValue:h}=n(De.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,k=ae(),y=d.useMemo(()=>({id:a,type:H(e)}),[a,e]),m=S(u=>B(u,y)),D=S(u=>{const N=B(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return N==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[N]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Ae(m?.transaction):void 0,[m?.fetchState,m?.transaction]),E=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),A=S(u=>Y(u)),w=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),j=o.company?.companyInfo.firstMonthOfFY??1,M=S(u=>fe(u.accountState,u.accountListState,"accountList")),[P,F]=d.useState(!1),[L,v]=d.useState(!1),[c,O]=d.useState(!1);d.useEffect(()=>{F(!1),v(!1),O(!1)},[a,e]);const C=d.useCallback(()=>{F(!1),v(!1)},[]),[U,x]=d.useState(!1),z=w?.selectedPeriod?.timePeriod;return d.useEffect(()=>{c||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),O(!0)),p!=null&&(!i||l&&g===!1)&&(P?L||E==null||(v(!0),s(Z(p,"TransactionDetail",{timeframe:"month",timePeriod:z??E}))):(s(Q()),s(X()),F(!0),s(Se(p))))},[s,c,m?.fetchState,m?.transaction,p,i,l,g,P,L,E,z]),d.useEffect(()=>{A.newVendorState?.vendorDetailLocalData?.vendorName!=null?x(!0):x(!1)},[A.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(_("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:b,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:k,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:D,tranEntity:p,defaultTrendTransactionTimePeriod:E,vendorViewDetails:A,uiState:w,firstMonthOfFY:j,uncategorizedAccounts:M,resetTrendIsFetchedStates:C,isCreateVendorDrawerOpen:U,setIsCreateVendorDrawerOpen:x}}const Pa={overlayWidth:new va(100,100,58)},La=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Sa(),i=Ta(),l=K(),g=S(h=>Y(h)),T=()=>{t()},b={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l($e("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return I.jsx(Ua,{anchor:"right",open:a,PaperProps:{style:{width:Pa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:I.jsx(Oa,{onClick:h=>h.stopPropagation(),children:I.jsx(ya,{...b})})})},Oa=ka(Aa)`
1
+ import{j as I}from"./liveblocks-BZlOk8zk.js";import{a as d}from"./sentry-BfJuQlQx.js";import{h as K,g as S,u as re,j as le,l as de,N as Ke,k as je}from"./core-C1FHFtWE.js";import{bm as Me,eM as W,cM as ue,bu as me,pf as H,Jn as B,Ko as pe,Kp as Y,JN as he,jx as fe,Kq as ge,JS as Q,JT as X,km as Se,Gv as Z,Jh as _,jr as Te,jp as ye,jB as $e,Kr as Je,Ks as qe,t4 as G,jw as ve,FS as Ee,cS as We,cT as He,Kt as Ye,Jg as Qe,Ku as Xe,t8 as Ze,Kv as ea,Kw as aa,Kx as ta,Ky as na,Kz as oa,jA as sa,KA as ia,KB as ca,Ji as ra,KC as la,KD as da,KE as ua,FM as ma,FA as pa,G2 as ha,jC as fa,Gw as ie,FJ as ga}from"./zeni-epic-state-BEdHTWyp.js";import{z as Ce,c as ee,d as V,aI as De,h as Sa,q as Ta,aJ as ya,G as va,w as J,C as Ea,aK as Ca,y as q,N as Da,e as be,aL as ba,ao as Ia,T as $}from"./index-DfYl8X58.js";import{n as ka,S as Aa,D as Ua}from"./mui-CZhjlxyT.js";import{u as xa}from"./useAskAiCfoHostNavButtonProps-D1RMvC2X.js";import{c as _a}from"./useFetchSuggestedQuestionsWhenReady-CgY0vmfG.js";import{d as Ie}from"./decodeURIComponentSafe-BjGCfGPp.js";import{h as ke,g as Va,d as wa,b as Fa}from"./routePaths-DgVtUTp9.js";import{t as Ba}from"./utils-B1VtuHQw.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="8101093b-c32d-4f44-816d-0ddc6702fe64",a._sentryDebugIdIdentifier="sentry-dbid-8101093b-c32d-4f44-816d-0ddc6702fe64")}catch{}})();const ae=()=>{const a=Ce.getSignedInUser(),{useFeatureGate:e}=ee(),{isFeatureEnabled:s}=e(V.isChainOfThoughtEnabled);return d.useMemo(()=>Me(a)&&s,[a,s])};function Ae(a){if(a!=null){if("customer"in a&&a.customer!=null){const{customer:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"customer",zeniId:e.id,qboId:e.id}}if("vendor"in a&&a.vendor!=null){const{vendor:e}=a;return{id:e.id,name:e.name,logo:e.logo,type:"vendor",zeniId:e.id,qboId:e.id}}}}function Za(a,e){const s=K(),{useFeatureGate:t,useDynamicConfig:n}=ee(),o=S(u=>W(u)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ue(o.userRole),g=o.userRole!=null&&me(o.userRole),{isFeatureEnabled:T}=t(V.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:b}=t(V.isExpenseAutomationEnabled),{configValue:h}=n(De.enableUncategorizedExpenseCategory),f=h?.uncategorized_expense_category_enabled===!0,k=ae(),y=d.useMemo(()=>({id:a,type:H(e)}),[a,e]),m=S(u=>B(u,y)),D=S(u=>{const N=B(u,y)?.transactionDetailLocalData.vendorUpdates?.id;return N==null?"Not-Started":u.transactionVendorViewState.editVendorStateById[N]?.saveStatus.fetchState??"Not-Started"}),p=d.useMemo(()=>m?.fetchState==="Completed"?Ae(m?.transaction):void 0,[m?.fetchState,m?.transaction]),E=S(u=>{if(p!=null)return pe(u.customerIncomeState,u.vendorExpenseState,u.trendState,p,"month")}),A=S(u=>Y(u)),w=S(u=>{if(p!=null)return he(u.trendWithTransactionsState,p,"TransactionDetail")}),j=o.company?.companyInfo.firstMonthOfFY??1,M=S(u=>fe(u.accountState,u.accountListState,"accountList")),[P,F]=d.useState(!1),[L,v]=d.useState(!1),[c,O]=d.useState(!1);d.useEffect(()=>{F(!1),v(!1),O(!1)},[a,e]);const C=d.useCallback(()=>{F(!1),v(!1)},[]),[U,x]=d.useState(!1),z=w?.selectedPeriod?.timePeriod;return d.useEffect(()=>{c||m==null||m.transaction==null||(s(ge({id:m.transaction.id,type:m.transaction.type})),O(!0)),p!=null&&(!i||l&&g===!1)&&(P?L||E==null||(v(!0),s(Z(p,"TransactionDetail",{timeframe:"month",timePeriod:z??E}))):(s(Q()),s(X()),F(!0),s(Se(p))))},[s,c,m?.fetchState,m?.transaction,p,i,l,g,P,L,E,z]),d.useEffect(()=>{A.newVendorState?.vendorDetailLocalData?.vendorName!=null?x(!0):x(!1)},[A.newVendorState?.vendorDetailLocalData?.vendorName]),d.useEffect(()=>()=>{s(_("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:g,isVendorBulkUpdateOnTransactionEnabled:T,isExpenseAutomationEnabled:b,isUncategorizedExpenseCategoryEnabled:f,isChainOfThoughtEnabled:k,selectedTransaction:y,transactionDetail:m,vendorSaveStatus:D,tranEntity:p,defaultTrendTransactionTimePeriod:E,vendorViewDetails:A,uiState:w,firstMonthOfFY:j,uncategorizedAccounts:M,resetTrendIsFetchedStates:C,isCreateVendorDrawerOpen:U,setIsCreateVendorDrawerOpen:x}}const Pa={overlayWidth:new va(100,100,58)},La=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Sa(),i=Ta(),l=K(),g=S(h=>Y(h)),T=()=>{t()},b={vendorDetailView:n??g,onSaveSuccess:()=>{l(ye()),l($e("Not-Started")),s()},onSaveVendor:e,onCancelClick:T,saveVendorDetailLocalData:h=>{l(Te({vendorId:void 0,localData:h}))}};return I.jsx(Ua,{anchor:"right",open:a,PaperProps:{style:{width:Pa.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:T,children:I.jsx(Oa,{onClick:h=>h.stopPropagation(),children:I.jsx(ya,{...b})})})},Oa=ka(Aa)`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  flex-direction: column;
@@ -1 +1 @@
1
- import{j as i}from"./liveblocks-1thjzoaw.js";import{j as U,u as w,h as q,l as H,g as L,N as C,k as Q,n as Ae,o as v}from"./core-DGtRv-5L.js";import{eM as R,iK as T,NL as K,Gm as ue,bp as ie,NM as he,jl as Z,JP as W,NN as se,NO as Se,bB as x,Gj as me,NP as ke,NQ as re,NR as be,NS as pe,NT as Ie,NU as ve,NV as de,Hz as Ye,bm as xe}from"./zeni-epic-state-DNuuo8ZV.js";import{D as X,d as B,c2 as ee,r as _,n as te,l as fe,c as J,M as Pe,z as Ee}from"./index-qMA2LgL2.js";import"./mui-C-9qGevS.js";import{a as A}from"./sentry-CooVhpit.js";import{w as ae}from"./withTransactionSidePanel-DGvNPHaC.js";import{p as ne,b as ce}from"./routePaths-D4gSBLnj.js";import{u as Le}from"./utils-DYt83G2V.js";import{d as E}from"./decodeURIComponentSafe-D45efNq9.js";import{Z as je}from"./ZeniAccountStatementScreen-BFcLjyKC.js";import"./recharts-a2B9SbBf.js";import"./analytics-CALyM-hh.js";import"./plaid-DRyXOtiU.js";import"./dnd-Bts1hC9q.js";import"./stripe-DMRn4zHo.js";import"./lottie-TdNUPve2.js";import"./lexical-DcQz2ToX.js";import"./pdf-DhqCrjXb.js";import"./useAskAiCfoHostNavButtonProps-CCf6ftES.js";import"./useFetchSuggestedQuestionsWhenReady-C1j3vNVn.js";import"./TransactionDetailScreen-5MngqnVF.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="84abaf9a-7976-49cd-b6c2-2f82b15c76a2",a._sentryDebugIdIdentifier="sentry-dbid-84abaf9a-7976-49cd-b6c2-2f82b15c76a2")}catch{}})();const G=a=>Le(a),ze=Q(function(a,e){const t=he(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,G(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:Z(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=X.getLocalizedStrings(),r=G(e.selectedAccount.tranListType),s=Be(t,n,c,r,e.bookCloseDate);B.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(se({uiState:{dateRange:s},type:G(e.selectedAccount.tranListType)})),a(ue(r,T(s),!1,r==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(T(s))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(se({uiState:{scrollYOffset:t},type:G(e.selectedAccount.tranListType)}))}}})(ee),F=ae(function({...a}){const e=U(),t=w(),n=q(),c=t.pathname.substring(t.pathname.lastIndexOf("/")+1),{tenantEmailDomain:o}=H(),r=X.getLocalizedStrings(),{accountType:s,title:u,subTitle:h}=Me(c),D="month",g=L(p=>R(p)),Y=g.company?.companyInfo.firstMonthOfFY??1,{dataAvailable:y,initialTimeframeTick:S}=Ce(c,Y,g.bookCloseDate),[k,j]=A.useState(!1),[z,P]=A.useState(void 0),m=A.useMemo(()=>{const p=T(S);return{tranListType:c,accountType:K(s),title:u,subTitle:h,timeframe:D,period:p}},[c,D,s,y]);A.useEffect(()=>{if(!k&&m!=null){j(!0),B.trackTransactionList(void 0,void 0,void 0,m.title);const p=G(m.tranListType);n(ue(p,m.period,!0,p==="missingReceipts"?r.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[k,m,n]);let b=m;return m!=null&&z!=null&&(b={...m,period:z}),b==null?i.jsx(C,{to:"../"}):i.jsx(ze,{firstMonthOfFY:Y,tenantEmailDomain:o,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:y,navigate:e,selectedAccount:b,referrerType:c,bookCloseDate:g.bookCloseDate,onSelectedTimePeriodChange:p=>P(p),...a})}),Me=a=>{let e="",t="",n="";const c=X.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=c.uncategorizedTransactionList.income.title,n=c.uncategorizedTransactionList.income.subTitle;break;case"uncategorized-expense":e="expenses",t=c.uncategorizedTransactionList.expense.title,n=c.uncategorizedTransactionList.expense.subTitle;break;case"miscategorized-expense":e="expenses",t=c.miscategorizedTransactionList.expense.title,n=c.miscategorizedTransactionList.expense.subTitle;break;case"miscategorized-income":e="income",t=c.miscategorizedTransactionList.income.title,n=c.miscategorizedTransactionList.income.subTitle;break;case"missing-receipts":t=c.uncategorizedTransactionList.missingReceipt.title,n=c.uncategorizedTransactionList.missingReceipt.subTitle}return{accountType:e,title:t,subTitle:n}},Ce=(a,e,t)=>{const n=ie();let c=ie().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ne(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Be=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Oe=Q(function(a,e){const t=ke(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:Z(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Te();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(me(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ee),Fe=ae(function({referrerType:a,...e}){const t=U(),n=w(),c=q(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,classIdEncoded:u,timeframe:h,startDate:D,endDate:g,titleEncoded:Y}=H(),y=E(r??""),S=E(s??""),k=E(u??""),j=E(Y??""),z=L(f=>Se(f.transactionListState,S,y,k)),[P,m]=A.useState(!1),[b,p]=A.useState(void 0),N=L(f=>R(f)),$=N.company?.companyInfo.firstMonthOfFY??1;let d;const l=Ge(y,S,k,h,D,g,j);if(l){const f={startDate:x(D,"YYYY-MM-DD"),endDate:x(g,"YYYY-MM-DD")},V=Ne(z?.dateRange,f);d={accountId:S,accountType:K(y),classId:k,title:j,timeframe:h,period:V}}A.useEffect(()=>{P||d==null||(m(!0),B.trackTransactionList(d.accountId,void 0,a,d.title),c(me(d.accountId,d.accountType,d.classId,d.period)))},[P,d,c]);let M=d;d!=null&&b!=null&&(M={...d,period:b});const O=[r,s,u,h,D,g,Y].filter(f=>f!=null);return l&&M!=null?i.jsx(Oe,{firstMonthOfFY:$,tenantEmailDomain:o,location:n,navigate:t,selectedAccount:M,referrerType:a,onSelectedTimePeriodChange:f=>p(f),...e}):i.jsx(C,{to:Te(O.length)})}),Te=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ge=(a,e,t,n,c,o,r)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&x(c,"YYYY-MM-DD").isValid()&&x(o,"YYYY-MM-DD").isValid()&&r!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),_e=Q(function(a,e){const t=Ie(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ve(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:Z(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??De();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(pe(e.selectedAccount.accountId,e.selectedAccount.accountType,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=$e(e.tenantEmailDomain),n=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ee),le=ae(function({referrerType:a,...e}){const t=U(),n=w(),c=q(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,timeframe:u,startDate:h,endDate:D,titleEncoded:g,excludeSubAccounts:Y}=H(),y=E(r??""),S=E(s??""),k=E(g??""),j=!(Y!=null&&Y==="exclude_subaccounts"),z=L(I=>be(I.transactionListState,S,y)),[P,m]=A.useState(!1),[b,p]=A.useState(void 0),N=L(I=>R(I)),$=N.company?.featuresActivationInfo.connectedAccountProvider==="unit",d=N.company?.companyInfo.firstMonthOfFY??1;let l;const M=we(y,S,u,h,D,k);if(M){const I={startDate:x(h,"YYYY-MM-DD"),endDate:x(D,"YYYY-MM-DD")},ye=Re(z?.dateRange,I);l={accountId:S,accountType:K(y),title:k,timeframe:u,period:ye}}let O=l;l!=null&&b!=null&&(O={...l,period:b});const{useFeatureGate:f}=fe(),{isFeatureEnabled:V}=f(J.isTransactionCommentingEnabled),{areTenantIdsInSync:oe}=Pe();A.useEffect(()=>{!P&&l!=null&&oe&&(m(!0),B.trackTransactionList(l.accountId,void 0,a,l.title),c(pe(l.accountId,l.accountType,l.period,void 0,!1,j)))},[P,l,c,oe]);const ge=[r,s,u,h,D,g].filter(I=>I!=null);return M&&O!=null?i.jsx(_e,{firstMonthOfFY:d,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:$,isTransactionCommentingEnabled:V,selectedAccount:O,referrerType:a,onSelectedTimePeriodChange:I=>p(I),...e}):i.jsx(C,{to:De(ge.length)})}),De=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},we=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&x(n,"YYYY-MM-DD").isValid()&&x(c,"YYYY-MM-DD").isValid()&&o!=null,Re=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),$e=a=>`/${a}/transactions/${Ye}/statements`;function mt(){const a=w().state?.referrer,e=Ee.getSignedInUser(),t=xe(e),{useFeatureGate:n}=fe(),{isFeatureEnabled:c}=n(J.isExpenseAutomationEnabled),o=L(u=>u.expenseAutomationViewState.selectedPeriodByTenantId)[L(u=>R(u)).tenantId],{isFeatureEnabled:r}=n(J.isExpenseAutomationEnabledV2),s=r||c&&t;return i.jsxs(Ae,{children:[i.jsx(v,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/zeni-clearing-account/statements",element:i.jsx(je,{})}),i.jsx(v,{path:"/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/uncategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/uncategorized-expense/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-expense/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/missing-receipts/*",element:s?i.jsx(C,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:i.jsx(Fe,{referrerType:a})})]})}export{mt as default};
1
+ import{j as i}from"./liveblocks-BZlOk8zk.js";import{j as U,u as w,h as q,l as H,g as L,N as z,k as Q,n as Ae,o as v}from"./core-C1FHFtWE.js";import{eM as R,iL as T,NL as Z,Gm as ue,bp as ie,NM as he,jm as K,JP as W,NN as se,NO as Se,bB as x,Gj as me,NP as ke,NQ as re,NR as Ie,NS as pe,NT as be,NU as ve,NV as de,Hz as Ye,bm as xe}from"./zeni-epic-state-BEdHTWyp.js";import{D as X,e as B,c2 as ee,y as _,w as te,c as fe,d as J,O as Pe,z as Ee}from"./index-DfYl8X58.js";import"./mui-CZhjlxyT.js";import{a as A}from"./sentry-BfJuQlQx.js";import{w as ae}from"./withTransactionSidePanel-CPT6QJLl.js";import{p as ne,b as ce}from"./routePaths-DgVtUTp9.js";import{u as Le}from"./utils-B1VtuHQw.js";import{d as E}from"./decodeURIComponentSafe-BjGCfGPp.js";import{Z as je}from"./ZeniAccountStatementScreen-DLa3OFvs.js";import"./recharts-BBpjoK43.js";import"./analytics-BKunqsaf.js";import"./plaid-BYUv-poR.js";import"./dnd-CKPinqKo.js";import"./stripe-DMRn4zHo.js";import"./lottie-ciaQJ7oN.js";import"./lexical-BhAbdael.js";import"./pdf-9d-sooX0.js";import"./useAskAiCfoHostNavButtonProps-D1RMvC2X.js";import"./useFetchSuggestedQuestionsWhenReady-CgY0vmfG.js";import"./TransactionDetailScreen-C0rjhkZ-.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},e=new a.Error().stack;e&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[e]="41aad414-a039-47a1-9ecf-9b1d5fe63ae5",a._sentryDebugIdIdentifier="sentry-dbid-41aad414-a039-47a1-9ecf-9b1d5fe63ae5")}catch{}})();const G=a=>Le(a),Me=Q(function(a,e){const t=he(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,G(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:K(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=X.getLocalizedStrings(),r=G(e.selectedAccount.tranListType),s=Be(t,n,c,r,e.bookCloseDate);B.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(se({uiState:{dateRange:s},type:G(e.selectedAccount.tranListType)})),a(ue(r,T(s),!1,r==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(T(s))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(se({uiState:{scrollYOffset:t},type:G(e.selectedAccount.tranListType)}))}}})(ee),F=ae(function({...a}){const e=U(),t=w(),n=q(),c=t.pathname.substring(t.pathname.lastIndexOf("/")+1),{tenantEmailDomain:o}=H(),r=X.getLocalizedStrings(),{accountType:s,title:u,subTitle:h}=Ce(c),D="month",g=L(p=>R(p)),Y=g.company?.companyInfo.firstMonthOfFY??1,{dataAvailable:y,initialTimeframeTick:S}=ze(c,Y,g.bookCloseDate),[k,j]=A.useState(!1),[M,P]=A.useState(void 0),m=A.useMemo(()=>{const p=T(S);return{tranListType:c,accountType:Z(s),title:u,subTitle:h,timeframe:D,period:p}},[c,D,s,y]);A.useEffect(()=>{if(!k&&m!=null){j(!0),B.trackTransactionList(void 0,void 0,void 0,m.title);const p=G(m.tranListType);n(ue(p,m.period,!0,p==="missingReceipts"?r.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[k,m,n]);let I=m;return m!=null&&M!=null&&(I={...m,period:M}),I==null?i.jsx(z,{to:"../"}):i.jsx(Me,{firstMonthOfFY:Y,tenantEmailDomain:o,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:y,navigate:e,selectedAccount:I,referrerType:c,bookCloseDate:g.bookCloseDate,onSelectedTimePeriodChange:p=>P(p),...a})}),Ce=a=>{let e="",t="",n="";const c=X.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=c.uncategorizedTransactionList.income.title,n=c.uncategorizedTransactionList.income.subTitle;break;case"uncategorized-expense":e="expenses",t=c.uncategorizedTransactionList.expense.title,n=c.uncategorizedTransactionList.expense.subTitle;break;case"miscategorized-expense":e="expenses",t=c.miscategorizedTransactionList.expense.title,n=c.miscategorizedTransactionList.expense.subTitle;break;case"miscategorized-income":e="income",t=c.miscategorizedTransactionList.income.title,n=c.miscategorizedTransactionList.income.subTitle;break;case"missing-receipts":t=c.uncategorizedTransactionList.missingReceipt.title,n=c.uncategorizedTransactionList.missingReceipt.subTitle}return{accountType:e,title:t,subTitle:n}},ze=(a,e,t)=>{const n=ie();let c=ie().startOf("month").subtract(11,"month");return t!=null&&a!=="missing-receipts"?t.add(1,"day").isBefore(c)?{dataAvailable:{startDate:t.add(1,"day"),endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}:(c=t.add(1,"day"),{dataAvailable:{startDate:c,endDate:n},initialTimeframeTick:{startDate:c,endDate:n}}):{dataAvailable:ne(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Be=(a,e,t,n,c)=>{let o=e;return n==="missingReceipts"||c==null?a.startDate.isBefore(e.startDate,t)?o={startDate:a.startDate,endDate:e.endDate}:a.startDate.isAfter(e.endDate,t)?o={startDate:e.startDate,endDate:a.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(a)}`):o=a.startDate.isBefore(c,t)?{startDate:c.add(1,"day"),endDate:e.endDate}:{startDate:a.startDate,endDate:e.endDate},o},Oe=Q(function(a,e){const t=ke(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:K(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Te();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(me(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(re({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ee),Fe=ae(function({referrerType:a,...e}){const t=U(),n=w(),c=q(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,classIdEncoded:u,timeframe:h,startDate:D,endDate:g,titleEncoded:Y}=H(),y=E(r??""),S=E(s??""),k=E(u??""),j=E(Y??""),M=L(f=>Se(f.transactionListState,S,y,k)),[P,m]=A.useState(!1),[I,p]=A.useState(void 0),N=L(f=>R(f)),$=N.company?.companyInfo.firstMonthOfFY??1;let d;const l=Ge(y,S,k,h,D,g,j);if(l){const f={startDate:x(D,"YYYY-MM-DD"),endDate:x(g,"YYYY-MM-DD")},V=Ne(M?.dateRange,f);d={accountId:S,accountType:Z(y),classId:k,title:j,timeframe:h,period:V}}A.useEffect(()=>{P||d==null||(m(!0),B.trackTransactionList(d.accountId,void 0,a,d.title),c(me(d.accountId,d.accountType,d.classId,d.period)))},[P,d,c]);let C=d;d!=null&&I!=null&&(C={...d,period:I});const O=[r,s,u,h,D,g,Y].filter(f=>f!=null);return l&&C!=null?i.jsx(Oe,{firstMonthOfFY:$,tenantEmailDomain:o,location:n,navigate:t,selectedAccount:C,referrerType:a,onSelectedTimePeriodChange:f=>p(f),...e}):i.jsx(z,{to:Te(O.length)})}),Te=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Ge=(a,e,t,n,c,o,r)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&x(c,"YYYY-MM-DD").isValid()&&x(o,"YYYY-MM-DD").isValid()&&r!=null,Ne=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),_e=Q(function(a,e){const t=be(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&ve(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:W(e.selectedAccount.period),dataAvailableForPeriod:ne(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:K(a)}},function(a,e){return{onBackClick:()=>{const t=te(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??De();e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();let o=n;t.startDate.isBefore(n.startDate,c)?o={startDate:t.startDate,endDate:n.endDate}:t.startDate.isAfter(n.endDate,c)?o={startDate:n.startDate,endDate:t.endDate}:console.error(`Invalid addTimePeriod ${JSON.stringify(t)}`),B.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(pe(e.selectedAccount.accountId,e.selectedAccount.accountType,T(o))),e.onSelectedTimePeriodChange(T(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=ce(t,e.tenantEmailDomain),c=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(de({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=$e(e.tenantEmailDomain),n=_(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ee),le=ae(function({referrerType:a,...e}){const t=U(),n=w(),c=q(),{tenantEmailDomain:o,accountTypeEncoded:r,accountIdEncoded:s,timeframe:u,startDate:h,endDate:D,titleEncoded:g,excludeSubAccounts:Y}=H(),y=E(r??""),S=E(s??""),k=E(g??""),j=!(Y!=null&&Y==="exclude_subaccounts"),M=L(b=>Ie(b.transactionListState,S,y)),[P,m]=A.useState(!1),[I,p]=A.useState(void 0),N=L(b=>R(b)),$=N.company?.featuresActivationInfo.connectedAccountProvider==="unit",d=N.company?.companyInfo.firstMonthOfFY??1;let l;const C=we(y,S,u,h,D,k);if(C){const b={startDate:x(h,"YYYY-MM-DD"),endDate:x(D,"YYYY-MM-DD")},ye=Re(M?.dateRange,b);l={accountId:S,accountType:Z(y),title:k,timeframe:u,period:ye}}let O=l;l!=null&&I!=null&&(O={...l,period:I});const{useFeatureGate:f}=fe(),{isFeatureEnabled:V}=f(J.isTransactionCommentingEnabled),{areTenantIdsInSync:oe}=Pe();A.useEffect(()=>{!P&&l!=null&&oe&&(m(!0),B.trackTransactionList(l.accountId,void 0,a,l.title),c(pe(l.accountId,l.accountType,l.period,void 0,!1,j)))},[P,l,c,oe]);const ge=[r,s,u,h,D,g].filter(b=>b!=null);return C&&O!=null?i.jsx(_e,{firstMonthOfFY:d,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:$,isTransactionCommentingEnabled:V,selectedAccount:O,referrerType:a,onSelectedTimePeriodChange:b=>p(b),...e}):i.jsx(z,{to:De(ge.length)})}),De=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},we=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&x(n,"YYYY-MM-DD").isValid()&&x(c,"YYYY-MM-DD").isValid()&&o!=null,Re=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?T(a):T(e),$e=a=>`/${a}/transactions/${Ye}/statements`;function mt(){const a=w().state?.referrer,e=Ee.getSignedInUser(),t=xe(e),{useFeatureGate:n}=fe(),{isFeatureEnabled:c}=n(J.isExpenseAutomationEnabled),o=L(u=>u.expenseAutomationViewState.selectedPeriodByTenantId)[L(u=>R(u)).tenantId],{isFeatureEnabled:r}=n(J.isExpenseAutomationEnabledV2),s=r||c&&t;return i.jsxs(Ae,{children:[i.jsx(v,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/zeni-clearing-account/statements",element:i.jsx(je,{})}),i.jsx(v,{path:"/*",element:i.jsx(le,{referrerType:a})}),i.jsx(v,{path:"/uncategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/uncategorized-expense/*",element:s?i.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-income/*",element:i.jsx(F,{})}),i.jsx(v,{path:"/miscategorized-expense/*",element:s?i.jsx(z,{to:`../../month_end_close_checks/review/transaction_categorization/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/missing-receipts/*",element:s?i.jsx(z,{to:`../../month_end_close_checks/review/missing_receipts/${o.month}-${o.year}`}):i.jsx(F,{})}),i.jsx(v,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:i.jsx(Fe,{referrerType:a})})]})}export{mt as default};
@@ -1,4 +1,4 @@
1
- import{j as e}from"./liveblocks-1thjzoaw.js";import{j as B,u as M,h as U,l as O,g as f,N as L,k as N,n as Ie,o as k}from"./core-DGtRv-5L.js";import{ci as V,eM as D,Mx as P,D2 as ae,fb as H,CM as ne,Mz as we,D5 as Te,Mv as ke,Mw as se,MN as be,Bc as je,s1 as Ae,MB as Ee,Dg as ve,My as re,cL as K,w7 as oe,eQ as De,eS as Fe,NI as Le,NJ as Be,CN as Me,NK as Ue,CO as Pe,CX as Re,bu as Oe,bC as Ne,ct as Ve,bD as _e,cN as ze,fa as $e,br as Ge,If as Ze,ch as He}from"./zeni-epic-state-DNuuo8ZV.js";import{C as _,al as Ke,z as A,w as z,d as b,bX as We,bY as Je,bZ as Z,K as W,h as Xe,M as qe,I as Qe,l as ie,c as v,A as Ye,B as et,b_ as tt,ao as J,r as at,b$ as nt,n as X,c0 as st,$ as Q,c1 as rt,a4 as ot}from"./index-qMA2LgL2.js";import{D as it,n as R,S as ct}from"./mui-C-9qGevS.js";import lt from"./NotFoundScreen-Dcn8itM6.js";import{S as Y}from"./SetupPagesScreen-twRyusK_.js";import{a as d}from"./sentry-CooVhpit.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-CCf6ftES.js";import{c as dt}from"./useFetchSuggestedQuestionsWhenReady-C1j3vNVn.js";import{M as ce}from"./MobileAppDrawer-Cm7-zimG.js";import{F as pt}from"./FeaturePreviewScreen-BOOSrzh0.js";import{a as ee}from"./analyticsHelper-CNEn8Hd5.js";import"./recharts-a2B9SbBf.js";import"./analytics-CALyM-hh.js";import"./plaid-DRyXOtiU.js";import"./dnd-Bts1hC9q.js";import"./stripe-DMRn4zHo.js";import"./lottie-TdNUPve2.js";import"./lexical-DcQz2ToX.js";import"./pdf-DhqCrjXb.js";import"./utils-DYt83G2V.js";import"./routePaths-D4gSBLnj.js";import"./BusinessVerificationPageScreen-BzeS5V7y.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="fd6454b5-9883-447d-9349-56bdfedf6aed",t._sentryDebugIdIdentifier="sentry-dbid-fd6454b5-9883-447d-9349-56bdfedf6aed")}catch{}})();const mt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:P(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Te(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}})(We);function ft(){const t=B(),a=M(),n=U(),{tenantEmailDomain:o}=O(),p=_(),r=f(T=>T.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=Ke(r),s=V(p?.loggedInUserRoleMap),[c,i]=d.useState(!1),[y,w]=d.useState(!1),[u,l]=d.useState(!1),g=f(T=>D(T)),h=A.getSignedInUserTenant(o)?.companyId??g.companyId,C=A.getSignedInUser(),S=f(T=>P(T,h)),I=f(T=>T.treasurySetupViewState.fetchState),x=f(T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{c||I!=="Not-Started"||h==null||(i(!0),n(ae(h,!0,!1)))},[c,I,h,n]),d.useEffect(()=>{u||F!=="Not-Started"||h==null||(l(!0),n(H()))},[u,F,h,n]),d.useEffect(()=>{y||x!=="Not-Started"||h==null||(w(!0),n(ne()))},[y,x,h,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const E=g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||I!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(mt,{navigate:t,location:a,companyId:h,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:b})]})}const yt=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:P(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{Z(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Z(a.analytics,"confirm",r,m,"Transfer"),t(ve())},onSaveChangesToLocalStore:s=>{t(Ee(s))},onFetchLinkTokenClick:s=>{t(Ae("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),gt=({isFirstTransfer:t})=>{const a=B(),{tenantEmailDomain:n}=O(),o=U(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[c,i]=d.useState(!1),[y,w]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),l=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),g=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),h=f(x=>D(x)),C=A.getSignedInUserTenant(n)?.companyId??h.companyId,S=f(x=>ke(x)),I=f(x=>P(x,C));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||C==null||(s(!0),o(ae(C,!0,!1)))},[m,u,C,o]),d.useEffect(()=>{c||l!=="Not-Started"||C==null||(i(!0),o(H()))},[c,l,C,o]),d.useEffect(()=>{y||g!=="Not-Started"||C==null||(w(!0),o(ne()))},[y,g,C,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:h,treasurySetupView:I,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{Z(b,"review",S.treasuryTransferMoneyLocalData,I.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},ht=R.div`
1
+ import{j as e}from"./liveblocks-BZlOk8zk.js";import{j as B,u as M,h as U,l as R,g as f,N as L,k as N,n as Ie,o as k}from"./core-C1FHFtWE.js";import{ci as V,eM as D,Mx as P,D2 as ae,fb as H,CM as ne,Mz as we,D5 as Te,Mv as ke,Mw as se,MN as be,Bc as je,s1 as Ae,MB as Ee,Dg as ve,My as re,cL as W,w7 as oe,eQ as De,eS as Fe,NI as Le,NJ as Be,CN as Me,NK as Ue,CO as Pe,CX as Oe,bu as Re,bC as Ne,ct as Ve,bD as _e,cN as ze,fa as $e,br as Ge,If as Ze,ch as He}from"./zeni-epic-state-BEdHTWyp.js";import{C as _,al as We,z as A,E as z,e as b,bX as qe,bY as Je,bZ as Z,q,h as Ke,O as Xe,N as Qe,c as ie,d as v,G as Ye,B as et,b_ as tt,ao as J,y as at,b$ as nt,w as K,c0 as st,v as Q,c1 as rt,a4 as ot}from"./index-DfYl8X58.js";import{D as it,n as O,S as ct}from"./mui-CZhjlxyT.js";import lt from"./NotFoundScreen-D48p5_Tl.js";import{S as Y}from"./SetupPagesScreen-DH25TE2h.js";import{a as d}from"./sentry-BfJuQlQx.js";import{u as ut}from"./useAskAiCfoHostNavButtonProps-D1RMvC2X.js";import{c as dt}from"./useFetchSuggestedQuestionsWhenReady-CgY0vmfG.js";import{M as ce}from"./MobileAppDrawer-CchbWOro.js";import{F as pt}from"./FeaturePreviewScreen-6mma8zAR.js";import{a as ee}from"./analyticsHelper-CEk9SeZV.js";import"./recharts-BBpjoK43.js";import"./analytics-BKunqsaf.js";import"./plaid-BYUv-poR.js";import"./dnd-CKPinqKo.js";import"./stripe-DMRn4zHo.js";import"./lottie-ciaQJ7oN.js";import"./lexical-BhAbdael.js";import"./pdf-9d-sooX0.js";import"./utils-B1VtuHQw.js";import"./routePaths-DgVtUTp9.js";import"./BusinessVerificationPageScreen-CPLYT88K.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},a=new t.Error().stack;a&&(t._sentryDebugIds=t._sentryDebugIds||{},t._sentryDebugIds[a]="f8906fc2-1fee-4d7f-9857-891ecd02df9c",t._sentryDebugIdIdentifier="sentry-dbid-f8906fc2-1fee-4d7f-9857-891ecd02df9c")}catch{}})();const mt=N(function(t,a){const{companyId:n}=a;return{treasurySetupView:P(t,n),analytics:b}},function(t,a){const{navigate:n,analytics:o,treasurySetupView:p}=a;return{onBackClick:()=>{n("../")},onNextClick:()=>{const r=p.fundAllocationLocalData;o.trackTreasuryPortfolioConfirm(r.riskScore,ee(r)),t(Te(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(we(r))}}})(qe);function ft(){const t=B(),a=M(),n=U(),{tenantEmailDomain:o}=R(),p=_(),r=f(T=>T.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=We(r),s=V(p?.loggedInUserRoleMap),[c,i]=d.useState(!1),[y,w]=d.useState(!1),[u,l]=d.useState(!1),g=f(T=>D(T)),h=A.getSignedInUserTenant(o)?.companyId??g.companyId,C=A.getSignedInUser(),S=f(T=>P(T,h)),I=f(T=>T.treasurySetupViewState.fetchState),x=f(T=>T.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(T=>T.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(C==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{c||I!=="Not-Started"||h==null||(i(!0),n(ae(h,!0,!1)))},[c,I,h,n]),d.useEffect(()=>{u||F!=="Not-Started"||h==null||(l(!0),n(H()))},[u,F,h,n]),d.useEffect(()=>{y||x!=="Not-Started"||h==null||(w(!0),n(ne()))},[y,x,h,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const E=g.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||I!=="Completed";return e.jsxs(e.Fragment,{children:[!E&&e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(mt,{navigate:t,location:a,companyId:h,isEditMode:!0,isLoading:E,isReadOnly:!s,treasurySetupView:S,analytics:b})]})}const yt=N(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:be(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:P(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{Z(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{Z(a.analytics,"confirm",r,m,"Transfer"),t(ve())},onSaveChangesToLocalStore:s=>{t(Ee(s))},onFetchLinkTokenClick:s=>{t(Ae("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),gt=({isFirstTransfer:t})=>{const a=B(),{tenantEmailDomain:n}=R(),o=U(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[c,i]=d.useState(!1),[y,w]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),l=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),g=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),h=f(x=>D(x)),C=A.getSignedInUserTenant(n)?.companyId??h.companyId,S=f(x=>ke(x)),I=f(x=>P(x,C));if(A.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||C==null||(s(!0),o(ae(C,!0,!1)))},[m,u,C,o]),d.useEffect(()=>{c||l!=="Not-Started"||C==null||(i(!0),o(H()))},[c,l,C,o]),d.useEffect(()=>{y||g!=="Not-Started"||C==null||(w(!0),o(ne()))},[y,g,C,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:()=>{}}),e.jsx(yt,{analytics:b,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:h,treasurySetupView:I,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{Z(b,"review",S.treasuryTransferMoneyLocalData,I.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},ht=O.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,11 +6,11 @@ import{j as e}from"./liveblocks-1thjzoaw.js";import{j as B,u as M,h as U,l as O,
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${t=>t.theme.colors.grey4};
9
- `,St={overlayWidth:new Ye(100,100,48)},xt=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:P(t,o),downloadEndPoint:`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:p,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:c=>{let i="page-not-found";c==="editPortfolio"?i=Ct(s):c==="statements"?i=It(s):c==="taxLetter"?i=wt(s):c==="settings"&&(i=Tt(s));const y=at(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:y}})},onColumnSortConfigChanged:(c,i)=>{t(Le({uiState:{sortKey:c,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(tt);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=M(),o=B(),p=U(),r=W(),m=Xe(),s=f(j=>D(j)),{tenantEmailDomain:c}=O(),i=s.companyId??A.getSignedInUserTenant(c)?.companyId,[y,w]=d.useState(!1),u=f(j=>re(j)),l=u.fetchState,g=u.accountSummary?.totalBalance?.amount,h=f(j=>j.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),I=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=V(S?.loggedInUserRoleMap),F=K(S?.loggedInUserRoleMap),{areTenantIdsInSync:E}=qe();d.useEffect(()=>{l==="Not-Started"&&!y&&E&&(w(!0),p(oe(!0)))},[y,p,l,E]),d.useEffect(()=>{u.transactionsFetchState.fetchState==="Completed"&&u.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[u.transactionsFetchState.fetchState,u.transactions.length]);const T=()=>{o("..")},[le,ue]=d.useState(!1),q=j=>{ue(j)},{isAiCfoOpen:de,setIsAiCfoOpen:pe}=Qe(),{isAiCfoAccessEnabled:me,onAskAiCfoClick:fe}=ut({isAiCfoOpen:de,setIsAiCfoOpen:pe,mobileExploreReferrer:"Treasury"});dt({isDataReady:l==="Completed"});const{useFeatureGate:$}=ie(),{isFeatureEnabled:ye}=$(v.isDebitCardFeatureEnabled),{isFeatureEnabled:ge}=$(v.isAutoTransferRuleEnabled),{isFeatureEnabled:he}=$(v.isTreasuryCommentingEnabled),Se=De(s),xe=Fe(ye,s);if(Se===!0&&xe!==!0)return e.jsx(pt,{});if(C){const j=h?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&h?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(it,{onClose:T,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:St.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(kt,{onClick:Ce=>Ce.stopPropagation(),children:[t===!0?e.jsx(gt,{isFirstTransfer:u.transactions.length===0||g===0}):null,a===!0?e.jsx(ft,{}):null]})}),e.jsxs(ht,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:q}),e.jsx(xt,{treasuryDetailsView:u,isAutoTransferRuleEnabled:ge,navigate:o,currentTenant:s,location:n,companyId:i,analytics:b,isTreasuryCommentingEnabled:he,handleDrawerToggle:q,isLoading:j,isAiCfoAccessEnabled:me,onAskAiCfoClick:fe})]})]})}return I&&x?e.jsx(L,{to:"../setup"}):s.companyTreasuryInfo?.info&&!I&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(et,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const Ct=t=>`/${t}/treasury/edit-portfolio`,It=t=>`/${t}/treasury/statements`,wt=t=>`/${t}/treasury/tax-letter`,Tt=t=>`/${t}/treasury/setup`,kt=R(ct)`
9
+ `,St={overlayWidth:new Ye(100,100,48)},xt=N(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:P(t,o),downloadEndPoint:`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account/statements?query={"statement_type":"tax_statement"}`}},function(t,a){const{navigate:n,currentTenant:o,location:p,handleDrawerToggle:r,analytics:m}=a,{tenantEmailDomain:s}=o;return{onSettingsClick:()=>{m.trackAccountsListPageClicked("Settings Icon"),n("setup")},onReloadTransactions:()=>{t(oe(!0))},handleTreasuryOptionSelection:c=>{let i="page-not-found";c==="editPortfolio"?i=Ct(s):c==="statements"?i=It(s):c==="taxLetter"?i=wt(s):c==="settings"&&(i=Tt(s));const y=at(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:y}})},onColumnSortConfigChanged:(c,i)=>{t(Le({uiState:{sortKey:c,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(tt);function G({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=M(),o=B(),p=U(),r=q(),m=Ke(),s=f(j=>D(j)),{tenantEmailDomain:c}=R(),i=s.companyId??A.getSignedInUserTenant(c)?.companyId,[y,w]=d.useState(!1),u=f(j=>re(j)),l=u.fetchState,g=u.accountSummary?.totalBalance?.amount,h=f(j=>j.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),C=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),I=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=V(S?.loggedInUserRoleMap),F=W(S?.loggedInUserRoleMap),{areTenantIdsInSync:E}=Xe();d.useEffect(()=>{l==="Not-Started"&&!y&&E&&(w(!0),p(oe(!0)))},[y,p,l,E]),d.useEffect(()=>{u.transactionsFetchState.fetchState==="Completed"&&u.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[u.transactionsFetchState.fetchState,u.transactions.length]);const T=()=>{o("..")},[le,ue]=d.useState(!1),X=j=>{ue(j)},{isAiCfoOpen:de,setIsAiCfoOpen:pe}=Qe(),{isAiCfoAccessEnabled:me,onAskAiCfoClick:fe}=ut({isAiCfoOpen:de,setIsAiCfoOpen:pe,mobileExploreReferrer:"Treasury"});dt({isDataReady:l==="Completed"});const{useFeatureGate:$}=ie(),{isFeatureEnabled:ye}=$(v.isDebitCardFeatureEnabled),{isFeatureEnabled:ge}=$(v.isAutoTransferRuleEnabled),{isFeatureEnabled:he}=$(v.isTreasuryCommentingEnabled),Se=De(s),xe=Fe(ye,s);if(Se===!0&&xe!==!0)return e.jsx(pt,{});if(C){const j=h?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&h?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:b,onLoad:()=>{}}):null,e.jsx(it,{onClose:T,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:St.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(kt,{onClick:Ce=>Ce.stopPropagation(),children:[t===!0?e.jsx(gt,{isFirstTransfer:u.transactions.length===0||g===0}):null,a===!0?e.jsx(ft,{}):null]})}),e.jsxs(ht,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:X}),e.jsx(xt,{treasuryDetailsView:u,isAutoTransferRuleEnabled:ge,navigate:o,currentTenant:s,location:n,companyId:i,analytics:b,isTreasuryCommentingEnabled:he,handleDrawerToggle:X,isLoading:j,isAiCfoAccessEnabled:me,onAskAiCfoClick:fe})]})]})}return I&&x?e.jsx(L,{to:"../setup"}):s.companyTreasuryInfo?.info&&!I&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(et,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const Ct=t=>`/${t}/treasury/edit-portfolio`,It=t=>`/${t}/treasury/statements`,wt=t=>`/${t}/treasury/tax-letter`,Tt=t=>`/${t}/treasury/setup`,kt=O(ct)`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  flex-direction: column;
13
- `,bt=R.div`
13
+ `,bt=O.div`
14
14
  display: flex;
15
15
  height: 100vh;
16
16
  width: 100%;
@@ -18,7 +18,7 @@ import{j as e}from"./liveblocks-1thjzoaw.js";import{j as B,u as M,h as U,l as O,
18
18
  flex-direction: column;
19
19
  align-items: center;
20
20
  background-color: ${t=>t.theme.colors.grey4};
21
- `;function jt(){const t=B(),a=U(),n=W(),o=M(),p=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Be(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Me(!1)))},[r,s.fetchState,a]);const c=A.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},w=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:n,children:e.jsx(nt,{currentTenantCompanyName:w,statementListView:s,isLoading:u,onBackClick:()=>{const l=X(o.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const At=R.div`
21
+ `;function jt(){const t=B(),a=U(),n=q(),o=M(),p=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Be(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Me(!1)))},[r,s.fetchState,a]);const c=A.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},w=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(bt,{windowSize:n,children:e.jsx(nt,{currentTenantCompanyName:w,statementListView:s,isLoading:u,onBackClick:()=>{const l=K(o.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const At=O.div`
22
22
  display: flex;
23
23
  height: 100vh;
24
24
  width: 100%;
@@ -26,7 +26,7 @@ import{j as e}from"./liveblocks-1thjzoaw.js";import{j as B,u as M,h as U,l as O,
26
26
  flex-direction: column;
27
27
  align-items: center;
28
28
  background-color: ${t=>t.theme.colors.grey4};
29
- `;function Et(){const t=B(),a=W(),n=M(),o=U(),p=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Ue(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Pe(!1)))},[r,s.fetchState,o]);const c=A.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},w=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(At,{windowSize:a,children:e.jsx(st,{currentTenantCompanyName:w,taxLetterListView:s,isLoading:u,onBackClick:()=>{const l=X(n.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const vt=N(function(t,a){const{companyId:n}=a,o=P(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Re(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(rt),Dt=()=>{const t=B(),a=M(),n=U(),{tenantEmailDomain:o}=O(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,c]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||y==null||(c(!0),n(H()))},[i,n]);const y=A.getSignedInUserTenant(o)?.companyId??m.companyId,w=A.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,l=S=>{r(S)};if(w==null)throw Error("Can't access treasury promo page without signing in...");const g=_(),h=V(g?.loggedInUserRoleMap),C=K(g?.loggedInUserRoleMap);if(u&&h)return e.jsx(L,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&h||C)){if(a.state?.message==="activation"){const S=X(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:S=>(I=>I.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:l}),e.jsx(vt,{analytics:b,navigate:t,companyId:y,onClickMenuIcon:()=>{l(!0)}})]})}return e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})})},te=R.div`
29
+ `;function Et(){const t=B(),a=q(),n=M(),o=U(),p=`${J.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(l=>Ue(l));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Pe(!1)))},[r,s.fetchState,o]);const c=A.getSignedInUser(),i=f(l=>D(l)),y={userId:c?.userId??"",sessionId:c?.zeniSessionId??"",tenantId:i.tenantId??""},w=i.company?.companyInfo.companyLegalName??i.companyName;if(c==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(At,{windowSize:a,children:e.jsx(st,{currentTenantCompanyName:w,taxLetterListView:s,isLoading:u,onBackClick:()=>{const l=K(n.state?.pathnameStackToGoBack),g=l.poppedPathname??"..";t(g,{state:{pathnameStackToGoBack:l.newStack}})},authParams:y,downloadEndPoint:p})})}const vt=N(function(t,a){const{companyId:n}=a,o=P(t,n);return{treasurySetupView:o,isSetupComplete:o.companyTreasuryInfo?.businessVerificationStatus?.code==="verified",videoUrl:"https://www.youtube.com/watch?v=sqvJWKCMZgk",meetingUrl:"https://meetings.hubspot.com/yoshi-araki/treasury-product-schedule-demo-link?embed=true"}},function(t,a){const{navigate:n,companyId:o}=a;return{onSetupButtonClick:()=>{t(Oe(o))},onBackClick:()=>{n("../..",{relative:"path"})},onTreasurySetupSuccess:p=>{n(p?"..":"../setup",{relative:"path"})}}})(rt),Dt=()=>{const t=B(),a=M(),n=U(),{tenantEmailDomain:o}=R(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,c]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||y==null||(c(!0),n(H()))},[i,n]);const y=A.getSignedInUserTenant(o)?.companyId??m.companyId,w=A.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,l=S=>{r(S)};if(w==null)throw Error("Can't access treasury promo page without signing in...");const g=_(),h=V(g?.loggedInUserRoleMap),C=W(g?.loggedInUserRoleMap);if(u&&h)return e.jsx(L,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&h||C)){if(a.state?.message==="activation"){const S=K(a.state?.pathnameStackToGoBack);t(a.pathname,{state:{...a.state,message:void 0,pathnameStackToGoBack:S.newStack}})}return i?.fetchState!=="Completed"?e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:b,onLoad:S=>(I=>I.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:l}),e.jsx(vt,{analytics:b,navigate:t,companyId:y,onClickMenuIcon:()=>{l(!0)}})]})}return e.jsx(te,{children:e.jsx(Q,{size:"ExtraLarge",start:!0})})},te=O.div`
30
30
  display: flex;
31
31
  width: 100%;
32
32
  height: 100%;
@@ -34,4 +34,4 @@ import{j as e}from"./liveblocks-1thjzoaw.js";import{j as B,u as M,h as U,l as O,
34
34
  justify-content: center;
35
35
  align-items: center;
36
36
  background-color: ${t=>t.theme.colors.grey5};
37
- `;function ta(){const t=M(),a=f(E=>D(E)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=K(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Oe(a?.userRole),c=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),i=Ve(r?.loggedInUserRoleMap),y=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&_e(r?.loggedInUserRoleMap),{isFeatureEnabled:w}=n(v.isDepositAccountsFeatureEnabled),u=w&&!s&&ze(r?.loggedInUserRoleMap),l=a.company!=null&&$e(a.company),g=o&&l===!0&&!s&&V(r?.loggedInUserRoleMap),{isFeatureEnabled:h}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:C}=n(v.isDebitCardFeatureEnabled),S=ot(a,h,C)&&!s&&Ge(r?.loggedInUserRoleMap),I=Ze(r?.loggedInUserRoleMap),x=He(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Ie,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:I,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:I,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Dt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Et,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),g?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(lt,{})})]}):p&&g?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{ta as default};
37
+ `;function ta(){const t=M(),a=f(E=>D(E)),{useFeatureGate:n}=ie(),{isFeatureEnabled:o}=n(v.isTreasuryEnabled),p=!!a.company?.companyTreasuryInfo?.isTreasuryTOSAccepted,r=_(),m=W(r?.loggedInUserRoleMap),s=a?.userRole!=null&&Re(a?.userRole),c=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),i=Ve(r?.loggedInUserRoleMap),y=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&_e(r?.loggedInUserRoleMap),{isFeatureEnabled:w}=n(v.isDepositAccountsFeatureEnabled),u=w&&!s&&ze(r?.loggedInUserRoleMap),l=a.company!=null&&$e(a.company),g=o&&l===!0&&!s&&V(r?.loggedInUserRoleMap),{isFeatureEnabled:h}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:C}=n(v.isDebitCardFeatureEnabled),S=ot(a,h,C)&&!s&&Ge(r?.loggedInUserRoleMap),I=Ze(r?.loggedInUserRoleMap),x=He(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(Ie,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:I,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:c,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:y,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:g,isUserHasOnlyCardAccess:I,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(Dt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(Et,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx(G,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),g?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx(G,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx(G,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(lt,{})})]}):p&&g?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../setup"})}):a.company?.companyZeniAccountInfo&&m?e.jsx(k,{path:"*",element:e.jsx(L,{to:"../promo",state:t.state})}):e.jsx(k,{path:"*",element:null})]})}export{ta as default};
@@ -1,4 +1,4 @@
1
- import{j as l}from"./liveblocks-1thjzoaw.js";import{a as g}from"./sentry-CooVhpit.js";import{j as M,u as q,l as B,g as S,k as G,h as Y,n as nt,o as J,N as K}from"./core-DGtRv-5L.js";import{eM as O,Jd as Ee,Je as Ue,fJ as ee,co as be,cp as ke,uI as ft,Jf as st,uM as Yt,Hq as te,jl as ae,uG as qt,uA as Ht,Jg as Ne,us as Qt,ur as Wt,ul as Zt,ux as Xt,uN as ea,Jh as pe,Ji as Me,ut as ta,Jj as he,eX as gt,v0 as vt,uV as xt,Jk as Tt,nN as Ct,uQ as yt,uO as Dt,Jl as It,v7 as Et,v4 as bt,uR as kt,v6 as Ge,FS as wt,Jm as aa,Jn as na,cr as sa,Jo as oa,Jp as la,Jq as me,Jr as ce,Js as we,Hr as $e,vm as ye,Hp as De,v9 as At,uJ as Ke,Jt as ia,Hs as Q,Ju as ze,uD as ca,Jv as da,Jw as ra,Jx as Ye,Jy as qe,Jz as He,JA as Qe,vg as Ae,JB as jt,uZ as Ft,JC as ua,JD as pa,JE as ha,JF as ma,JG as Sa,JH as fa,JI as ga,JJ as va,sd as xa,se as Ta,Gw as Fe,JK as Ca,JL as ya,iK as Pe,bp as Da,JM as Ia,JN as Ea,kj as ba,ks as ka,Gv as _e,bB as ot,JO as Pt,Gb as _t,JP as wa,JQ as Aa,JR as ja,ku as Fa,JS as lt,JT as it,JU as ct,JV as dt,JW as Pa,kq as _a,JX as Va,kt as La,JY as Oa,JZ as Vt,GS as Lt,jJ as Ja,J_ as Ba,J$ as Ve,K0 as Ot,GQ as Jt,xz as Ra,K1 as Ua,K2 as Na,k1 as Bt,K3 as Ma,K4 as Ga,H2 as $a,pV as Ka,K5 as Rt,K6 as rt,G$ as Le,K7 as ut,K8 as za,H4 as Ya,K9 as qa,Ka as Ha,Kb as Qa,Kc as Wa,Kd as Za,pY as Xa,Ke as en,Ht as tn,Kf as an,GJ as Oe,gs as nn,Kg as sn,Kh as on,gq as ln,Ki as cn,Kj as dn,xD as rn,Kk as un,Kl as pn,Km as hn,Kn as mn,jN as Sn,bm as fn,eS as gn,eQ as vn}from"./zeni-epic-state-DNuuo8ZV.js";import{z as R,al as Je,B as Ut,w as Z,d as P,Q as X,ar as xn,r as N,D as Ie,v as de,as as We,at as Tn,au as Cn,n as Ze,av as yn,h as Dn,K as re,A as Xe,l as ne,c as z,aw as In,k as et,I as Se,ax as En,ay as Nt,M as bn,az as kn,C as wn,aA as An,ao as Mt,aB as jn,o as W,S as Fn,F as Gt,J as Pn,aC as _n,aD as Vn,g as tt,aE as Ln,aF as On,y as Jn,aG as Bn,aH as Rn}from"./index-qMA2LgL2.js";import{n as U,D as Un,S as $t}from"./mui-C-9qGevS.js";import{t as Nn,A as Mn}from"./AddressScreen-DjAh8cOG.js";import ie from"./NotFoundScreen-Dcn8itM6.js";import{F as Gn}from"./FeaturePreviewScreen-BOOSrzh0.js";import{b as H,v as at,c as $n}from"./routePaths-D4gSBLnj.js";import{p as Kt}from"./pathToGoBack-BxDzY9Wz.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-CCf6ftES.js";import{c as ge}from"./useFetchSuggestedQuestionsWhenReady-C1j3vNVn.js";import{M as ve}from"./MobileAppDrawer-Cm7-zimG.js";import{D as Kn}from"./DrawerScreen-D9Gfh7Os.js";import{g as zn,m as Yn}from"./accountMappingHelper-DxgbU7sx.js";import"./recharts-a2B9SbBf.js";import"./analytics-CALyM-hh.js";import"./plaid-DRyXOtiU.js";import"./dnd-Bts1hC9q.js";import"./stripe-DMRn4zHo.js";import"./lottie-TdNUPve2.js";import"./lexical-DcQz2ToX.js";import"./pdf-DhqCrjXb.js";import"./utils-DYt83G2V.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]="c9b09aae-18d9-4fcc-87d9-ddd88358c910",e._sentryDebugIdIdentifier="sentry-dbid-c9b09aae-18d9-4fcc-87d9-ddd88358c910")}catch{}})();const qn=Ie.getLocalizedStrings(),Hn=G(function(e,a){const s=Ue(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(st({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(st({selectedTransaction:void 0})),e(Yt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${H(n,a.tenantEmailDomain)}`,c=N(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(ft(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(xn),Qn=({setShouldNavigateBack:e})=>{const a=M(),s=q(),{scheduleDetailId:t,tenantEmailDomain:n}=B(),{scheduleType:o}=B();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>O(f)),d=Ee(o)??"accrued_expenses",u=R.getSignedInUser();if(u==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Ue(f,d)),m=i.selectedJELinkRowIndex,r=S(f=>ee(f,c.companyId)),p=Je(i.updateStatus.fetchState);g.useEffect(()=>{p==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[p,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const h=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Ut,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[h===!0?l.jsx(Z,{analytics:P,onLoad:()=>{Wn(i,d,r)}}):null,l.jsx(Hn,{signedInUser:u,attachmentEndPoint:`${X}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:d,navigate:a,analytics:P,controllerUserDetails:r,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},zt=e=>{const a=qn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Wn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,d=c.some(m=>m.isRecommendedTransaction===!0),u=be(s.controllers),i=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...zt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:d,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:u,controllerUserIds:i})},Zn=U.div`
1
+ import{j as l}from"./liveblocks-BZlOk8zk.js";import{a as g}from"./sentry-BfJuQlQx.js";import{j as M,u as q,l as J,g as S,k as G,h as Y,n as nt,o as B,N as K}from"./core-C1FHFtWE.js";import{eM as O,Jd as Ee,Je as Ue,fK as ee,co as be,cp as ke,uI as ft,Jf as st,uM as Yt,Hq as te,jm as ae,uG as qt,uA as Ht,Jg as Ne,us as Qt,ur as Wt,ul as Zt,ux as Xt,uN as ea,Jh as pe,Ji as Me,ut as ta,Jj as he,eX as gt,v0 as vt,uV as xt,Jk as Tt,nO as Ct,uQ as yt,uO as Dt,Jl as It,v7 as Et,v4 as bt,uR as kt,v6 as Ge,FS as wt,Jm as aa,Jn as na,cr as sa,Jo as oa,Jp as la,Jq as me,Jr as ce,Js as we,Hr as $e,vm as ye,Hp as De,v9 as At,uJ as Ke,Jt as ia,Hs as Q,Ju as ze,uD as ca,Jv as da,Jw as ra,Jx as Ye,Jy as qe,Jz as He,JA as Qe,vg as Ae,JB as jt,uZ as Ft,JC as ua,JD as pa,JE as ha,JF as ma,JG as Sa,JH as fa,JI as ga,JJ as va,sd as xa,se as Ta,Gw as Fe,JK as Ca,JL as ya,iL as Pe,bp as Da,JM as Ia,JN as Ea,kk as ba,kt as ka,Gv as _e,bB as ot,JO as Pt,Gb as _t,JP as wa,JQ as Aa,JR as ja,kv as Fa,JS as lt,JT as it,JU as ct,JV as dt,JW as Pa,kr as _a,JX as Va,ku as La,JY as Oa,JZ as Vt,GS as Lt,jK as Ba,J_ as Ja,J$ as Ve,K0 as Ot,GQ as Bt,xz as Ra,K1 as Ua,K2 as Na,k2 as Jt,K3 as Ma,K4 as Ga,H2 as $a,pV as Ka,K5 as Rt,K6 as rt,G$ as Le,K7 as ut,K8 as za,H4 as Ya,K9 as qa,Ka as Ha,Kb as Qa,Kc as Wa,Kd as Za,pY as Xa,Ke as en,Ht as tn,Kf as an,GJ as Oe,gt as nn,Kg as sn,Kh as on,gr as ln,Ki as cn,Kj as dn,xD as rn,Kk as un,Kl as pn,Km as hn,Kn as mn,jO as Sn,bm as fn,eS as gn,eQ as vn}from"./zeni-epic-state-BEdHTWyp.js";import{z as R,al as Be,B as Ut,E as Z,e as P,T as X,ar as xn,y as N,D as Ie,X as de,as as We,at as Tn,au as Cn,w as Ze,av as yn,h as Dn,q as re,G as Xe,c as ne,d as z,aw as In,n as et,N as Se,ax as En,ay as Nt,O as bn,az as kn,C as wn,aA as An,ao as Mt,aB as jn,f as W,S as Fn,I as Gt,J as Pn,aC as _n,aD as Vn,i as tt,aE as Ln,aF as On,s as Bn,aG as Jn,aH as Rn}from"./index-DfYl8X58.js";import{n as U,D as Un,S as $t}from"./mui-CZhjlxyT.js";import{t as Nn,A as Mn}from"./AddressScreen-DA--hhk1.js";import ie from"./NotFoundScreen-D48p5_Tl.js";import{F as Gn}from"./FeaturePreviewScreen-6mma8zAR.js";import{b as H,v as at,c as $n}from"./routePaths-DgVtUTp9.js";import{p as Kt}from"./pathToGoBack-BQU-ldKZ.js";import{u as fe}from"./useAskAiCfoHostNavButtonProps-D1RMvC2X.js";import{c as ge}from"./useFetchSuggestedQuestionsWhenReady-CgY0vmfG.js";import{M as ve}from"./MobileAppDrawer-CchbWOro.js";import{D as Kn}from"./DrawerScreen-DAAT8x3I.js";import{g as zn,m as Yn}from"./accountMappingHelper-DXGp115l.js";import"./recharts-BBpjoK43.js";import"./analytics-BKunqsaf.js";import"./plaid-BYUv-poR.js";import"./dnd-CKPinqKo.js";import"./stripe-DMRn4zHo.js";import"./lottie-ciaQJ7oN.js";import"./lexical-BhAbdael.js";import"./pdf-9d-sooX0.js";import"./utils-B1VtuHQw.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]="87753508-aed3-4454-8e09-6990ff8db12a",e._sentryDebugIdIdentifier="sentry-dbid-87753508-aed3-4454-8e09-6990ff8db12a")}catch{}})();const qn=Ie.getLocalizedStrings(),Hn=G(function(e,a){const s=Ue(e,a.scheduleTab),t=e.tenantState.currentTenantId;return{authParams:{userId:a.signedInUser.userId??"",sessionId:a.signedInUser.zeniSessionId??"",tenantId:t??""},linkBillExpenseView:s.linkBillExpenseView,transactions:s.linkBillExpenseView.transactions}},function(e,a){const{navigate:s,location:t}=a;return{onTransactionSelect(n){e(st({selectedTransaction:n}))},onBackClick:()=>{s("..",{relative:"path"})},onCancel(){e(st({selectedTransaction:void 0})),e(Yt()),s("..",{relative:"path"})},onTransactionClick:n=>{const o=`${H(n,a.tenantEmailDomain)}`,c=N(t.state?.pathnameStackToGoBack,t.pathname);s(o,{state:{pathnameStackToGoBack:c}})},onLinkSave(){a.setShouldNavigateBack(!1),e(ft(a.scheduleTab,a.scheduleAccruedDetailsView.selectedJEAccruedSchedule?.jeScheduleId))}}})(xn),Qn=({setShouldNavigateBack:e})=>{const a=M(),s=q(),{scheduleDetailId:t,tenantEmailDomain:n}=J(),{scheduleType:o}=J();if(n==null)throw Error("Can't access Link Bill Expense page without tenant Email Domain");const c=S(f=>O(f)),d=Ee(o)??"accrued_expenses",u=R.getSignedInUser();if(u==null)throw Error("Can't access Link Bill Expensedetail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const i=S(f=>Ue(f,d)),m=i.selectedJELinkRowIndex,r=S(f=>ee(f,c.companyId)),p=Be(i.updateStatus.fetchState);g.useEffect(()=>{p==="In-Progress"&&i.updateStatus.fetchState==="Completed"&&a("..",{relative:"path"})},[p,i.updateStatus.fetchState]),g.useEffect(()=>{i.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]),g.useEffect(()=>{i.selectedJEAccruedSchedule!=null&&i.selectedJELinkRowIndex!=null||a("..",{relative:"path"})},[i.selectedJEAccruedSchedule,i.selectedJELinkRowIndex]);const h=i.linkBillExpenseView.fetchState==="Completed";return l.jsx(l.Fragment,{children:i.linkBillExpenseView.fetchState==="In-Progress"?l.jsx(Ut,{fetchState:i.linkBillExpenseView.fetchState}):i.selectedJEAccruedSchedule!=null&&m!=null?l.jsxs(l.Fragment,{children:[h===!0?l.jsx(Z,{analytics:P,onLoad:()=>{Wn(i,d,r)}}):null,l.jsx(Hn,{signedInUser:u,attachmentEndPoint:`${X}/vendor_attachments`,setShouldNavigateBack:e,scheduleVendorId:i.selectedJEAccruedSchedule.vendor.id??"",location:s,tenantEmailDomain:n,scheduleAccruedDetailsView:i,saveFetchState:i.updateStatus.fetchState,scheduleTab:d,navigate:a,analytics:P,controllerUserDetails:r,saveStatus:i.updateStatus.fetchState,jeAccruedSchedule:i.selectedJEAccruedSchedule,localData:i.scheduleAccruedDetailsLocalData.jeScheduleDetails[m]})]}):null})},zt=e=>{const a=qn.dateFormat.analytics.YYYYDashMMDashDDFormat;return{scheduleCreateDate:e.createTime.format(a)??null,scheduleMonthlyAmount:e.recurringAmount??null,startingBalance:e.otherAttributes.startingBalance??null,scheduleAccountCategory:e.jeCredit.account?.accountName??null,description:e.memo,runningBalance:e.balanceAsOfToday??null,currentBalance:e.balanceAsOfToday??null,currentStatus:e.status.label,period:e.period??null,startMonth:e.startDate?.format(a)??null,endMonth:e.endDate?.format(a)??null}},Wn=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=e.selectedJELinkRowIndex;let o;n!=null&&t!=null&&(o=t.scheduledJournalEntry[n]);const{transactions:c}=e.linkBillExpenseView,d=c.some(m=>m.isRecommendedTransaction===!0),u=be(s.controllers),i=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsJournalEntryLinkedLoaded({scheduleType:a,schedule:{...zt(t)},scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},journalEntryDetails:{wasRecommendationAvailable:d,journalEntryPostingStatus:o?.status.label??""},vendorName:t.vendor.name??null,controllerEmails:u,controllerUserIds:i})},Zn=U.div`
2
2
  display: flex;
3
3
  min-height: 100%;
4
4
  width: 100%;
@@ -6,7 +6,7 @@ import{j as l}from"./liveblocks-1thjzoaw.js";import{a as g}from"./sentry-CooVhpi
6
6
  flex-direction: column;
7
7
  align-items: center;
8
8
  background-color: ${e=>e.theme.colors.grey4};
9
- `,Xn=G(function(e){const a=O(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Ne(e,"common");return{tenantName:a.companyName,vendorSearchAutoCompleteData:{autoCompleteText:s,entityAutoCompleteView:t}}},function(e,a){const{navigate:s,location:t}=a,n="accrued_expenses";return{onNavigateBack:()=>{s("../schedules/accrued_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:o=>{a.setShouldNavigateBack(!0),e(ft(n,o))},onDelete:o=>{e(ta(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Me({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onEditAmount:(o,c)=>{e(ea(n,o,c))},onJELinkClick:o=>{e(Xt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,d)=>{e(Zt(o,c,d))},onTransactionClick:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewPostedJE:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewRecordedJE:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewBillExpense:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onDetailPageChange:(o,c,d)=>{const{scheduleDetailsAccruedExpensesSection:u}=o,{amount:i,memo:m,months:r,scheduleAccruedExpenseCategory:p,scheduleClass:h,scheduleExpenseCategory:f,startDate:C,vendor:y}=u,E=h.selectedOption!=null?a.classList.find(k=>k.classId===h.selectedOption):void 0,D=f.selectedOption!=null?a.accountList.find(k=>k.qboId===f.selectedOption):void 0,I=p.selectedOption!=null?a.accruedAccountList.find(k=>k.qboId===p.selectedOption):void 0,w=r?.selectedOption;e(Qt({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),d!==!1||a.scheduleDetailId!=null||D?.accountId==null||a.isAccountingClassesEnabled!==!1&&E?.classId==null||I==null||y.selectedOption==null||m==null||i==null&&i==0||C==null||w==null||e(Wt({scheduleType:n}))}}})(Tn),es=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=M(),t=q(),n=Y(),o=de(),{tenantEmailDomain:c}=B(),[d,u]=g.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=B();let m;i!=="new"&&(m=i);const r=ts(i),p=S(x=>x.scheduleAccruedDetailState.selectedJEAccruedScheduleKey),h="accrued_expenses",f=S(x=>Ue(x,"accrued_expenses")),C=S(x=>te(x)),y=S(x=>x.classListState.fetchState),E=S(x=>ae(x)),D=C!=="Completed"||y!=="Completed";g.useEffect(()=>{d===!1&&D?(n(qt(h,m)),u(!0)):D===!1&&d===!1&&i!=="new"&&(n(Ht(h,i)),u(!0))},[d]);const I=S(x=>O(x)),w=S(x=>ee(x,I.companyId)),k=f.fetchState,b=f.allAccountList,j=f.allClassList,F=f.allAccruedAccountList,V=f.scheduleAccruedDetailsLocalData;if(r!==!0||f.fetchState==="Error")return l.jsx(ie,{});const L=k==="Completed"&&d===!0;return k!=="Completed"&&k!=="Not-Started"?l.jsx(We,{}):l.jsxs(Zn,{children:[L===!0?l.jsx(Z,{analytics:P,onLoad:()=>{as(f,h,w)}}):null,l.jsx(Xn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:f,location:t,navigate:s,classList:j,accountList:b,shouldNavigateBack:e,accruedAccountList:F,scheduleLocalData:V,selectedJEScheduleKey:p,scheduleDetailId:m,selectedScheduledJournalEntries:f.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:P,controllerUserDetails:w,isAccountingClassesEnabled:E,status:f.selectedJEAccruedSchedule?.status.code})]})},ts=e=>e!=null,as=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=be(s.controllers),o=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...zt(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},ns=U.div`
9
+ `,Xn=G(function(e){const a=O(e),s=e.entityAutoCompleteState.autoCompleteText.common,t=Ne(e,"common");return{tenantName:a.companyName,vendorSearchAutoCompleteData:{autoCompleteText:s,entityAutoCompleteView:t}}},function(e,a){const{navigate:s,location:t}=a,n="accrued_expenses";return{onNavigateBack:()=>{s("../schedules/accrued_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:o=>{a.setShouldNavigateBack(!0),e(ft(n,o))},onDelete:o=>{e(ta(n,o))},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(o,c)=>{o.trim().length>=2?e(Me({searchString:o,entityType:c,searchOrigin:"common"})):o.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onEditAmount:(o,c)=>{e(ea(n,o,c))},onJELinkClick:o=>{e(Xt({selectedJELinkRowIndex:o})),s("./edit_link")},onCancelAccrual:(o,c,d)=>{e(Zt(o,c,d))},onTransactionClick:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewPostedJE:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewRecordedJE:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onViewBillExpense:o=>{const c=`${H(o,a.tenantEmailDomain)}`,d=N(t.state?.pathnameStackToGoBack,t.pathname);s(c,{state:{pathnameStackToGoBack:d}})},onDetailPageChange:(o,c,d)=>{const{scheduleDetailsAccruedExpensesSection:u}=o,{amount:i,memo:m,months:r,scheduleAccruedExpenseCategory:p,scheduleClass:h,scheduleExpenseCategory:f,startDate:C,vendor:y}=u,E=h.selectedOption!=null?a.classList.find(k=>k.classId===h.selectedOption):void 0,D=f.selectedOption!=null?a.accountList.find(k=>k.qboId===f.selectedOption):void 0,I=p.selectedOption!=null?a.accruedAccountList.find(k=>k.qboId===p.selectedOption):void 0,w=r?.selectedOption;e(Qt({scheduleType:n,localData:c,selectedJeScheduleDetailId:a.scheduleDetailId})),d!==!1||a.scheduleDetailId!=null||D?.accountId==null||a.isAccountingClassesEnabled!==!1&&E?.classId==null||I==null||y.selectedOption==null||m==null||i==null&&i==0||C==null||w==null||e(Wt({scheduleType:n}))}}})(Tn),es=({shouldNavigateBack:e,setShouldNavigateBack:a})=>{const s=M(),t=q(),n=Y(),o=de(),{tenantEmailDomain:c}=J(),[d,u]=g.useState(!1);if(c==null)throw new Error("Can't access this page without a tenantEmailDomain");const{scheduleDetailId:i}=J();let m;i!=="new"&&(m=i);const r=ts(i),p=S(x=>x.scheduleAccruedDetailState.selectedJEAccruedScheduleKey),h="accrued_expenses",f=S(x=>Ue(x,"accrued_expenses")),C=S(x=>te(x)),y=S(x=>x.classListState.fetchState),E=S(x=>ae(x)),D=C!=="Completed"||y!=="Completed";g.useEffect(()=>{d===!1&&D?(n(qt(h,m)),u(!0)):D===!1&&d===!1&&i!=="new"&&(n(Ht(h,i)),u(!0))},[d]);const I=S(x=>O(x)),w=S(x=>ee(x,I.companyId)),k=f.fetchState,b=f.allAccountList,j=f.allClassList,F=f.allAccruedAccountList,V=f.scheduleAccruedDetailsLocalData;if(r!==!0||f.fetchState==="Error")return l.jsx(ie,{});const L=k==="Completed"&&d===!0;return k!=="Completed"&&k!=="Not-Started"?l.jsx(We,{}):l.jsxs(Zn,{children:[L===!0?l.jsx(Z,{analytics:P,onLoad:()=>{as(f,h,w)}}):null,l.jsx(Xn,{setShouldNavigateBack:a,scheduleAccruedDetailsView:f,location:t,navigate:s,classList:j,accountList:b,shouldNavigateBack:e,accruedAccountList:F,scheduleLocalData:V,selectedJEScheduleKey:p,scheduleDetailId:m,selectedScheduledJournalEntries:f.selectedJEAccruedSchedule?.scheduledJournalEntry??[],themeState:o,tenantEmailDomain:c,analytics:P,controllerUserDetails:w,isAccountingClassesEnabled:E,status:f.selectedJEAccruedSchedule?.status.code})]})},ts=e=>e!=null,as=(e,a,s)=>{const t=e.selectedJEAccruedSchedule,n=be(s.controllers),o=ke(s.controllerUserIds);t!=null&&P.trackScheduleAccruedDetailsLoaded({scheduleType:a,scheduleExpenseCategoryAndClass:{expenseCategory:t.jeDebit.account?.accountName??null,expenseClass:t.jeDebit.accountingClass?.className??null},schedule:{...zt(t)},vendorName:t.vendor.name??null,controllerEmails:n,controllerUserIds:o})},ns=U.div`
10
10
  display: flex;
11
11
  min-height: 100%;
12
12
  width: 100%;
@@ -14,7 +14,7 @@ import{j as l}from"./liveblocks-1thjzoaw.js";import{a as g}from"./sentry-CooVhpi
14
14
  flex-direction: column;
15
15
  align-items: center;
16
16
  background-color: ${e=>e.theme.colors.grey4};
17
- `,Be=Ie.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ss=G(function(e){const a=O(e),s=he(e,"fixed_assets");return{tenantName:a.companyName,scheduleDetailsView:s}},function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,c="fixed_assets",d=t.state?.message==="expenseAutomation",u=o.flatMap(i=>i.error).filter(i=>!!i)??[];return{onNavigateBack:()=>{if(d===!0){const i=Ze(a.location.state?.pathnameStackToGoBack),m=i.poppedPathname??Kt(2);a.navigate(m,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Ge(c,i,u.length>0))},onDelete:i=>{e(kt(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(c,a.selectedJEScheduleKey))},onEditAmount:(i,m)=>{e(Et(c,i,m))},onJELinkClick:i=>{e(It({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const m=`${H(i,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:r,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const m=`${H(i,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:r}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,m)=>{i.trim().length>=2?e(Me({searchString:i,entityType:m,searchOrigin:"common"})):i.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onDetailPageChange:(i,m)=>{const{scheduleDetailsFixedAssetsSection:r,scheduleDetailsListSection:p}=i,{scheduleClass:h,scheduleExpenseCategory:f,accumulatedDepreciationCategory:C,assetId:y,months:E,startDate:D,postingDate:I,vendor:w}=r,k=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find(A=>A.id===w?.selectedOption):void 0,b={id:k?.zeniId??w?.selectedOption??"",name:k?.name??w?.defaultOptions.find(A=>A.value===w?.selectedOption)?.label??"",logo:k?.logo},j=h.selectedOption!=null?a.classList.find(A=>A.classId===h.selectedOption):void 0,F=f.selectedOption!=null?a.accountList.find(A=>A.qboId===f.selectedOption):void 0,V=C.selectedOption!=null?a.depAccountList.find(A=>A.qboId===C.selectedOption):void 0,L=E?.selectedOption,x=p.map((A,$)=>({...a.scheduleLocalData.jeScheduleDetails[$],amount:{...a.scheduleLocalData.jeScheduleDetails[$].amount,amount:A.amount}})),_=I.type==="day"?I.dayOfMonth?I.dayOfMonth:1:void 0,T=I.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:F?.accountId,selectedClass:j?.classId,selectedAccumulatedDepreciationCategory:V?.accountId,selectedDate:D,selectedMonths:L,assetId:y,jeScheduleDetails:x,lastDayOfMonth:T,selectedDayOfMonth:_,selectedVendor:b},selectedJeScheduleDetailId:a.scheduleDetailId})),m!==!1||V?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||F?.accountId==null||a.isAccountingClassesEnabled!==!1&&j?.classId==null||D==null||L==null||T!==!0&&_==null||e(Dt({scheduleType:c}))}}})(Cn),os=()=>{const e=M(),a=q(),s=Y(),t=de(),{tenantEmailDomain:n}=B(),[o,c]=g.useState(!1),{scheduleDetailId:d}=B(),u=a.state?.message==="expenseAutomation",i=ls(d),m=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{m!=null&&m.length!==0||d!=="new"||e("../schedules/fixed_assets")},[m,d]);const r="fixed_assets",p=S(T=>he(T,r)),h=S(T=>T.entityAutoCompleteState.autoCompleteText.common),f=S(T=>Ne(T,"common")),C=S(T=>te(T)),y=S(T=>T.classListState.fetchState),E=S(T=>ae(T)),D=S(T=>gt(T).selectedPeriod),I=C!=="Completed"||y!=="Completed";g.useEffect(()=>{o===!1&&I?(s(vt(r,x,!0)),c(!0)):I===!1&&o===!1&&(s(xt(r,d==="new"?void 0:d,!0)),c(!0))},[o]),g.useEffect(()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(Tt()),u===!0){const{month:T,year:A}=D;e(`../../month_end_close_checks/review/je_schedules/${T}-${A}`)}else e("../schedules/fixed_assets")},[p.markAsCompleteStatus.fetchState]);const w=S(T=>O(T)),k=S(T=>ee(T,w.companyId)),b=p.fetchState,j=p.allAccountList,F=p.allClassList,V=p.allDepreciationAccountList,L=p.scheduleDetailsLocalData.fixed_assets;let x;if(d!=="new"&&(x=d),i!==!0||p.fetchState==="Error")return l.jsx(ie,{});const _=b==="Completed"&&o===!0;return b!=="Completed"?l.jsx(We,{}):l.jsxs(ns,{children:[_===!0?l.jsx(Z,{analytics:P,onLoad:()=>{cs(p,r,k)}}):null,l.jsx(ss,{location:a,navigate:e,classList:F,vendorSearchEntityAutoCompleteView:f,vendorSearchAutoCompleteData:{autoCompleteText:h,entityAutoCompleteView:f},expenseAutomationSelectedPeriod:D,usedInExpenseAutomation:u,removeJeScheduleTransactionKey:(T,A)=>{s(Ct(T,A))},accountList:j,depAccountList:V,scheduleLocalData:L,selectedJEScheduleKey:m,scheduleDetailId:x,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:P,controllerUserDetails:k,isAccountingClassesEnabled:E,status:p.selectedJEScheduleTransaction?.status.code})]})},ls=e=>e!=null,is=e=>({transactionDate:e.date.format(Be),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),cs=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=ke(s.controllerUserIds);var d;t!=null&&n!=null&&P.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...is(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(d=n,{currentBalance:d.balanceAsOfToday??null,currentStatus:d.status.label,period:d.period??null,startMonth:d.startDate?.format(Be)??null,endMonth:d.endDate?.format(Be)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},ds=U.div`
17
+ `,Je=Ie.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,ss=G(function(e){const a=O(e),s=he(e,"fixed_assets");return{tenantName:a.companyName,scheduleDetailsView:s}},function(e,a){const{navigate:s,location:t,vendorSearchAutoCompleteData:n,selectedScheduledJournalEntries:o}=a,c="fixed_assets",d=t.state?.message==="expenseAutomation",u=o.flatMap(i=>i.error).filter(i=>!!i)??[];return{onNavigateBack:()=>{if(d===!0){const i=Ze(a.location.state?.pathnameStackToGoBack),m=i.poppedPathname??Kt(2);a.navigate(m,{state:{pathnameStackToGoBack:i.newStack}})}else s("../schedules/fixed_assets")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:i=>{e(Ge(c,i,u.length>0))},onDelete:i=>{e(kt(c,i))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(c,a.selectedJEScheduleKey))},onEditAmount:(i,m)=>{e(Et(c,i,m))},onJELinkClick:i=>{e(It({selectedJELinkRowIndex:i})),s("./edit_link")},onTransactionClick:i=>{const m=`${H(i,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:r,message:"comingFromScheduleDetailsFixedAssets"}})},onViewLinkedJE:i=>{const m=`${H(i,a.tenantEmailDomain)}`,r=N(t.state?.pathnameStackToGoBack,t.pathname);s(m,{state:{pathnameStackToGoBack:r}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(i,m)=>{i.trim().length>=2?e(Me({searchString:i,entityType:m,searchOrigin:"common"})):i.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onDetailPageChange:(i,m)=>{const{scheduleDetailsFixedAssetsSection:r,scheduleDetailsListSection:p}=i,{scheduleClass:h,scheduleExpenseCategory:f,accumulatedDepreciationCategory:C,assetId:y,months:E,startDate:D,postingDate:I,vendor:w}=r,k=n.entityAutoCompleteView.vendor.length>0?n.entityAutoCompleteView.vendor.find(A=>A.id===w?.selectedOption):void 0,b={id:k?.zeniId??w?.selectedOption??"",name:k?.name??w?.defaultOptions.find(A=>A.value===w?.selectedOption)?.label??"",logo:k?.logo},j=h.selectedOption!=null?a.classList.find(A=>A.classId===h.selectedOption):void 0,F=f.selectedOption!=null?a.accountList.find(A=>A.qboId===f.selectedOption):void 0,V=C.selectedOption!=null?a.depAccountList.find(A=>A.qboId===C.selectedOption):void 0,L=E?.selectedOption,x=p.map((A,$)=>({...a.scheduleLocalData.jeScheduleDetails[$],amount:{...a.scheduleLocalData.jeScheduleDetails[$].amount,amount:A.amount}})),_=I.type==="day"?I.dayOfMonth?I.dayOfMonth:1:void 0,T=I.type==="lastDayOfMonth"||void 0;e(yt({scheduleType:c,localData:{selectedAccount:F?.accountId,selectedClass:j?.classId,selectedAccumulatedDepreciationCategory:V?.accountId,selectedDate:D,selectedMonths:L,assetId:y,jeScheduleDetails:x,lastDayOfMonth:T,selectedDayOfMonth:_,selectedVendor:b},selectedJeScheduleDetailId:a.scheduleDetailId})),m!==!1||V?.accountId==null||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||F?.accountId==null||a.isAccountingClassesEnabled!==!1&&j?.classId==null||D==null||L==null||T!==!0&&_==null||e(Dt({scheduleType:c}))}}})(Cn),os=()=>{const e=M(),a=q(),s=Y(),t=de(),{tenantEmailDomain:n}=J(),[o,c]=g.useState(!1),{scheduleDetailId:d}=J(),u=a.state?.message==="expenseAutomation",i=ls(d),m=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{m!=null&&m.length!==0||d!=="new"||e("../schedules/fixed_assets")},[m,d]);const r="fixed_assets",p=S(T=>he(T,r)),h=S(T=>T.entityAutoCompleteState.autoCompleteText.common),f=S(T=>Ne(T,"common")),C=S(T=>te(T)),y=S(T=>T.classListState.fetchState),E=S(T=>ae(T)),D=S(T=>gt(T).selectedPeriod),I=C!=="Completed"||y!=="Completed";g.useEffect(()=>{o===!1&&I?(s(vt(r,x,!0)),c(!0)):I===!1&&o===!1&&(s(xt(r,d==="new"?void 0:d,!0)),c(!0))},[o]),g.useEffect(()=>{if(p.markAsCompleteStatus.fetchState==="Completed")if(s(Tt()),u===!0){const{month:T,year:A}=D;e(`../../month_end_close_checks/review/je_schedules/${T}-${A}`)}else e("../schedules/fixed_assets")},[p.markAsCompleteStatus.fetchState]);const w=S(T=>O(T)),k=S(T=>ee(T,w.companyId)),b=p.fetchState,j=p.allAccountList,F=p.allClassList,V=p.allDepreciationAccountList,L=p.scheduleDetailsLocalData.fixed_assets;let x;if(d!=="new"&&(x=d),i!==!0||p.fetchState==="Error")return l.jsx(ie,{});const _=b==="Completed"&&o===!0;return b!=="Completed"?l.jsx(We,{}):l.jsxs(ns,{children:[_===!0?l.jsx(Z,{analytics:P,onLoad:()=>{cs(p,r,k)}}):null,l.jsx(ss,{location:a,navigate:e,classList:F,vendorSearchEntityAutoCompleteView:f,vendorSearchAutoCompleteData:{autoCompleteText:h,entityAutoCompleteView:f},expenseAutomationSelectedPeriod:D,usedInExpenseAutomation:u,removeJeScheduleTransactionKey:(T,A)=>{s(Ct(T,A))},accountList:j,depAccountList:V,scheduleLocalData:L,selectedJEScheduleKey:m,scheduleDetailId:x,selectedScheduledJournalEntries:p.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,analytics:P,controllerUserDetails:k,isAccountingClassesEnabled:E,status:p.selectedJEScheduleTransaction?.status.code})]})},ls=e=>e!=null,is=e=>({transactionDate:e.date.format(Je),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),cs=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=ke(s.controllerUserIds);var d;t!=null&&n!=null&&P.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...is(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(d=n,{currentBalance:d.balanceAsOfToday??null,currentStatus:d.status.label,period:d.period??null,startMonth:d.startDate?.format(Je)??null,endMonth:d.endDate?.format(Je)??null})},vendorName:n.vendor.name??null,fixedAssetsDetails:{accumulatedDepreciationCategory:n.jeCredit.account?.accountName??null,assetId:n.otherAttributes.assetId??null},controllerEmails:o,controllerUserIds:c})},ds=U.div`
18
18
  display: flex;
19
19
  min-height: 100%;
20
20
  width: 100%;
@@ -22,7 +22,7 @@ import{j as l}from"./liveblocks-1thjzoaw.js";import{a as g}from"./sentry-CooVhpi
22
22
  flex-direction: column;
23
23
  align-items: center;
24
24
  background-color: ${e=>e.theme.colors.grey4};
25
- `,Re=Ie.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,rs=G(function(e,a){const s=O(e),t=he(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}},function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,d=c.flatMap(u=>u.error).filter(u=>!!u)??[];return{onNavigateBack:()=>{if(n===!0){const u=Ze(a.location.state?.pathnameStackToGoBack),i=u.poppedPathname??Kt(2);a.navigate(i,{state:{pathnameStackToGoBack:u.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:u=>{e(Ge(a.scheduleTab,u,d.length>0))},onDelete:u=>{e(kt(a.scheduleTab,u))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(u,i)=>{e(Et(a.scheduleTab,u,i))},onJELinkClick:u=>{e(It({selectedJELinkRowIndex:u})),s("./edit_link")},onTransactionClick:u=>{const i=`${H(u,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetails"}})},onViewLinkedJE:u=>{const i=`${H(u,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(u,i)=>{u.trim().length>=2?e(Me({searchString:u,entityType:i,searchOrigin:"common"})):u.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onDetailPageChange:(u,i)=>{const{scheduleDetailsSection:m,scheduleDetailsListSection:r}=u,{scheduleClass:p,scheduleExpenseCategory:h,months:f,startDate:C,postingDate:y,vendor:E}=m,D=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find(x=>x.id===E?.selectedOption):void 0,I={id:D?.zeniId??E?.selectedOption??"",name:D?.name??E?.defaultOptions.find(x=>x.value===E?.selectedOption)?.label??"",logo:D?.logo},w=p.selectedOption!=null?a.classList.find(x=>x.classId===p.selectedOption):void 0,k=h.selectedOption!=null?a.accountList.find(x=>x.qboId===h.selectedOption):void 0,b=f?.selectedOption,j=r.map((x,_)=>({...a.scheduleLocalData.jeScheduleDetails[_],amount:{...a.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}})),F=y.type==="day"?y.dayOfMonth?y.dayOfMonth:1:void 0,V=y.type==="lastDayOfMonth"||void 0,L={selectedAccount:k?.accountId,selectedClass:w?.classId,selectedDate:C,selectedMonths:b,jeScheduleDetails:j,lastDayOfMonth:V,selectedVendor:I,selectedDayOfMonth:F};e(yt({scheduleType:a.scheduleTab,localData:L,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||k?.accountId==null||a.isAccountingClassesEnabled!==!1&&w?.classId==null||C==null||b==null||V!==!0&&F==null||e(Dt({scheduleType:a.scheduleTab}))}}})(yn),us=()=>{const e=M(),a=q(),s=Y(),t=de(),{tenantEmailDomain:n}=B(),[o,c]=g.useState(!1),d=a.state?.message==="expenseAutomation",{scheduleType:u,scheduleDetailId:i}=B(),m=ps(u,i),r=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{r!=null&&r.length!==0||i!=="new"||e("../schedules/prepaid_expenses")},[r,i]);const p=Ee(u)??"prepaid_expenses",h=S(T=>he(T,p)),f=S(T=>T.entityAutoCompleteState.autoCompleteText.common),C=S(T=>Ne(T,"common")),y=S(T=>te(T)),E=S(T=>T.classListState.fetchState),D=S(T=>ae(T)),I=S(T=>gt(T).selectedPeriod),w=y!=="Completed"||E!=="Completed";g.useEffect(()=>{o===!1&&w?(s(vt(p,x,!0)),c(!0)):w===!1&&o===!1&&(s(xt(p,i==="new"?void 0:i,!0)),c(!0))},[o]),g.useEffect(()=>{if(h.markAsCompleteStatus.fetchState==="Completed")if(s(Tt()),d===!0){const{month:T,year:A}=I;e(`../../month_end_close_checks/review/je_schedules/${T}-${A}`)}else e("../schedules/prepaid_expenses")},[h.markAsCompleteStatus.fetchState]);const k=S(T=>O(T)),b=S(T=>ee(T,k.companyId)),j=h.fetchState,F=h.allAccountList,V=h.allClassList,L=h.scheduleDetailsLocalData;let x;if(i!=="new"&&(x=i),m!==!0||h.fetchState==="Error")return l.jsx(ie,{});const _=j==="Completed"&&o===!0;return j!=="Completed"?l.jsx(We,{}):l.jsxs(ds,{children:[_===!0?l.jsx(Z,{analytics:P,onLoad:()=>{ms(h,p,b)}}):null,l.jsx(rs,{location:a,vendorSearchEntityAutoCompleteView:C,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:C},usedInExpenseAutomation:d,removeJeScheduleTransactionKey:(T,A)=>{s(Ct(T,A))},expenseAutomationSelectedPeriod:I,navigate:e,classList:V,accountList:F,scheduleLocalData:L[p],selectedJEScheduleKey:r,scheduleDetailId:x,selectedScheduledJournalEntries:h.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:p,analytics:P,controllerUserDetails:b,isAccountingClassesEnabled:D,status:h.selectedJEScheduleTransaction?.status.code})]})},ps=(e,a)=>Ee(e)!=null&&a!=null,hs=e=>({transactionDate:e.date.format(Re),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),ms=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=ke(s.controllerUserIds);var d;t!=null&&n!=null&&P.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...hs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(d=n,{currentBalance:d.balanceAsOfToday??null,currentStatus:d.status.label,period:d.period??null,startMonth:d.startDate?.format(Re)??null,endMonth:d.endDate?.format(Re)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},Ss={drawerLeftMargin:new Xe(0,0,100,200)},fs=G(function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:d}=he(e,a.scheduleType),u=O(e),i=c[n].jeScheduleDetails[t].jeLink,m=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,r=m!=null?na(e,m):void 0,p=R.getSignedInUser(),h=e.tenantState.currentTenantId,f={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u.tenantId??h},C=u?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:c[n].jeScheduleDetails[t],saveStatus:d.fetchState,authParams:f,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:C,isDisabled:d.fetchState==="In-Progress"?"readonly":void 0,analytics:P,qboAppUrl:sa(et.qboRedirectionUrl)}},function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(la({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(wt(o))},onSaveClick:()=>{e(Ge(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}})(In),gs=()=>{const e=Dn(),a=M(),s=Y(),{scheduleDetailId:t}=B(),n=re(),o=Ss.drawerLeftMargin.valuePx(n),{scheduleType:c}=B(),{useFeatureGate:d}=ne(),{isFeatureEnabled:u}=d(z.isVendorBulkUpdateOnTransactionEnabled),i=Ee(c)??"prepaid_expenses",[m,r]=g.useState(!1);if(R.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const p=S(D=>he(D,i));g.useEffect(()=>{p.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]);const h=p.selectedJELinkRowIndex,f=h!=null?p.scheduleDetailsLocalData[i].jeScheduleDetails[h]?.jeLink:null,C=f?.type==="recommended"?f.recommendedTransactionID:f?.transactionDetailID;g.useEffect(()=>{C!=null&&s(wt(C))},[]),g.useEffect(()=>{f?.type==="recommended"&&m===!1&&h!=null&&(r(!0),s(aa({scheduleType:i,jeScheduleDetailId:t,rowId:h})))});const y=S(D=>O(D)),E=S(D=>ee(D,y.companyId));return l.jsx(Un,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${o})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:l.jsx(vs,{onClick:D=>D.stopPropagation(),children:p.fetchState!=="Completed"||p.selectedJEScheduleTransaction==null||h==null?l.jsx(Ut,{fetchState:p.fetchState}):l.jsx(fs,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:h,jeScheduledTransaction:p.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:E,isVendorBulkUpdateOnTransactionEnabled:u})})})},vs=U($t)`
25
+ `,Re=Ie.getLocalizedStrings().dateFormat.analytics.YYYYDashMMDashDDFormat,rs=G(function(e,a){const s=O(e),t=he(e,a.scheduleTab);return{tenantName:s.companyName,scheduleDetailsView:t}},function(e,a){const{navigate:s,location:t,usedInExpenseAutomation:n,vendorSearchAutoCompleteData:o,selectedScheduledJournalEntries:c}=a,d=c.flatMap(u=>u.error).filter(u=>!!u)??[];return{onNavigateBack:()=>{if(n===!0){const u=Ze(a.location.state?.pathnameStackToGoBack),i=u.poppedPathname??Kt(2);a.navigate(i,{state:{pathnameStackToGoBack:u.newStack}})}else s("../schedules/prepaid_expenses")},onZeniLogoClick:()=>{a.themeState.toggle()},onSave:u=>{e(Ge(a.scheduleTab,u,d.length>0))},onDelete:u=>{e(kt(a.scheduleTab,u))},onMarkAsComplete:()=>{a.selectedJEScheduleKey!=null&&e(bt(a.scheduleTab,a.selectedJEScheduleKey))},onEditAmount:(u,i)=>{e(Et(a.scheduleTab,u,i))},onJELinkClick:u=>{e(It({selectedJELinkRowIndex:u})),s("./edit_link")},onTransactionClick:u=>{const i=`${H(u,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m,message:"comingFromScheduleDetails"}})},onViewLinkedJE:u=>{const i=`${H(u,a.tenantEmailDomain)}`,m=N(t.state?.pathnameStackToGoBack,t.pathname);s(i,{state:{pathnameStackToGoBack:m}})},vendorSearchAutoCompleteActions:{onAutoCompleteInputChange:(u,i)=>{u.trim().length>=2?e(Me({searchString:u,entityType:i,searchOrigin:"common"})):u.trim().length===0&&e(pe("common"))},onCancelAutoComplete:()=>{e(pe("common"))}},onDetailPageChange:(u,i)=>{const{scheduleDetailsSection:m,scheduleDetailsListSection:r}=u,{scheduleClass:p,scheduleExpenseCategory:h,months:f,startDate:C,postingDate:y,vendor:E}=m,D=o.entityAutoCompleteView.vendor.length>0?o.entityAutoCompleteView.vendor.find(x=>x.id===E?.selectedOption):void 0,I={id:D?.zeniId??E?.selectedOption??"",name:D?.name??E?.defaultOptions.find(x=>x.value===E?.selectedOption)?.label??"",logo:D?.logo},w=p.selectedOption!=null?a.classList.find(x=>x.classId===p.selectedOption):void 0,k=h.selectedOption!=null?a.accountList.find(x=>x.qboId===h.selectedOption):void 0,b=f?.selectedOption,j=r.map((x,_)=>({...a.scheduleLocalData.jeScheduleDetails[_],amount:{...a.scheduleLocalData.jeScheduleDetails[_].amount,amount:x.amount}})),F=y.type==="day"?y.dayOfMonth?y.dayOfMonth:1:void 0,V=y.type==="lastDayOfMonth"||void 0,L={selectedAccount:k?.accountId,selectedClass:w?.classId,selectedDate:C,selectedMonths:b,jeScheduleDetails:j,lastDayOfMonth:V,selectedVendor:I,selectedDayOfMonth:F};e(yt({scheduleType:a.scheduleTab,localData:L,selectedJeScheduleDetailId:a.scheduleDetailId})),i!==!1||a.scheduleDetailId!=null&&a.status!=="draft"&&a.status!=="marked_as_completed"||k?.accountId==null||a.isAccountingClassesEnabled!==!1&&w?.classId==null||C==null||b==null||V!==!0&&F==null||e(Dt({scheduleType:a.scheduleTab}))}}})(yn),us=()=>{const e=M(),a=q(),s=Y(),t=de(),{tenantEmailDomain:n}=J(),[o,c]=g.useState(!1),d=a.state?.message==="expenseAutomation",{scheduleType:u,scheduleDetailId:i}=J(),m=ps(u,i),r=S(T=>T.scheduleDetailState.selectedJEScheduleKey);g.useEffect(()=>{r!=null&&r.length!==0||i!=="new"||e("../schedules/prepaid_expenses")},[r,i]);const p=Ee(u)??"prepaid_expenses",h=S(T=>he(T,p)),f=S(T=>T.entityAutoCompleteState.autoCompleteText.common),C=S(T=>Ne(T,"common")),y=S(T=>te(T)),E=S(T=>T.classListState.fetchState),D=S(T=>ae(T)),I=S(T=>gt(T).selectedPeriod),w=y!=="Completed"||E!=="Completed";g.useEffect(()=>{o===!1&&w?(s(vt(p,x,!0)),c(!0)):w===!1&&o===!1&&(s(xt(p,i==="new"?void 0:i,!0)),c(!0))},[o]),g.useEffect(()=>{if(h.markAsCompleteStatus.fetchState==="Completed")if(s(Tt()),d===!0){const{month:T,year:A}=I;e(`../../month_end_close_checks/review/je_schedules/${T}-${A}`)}else e("../schedules/prepaid_expenses")},[h.markAsCompleteStatus.fetchState]);const k=S(T=>O(T)),b=S(T=>ee(T,k.companyId)),j=h.fetchState,F=h.allAccountList,V=h.allClassList,L=h.scheduleDetailsLocalData;let x;if(i!=="new"&&(x=i),m!==!0||h.fetchState==="Error")return l.jsx(ie,{});const _=j==="Completed"&&o===!0;return j!=="Completed"?l.jsx(We,{}):l.jsxs(ds,{children:[_===!0?l.jsx(Z,{analytics:P,onLoad:()=>{ms(h,p,b)}}):null,l.jsx(rs,{location:a,vendorSearchEntityAutoCompleteView:C,vendorSearchAutoCompleteData:{autoCompleteText:f,entityAutoCompleteView:C},usedInExpenseAutomation:d,removeJeScheduleTransactionKey:(T,A)=>{s(Ct(T,A))},expenseAutomationSelectedPeriod:I,navigate:e,classList:V,accountList:F,scheduleLocalData:L[p],selectedJEScheduleKey:r,scheduleDetailId:x,selectedScheduledJournalEntries:h.selectedJEScheduleTransaction?.scheduledJournalEntry??[],themeState:t,tenantEmailDomain:n,scheduleTab:p,analytics:P,controllerUserDetails:b,isAccountingClassesEnabled:D,status:h.selectedJEScheduleTransaction?.status.code})]})},ps=(e,a)=>Ee(e)!=null&&a!=null,hs=e=>({transactionDate:e.date.format(Re),transactionAmount:e.amount,scheduleCategory:e.account.accountName,scheduleClass:e.classBase?.className??null,description:e.memo}),ms=(e,a,s)=>{const t=e.selectedJEScheduleTransaction?.baseTransaction,n=e.selectedJEScheduleTransaction,o=be(s.controllers),c=ke(s.controllerUserIds);var d;t!=null&&n!=null&&P.trackScheduleDetailsLoaded({scheduleType:a,transaction:{...hs(t)},scheduleExpenseCategoryAndClass:{expenseCategory:n.jeDebit.account?.accountName??null,expenseClass:n.jeDebit.accountingClass?.className??null},scheduledTransaction:{...(d=n,{currentBalance:d.balanceAsOfToday??null,currentStatus:d.status.label,period:d.period??null,startMonth:d.startDate?.format(Re)??null,endMonth:d.endDate?.format(Re)??null})},vendorName:n.vendor.name??null,controllerEmails:o,controllerUserIds:c})},Ss={drawerLeftMargin:new Xe(0,0,100,200)},fs=G(function(e,a){const{jeScheduledTransaction:s,selectedJERow:t,scheduleType:n,isVendorBulkUpdateOnTransactionEnabled:o}=a,{scheduleDetailsLocalData:c,updateStatus:d}=he(e,a.scheduleType),u=O(e),i=c[n].jeScheduleDetails[t].jeLink,m=i.type==="recommended"?i.recommendedTransactionID:i.transactionDetailID,r=m!=null?na(e,m):void 0,p=R.getSignedInUser(),h=e.tenantState.currentTenantId,f={userId:p?.userId??"",sessionId:p?.zeniSessionId??"",tenantId:u.tenantId??h},C=u?.company?.companyInfo?.firstMonthOfFY??1;return{jeScheduledTransaction:s,transactionDetail:r,localData:c[n].jeScheduleDetails[t],saveStatus:d.fetchState,authParams:f,isVendorBulkUpdateOnTransactionEnabled:o,firstMonthOfFY:C,isDisabled:d.fetchState==="In-Progress"?"readonly":void 0,analytics:P,qboAppUrl:sa(et.qboRedirectionUrl)}},function(e,a){const{selectedJERow:s,jeScheduleDetailId:t,navigate:n}=a;return{onUpdateLocalData:o=>{const c=o.linkJETransaction.qboURL;c!=null&&e(la({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,jeLink:c}))},onFetchTransactionClick:o=>{e(wt(o))},onSaveClick:()=>{e(Ge(a.scheduleType,t))},onBackClick:()=>{n("..",{relative:"path"})},onCancelClick:()=>{const o=a.jeScheduledTransaction.scheduledJournalEntry[s];e(oa({scheduleType:a.scheduleType,jeScheduleDetailId:t,rowId:s,originalScheduledJE:o})),n("..",{relative:"path"})}}})(In),gs=()=>{const e=Dn(),a=M(),s=Y(),{scheduleDetailId:t}=J(),n=re(),o=Ss.drawerLeftMargin.valuePx(n),{scheduleType:c}=J(),{useFeatureGate:d}=ne(),{isFeatureEnabled:u}=d(z.isVendorBulkUpdateOnTransactionEnabled),i=Ee(c)??"prepaid_expenses",[m,r]=g.useState(!1);if(R.getSignedInUser()==null)throw Error("Can't access Account detail page without signing in...");if(t==null)throw Error("Invalid Schedule Detail Id");const p=S(D=>he(D,i));g.useEffect(()=>{p.fetchState==="Not-Started"&&a("..",{relative:"path"})},[]);const h=p.selectedJELinkRowIndex,f=h!=null?p.scheduleDetailsLocalData[i].jeScheduleDetails[h]?.jeLink:null,C=f?.type==="recommended"?f.recommendedTransactionID:f?.transactionDetailID;g.useEffect(()=>{C!=null&&s(wt(C))},[]),g.useEffect(()=>{f?.type==="recommended"&&m===!1&&h!=null&&(r(!0),s(aa({scheduleType:i,jeScheduleDetailId:t,rowId:h})))});const y=S(D=>O(D)),E=S(D=>ee(D,y.companyId));return l.jsx(Un,{anchor:"right",open:!0,PaperProps:{style:{width:`calc(100% - ${o})`,boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:e.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>a("..",{relative:"path"}),children:l.jsx(vs,{onClick:D=>D.stopPropagation(),children:p.fetchState!=="Completed"||p.selectedJEScheduleTransaction==null||h==null?l.jsx(Ut,{fetchState:p.fetchState}):l.jsx(fs,{scheduleType:i,jeScheduleDetailId:t,selectedJERow:h,jeScheduledTransaction:p.selectedJEScheduleTransaction,isCOTEnabled:!1,navigate:a,scheduleTab:i,controllerUserDetails:E,isVendorBulkUpdateOnTransactionEnabled:u})})})},vs=U($t)`
26
26
  display: flex;
27
27
  min-height: 100%;
28
28
  flex-direction: column;
@@ -34,7 +34,7 @@ import{j as l}from"./liveblocks-1thjzoaw.js";import{a as g}from"./sentry-CooVhpi
34
34
  flex-direction: column;
35
35
  align-items: center;
36
36
  background-color: ${e=>e.theme.colors.grey4};
37
- `,Is=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=O(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},d=Q(e),u=ua(e);return{report:d,uiState:u,isAccountingClassesEnabled:ae(e),analytics:P,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:u.downloadState,currentTenantCompanyName:o,statementEndPoint:`${X}/opexByVendor`,authParams:c,timezone:we()}}},function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(Ta(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t.id,t.qboId,a.tenantEmailDomain,n),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses By Vendor"}})}},onReloadReport:()=>{e(xa(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(va(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(ga({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(fa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrSearchStarted:t=>{e(Sa(t))},onPageFetchStarted:()=>{e(ma(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(pa({timeframe:t}))}}})(kn);function Es({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=B(),i=re(),m=R.getSignedInUser(),{useFeatureGate:r}=ne(),{isFeatureEnabled:p,isFeatureGateLoading:h}=r(z.isOpexByVendorFeatureEnabled),f=S(_=>Q(_));if(m==null)throw Error("Can't access opex by vendor page without signing in...");Ce();const[C,y]=g.useState(!1),E=S(_=>te(_)),D=e.includes("prepaid_expenses"),I=e.includes("fixed_assets"),w=e.includes("accrued_expenses"),k=S(_=>me(_)),{isAiCfoAccessEnabled:b,onAskAiCfoClick:j}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});ge({isDataReady:f.fetchState==="Completed"&&f.isReportGenerated===!0});const{areTenantIdsInSync:F}=bn();g.useEffect(()=>{(D||I||w)&&C===!1&&E!=="Completed"&&F&&(c(ye()),y(!0))},[C,F]),g.useEffect(()=>{F&&c(De({shouldFetchAccruedExpenses:w,shouldFetchFixedAssets:I,shouldFetchPrepaidExpenses:D,shouldFetchOpexByVendor:p===!0&&h===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))},[E,I,h,p,F]),f.fetchState!=="Completed"||f.isReportGenerated!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),(f.isReportGenerated===!1&&f.fetchState==="Completed"||p===!1&&h===!1)&&o("../summary");const[V,L]=g.useState(!1),x=_=>{L(_)};return l.jsxs(Ds,{windowSize:i,children:[f.fetchState==="Completed"?l.jsx(Z,{analytics:P,onLoad:_=>{k.previousTab==null?_.trackVendorOperatingExpensesPageLoaded("Side Panel"):_.trackVendorOperatingExpenses(k.currentTab,k.previousTab??null)}}):null,l.jsx(ve,{isAppContentDrawerOpen:V,handleDrawerToggle:x}),l.jsx(Is,{location:d,navigate:o,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:u,vendorTabsToShow:e,isAiCfoAccessEnabled:b,onAskAiCfoClick:j,onClickMenuIcon:()=>{x(!0)}})]})}const le="prepaid_expenses",bs=G(function(e,a){const s=O(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(Qe({scheduleType:le,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:le,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:le,searchText:t}))},onReloadReport:()=>{e(Ae(le))},onScroll:t=>{e(Ye({scheduleType:le,scrollYOffset:t}))},onClickSchedule:t=>{e(Ft({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:le,fetchState:t}))}}})(Nt),ks=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),d=M(),u=Y(),{useFeatureGate:i}=ne(),m=de();Ce();const r=R.getSignedInUser(),{isFeatureEnabled:p,isFeatureGateLoading:h}=i(z.isOpexByVendorFeatureEnabled),f=S(v=>O(v)),C=S(v=>$e(v,"prepaid_expenses")),y={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:f.tenantId},E=g.useMemo(()=>({authParams:y,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:f.companyName}),[]),[D,I]=g.useState(!1),w=S(v=>te(v)),k=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),j=e.includes("accrued_expenses");g.useEffect(()=>{(k||b||j)&&D===!1&&w!=="Completed"&&(u(ye()),I(!0))},[D]),g.useEffect(()=>{o===!1&&C==="Completed"&&u(Ae("prepaid_expenses",{selectedTimeframe:Ke("prepaid_expenses"),selectedCategoryId:"all"},!0))},[o,C]),g.useEffect(()=>{h===!1&&(u(De({shouldFetchAccruedExpenses:j,shouldFetchFixedAssets:b,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:p,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[w,b,h,p]);const F=S(v=>jt(v,le)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:L}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Prepaid Expenses"});ge({isDataReady:F.fetchState==="Completed"});const x=S(v=>Q(v).isReportGenerated);S(v=>Q(v).fetchState)!=="Completed"||x!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),k||d("../opex");const _=S(v=>ee(v,f.companyId)),[T,A]=g.useState(!1),$=v=>{A(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:T,handleDrawerToggle:$}),l.jsx(bs,{navigate:d,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:F,downloadParams:E,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:_,isAiCfoAccessEnabled:V,onAskAiCfoClick:L,onClickMenuIcon:()=>{$(!0)}})]})},ws=U.div`
37
+ `,Is=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=O(e),o=n?.companyName??"",c={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},d=Q(e),u=ua(e);return{report:d,uiState:u,isAccountingClassesEnabled:ae(e),analytics:P,vendorTabsToShow:a.vendorTabsToShow,downloadParams:{downloadState:u.downloadState,currentTenantCompanyName:o,statementEndPoint:`${X}/opexByVendor`,authParams:c,timezone:we()}}},function(e,a){const{navigate:s}=a;return{onFetchOpExByVendors:(t,n,o)=>{e(Ta(t,n,o))},onVendorNameAndBalanceClicked:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t.id,t.qboId,a.tenantEmailDomain,n),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Operating Expenses By Vendor"}})}},onReloadReport:()=>{e(xa(!0))},onBackClick:()=>{s("../../dashboard")},onTimeframeSelectionChanged:t=>{e(va(t))},onAdditionalBalanceSelectionChanged:(t,n)=>{e(ga({isCompareModeOn:t,additionalBalances:n}))},onSortOrderChanged:(t,n,o)=>{e(fa({sortkey:n,sortOrder:t,timeframe:o}))},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrSearchStarted:t=>{e(Sa(t))},onPageFetchStarted:()=>{e(ma(!0))},updateDownloadStateHandler:t=>{e(ha(t))},onClearSearch:t=>{e(pa({timeframe:t}))}}})(kn);function Es({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),{useFeatureGate:r}=ne(),{isFeatureEnabled:p,isFeatureGateLoading:h}=r(z.isOpexByVendorFeatureEnabled),f=S(_=>Q(_));if(m==null)throw Error("Can't access opex by vendor page without signing in...");Ce();const[C,y]=g.useState(!1),E=S(_=>te(_)),D=e.includes("prepaid_expenses"),I=e.includes("fixed_assets"),w=e.includes("accrued_expenses"),k=S(_=>me(_)),{isAiCfoAccessEnabled:b,onAskAiCfoClick:j}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Operating Expenses by Vendor"});ge({isDataReady:f.fetchState==="Completed"&&f.isReportGenerated===!0});const{areTenantIdsInSync:F}=bn();g.useEffect(()=>{(D||I||w)&&C===!1&&E!=="Completed"&&F&&(c(ye()),y(!0))},[C,F]),g.useEffect(()=>{F&&c(De({shouldFetchAccruedExpenses:w,shouldFetchFixedAssets:I,shouldFetchPrepaidExpenses:D,shouldFetchOpexByVendor:p===!0&&h===!1,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1}))},[E,I,h,p,F]),f.fetchState!=="Completed"||f.isReportGenerated!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),(f.isReportGenerated===!1&&f.fetchState==="Completed"||p===!1&&h===!1)&&o("../summary");const[V,L]=g.useState(!1),x=_=>{L(_)};return l.jsxs(Ds,{windowSize:i,children:[f.fetchState==="Completed"?l.jsx(Z,{analytics:P,onLoad:_=>{k.previousTab==null?_.trackVendorOperatingExpensesPageLoaded("Side Panel"):_.trackVendorOperatingExpenses(k.currentTab,k.previousTab??null)}}):null,l.jsx(ve,{isAppContentDrawerOpen:V,handleDrawerToggle:x}),l.jsx(Is,{location:d,navigate:o,previousTabPosition:a,setPreviousTabPosition:s,tenantEmailDomain:u,vendorTabsToShow:e,isAiCfoAccessEnabled:b,onAskAiCfoClick:j,onClickMenuIcon:()=>{x(!0)}})]})}const le="prepaid_expenses",bs=G(function(e,a){const s=O(e),t=me(e);return{tenantName:s.companyName,vendorTabsToShow:a.vendorTabsToShow,report:a.scheduleListReport,downloadParams:a.downloadParams,companyIncorporationDate:a.companyIncDate,controllerUserDetails:a.controllerUserDetails,vendorTabView:t,isAccountingClassesEnabled:ae(e)}},function(e,a){const{navigate:s}=a;return{onBackClick:()=>{s("../../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))},onSortOrderChanged:(t,n)=>{e(Qe({scheduleType:le,sortKey:t,sortOrder:n}))},onChangeSubTab:t=>{e(He({scheduleType:le,subTab:t}))},onSearchTextChanged:t=>{e(qe({scheduleType:le,searchText:t}))},onReloadReport:()=>{e(Ae(le))},onScroll:t=>{e(Ye({scheduleType:le,scrollYOffset:t}))},onClickSchedule:t=>{e(Ft({selectedJEScheduleKey:t}));const n=a.scheduleListReport.jeScheduledTransactions.find(o=>o.jeScheduleTransactionKey===t);s(n?.jeScheduleId==null?"details/new":`details/${n.jeScheduleId}`)},updateDownloadStateHandler:t=>{e(ze({scheduleType:le,fetchState:t}))}}})(Nt),ks=({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s})=>{const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),[o,c]=g.useState(!1),d=M(),u=Y(),{useFeatureGate:i}=ne(),m=de();Ce();const r=R.getSignedInUser(),{isFeatureEnabled:p,isFeatureGateLoading:h}=i(z.isOpexByVendorFeatureEnabled),f=S(v=>O(v)),C=S(v=>$e(v,"prepaid_expenses")),y={userId:r?.userId??"",sessionId:r?.zeniSessionId??"",tenantId:f.tenantId},E=g.useMemo(()=>({authParams:y,jeScheduleEndPoint:`${X}/jeScheduleReports`,timezone:we(),companyName:f.companyName}),[]),[D,I]=g.useState(!1),w=S(v=>te(v)),k=e.includes("prepaid_expenses"),b=e.includes("fixed_assets"),j=e.includes("accrued_expenses");g.useEffect(()=>{(k||b||j)&&D===!1&&w!=="Completed"&&(u(ye()),I(!0))},[D]),g.useEffect(()=>{o===!1&&C==="Completed"&&u(Ae("prepaid_expenses",{selectedTimeframe:Ke("prepaid_expenses"),selectedCategoryId:"all"},!0))},[o,C]),g.useEffect(()=>{h===!1&&(u(De({shouldFetchAccruedExpenses:j,shouldFetchFixedAssets:b,shouldFetchPrepaidExpenses:!0,shouldFetchOpexByVendor:p,shouldFetchVendorsList:!1,shouldFetchFiling1099Vendor:!1})),c(!0))},[w,b,h,p]);const F=S(v=>jt(v,le)),{isAiCfoAccessEnabled:V,onAskAiCfoClick:L}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — Prepaid Expenses"});ge({isDataReady:F.fetchState==="Completed"});const x=S(v=>Q(v).isReportGenerated);S(v=>Q(v).fetchState)!=="Completed"||x!==!0||p!==!0||e.includes("operating_expenses_by_vendor")||e.splice(1,0,"operating_expenses_by_vendor"),k||d("../opex");const _=S(v=>ee(v,f.companyId)),[T,A]=g.useState(!1),$=v=>{A(v)};return l.jsxs(l.Fragment,{children:[l.jsx(ve,{isAppContentDrawerOpen:T,handleDrawerToggle:$}),l.jsx(bs,{navigate:d,previousTabPosition:a,setPreviousTabPosition:s,scheduleListReport:F,downloadParams:E,themeState:m,vendorTabsToShow:e,analytics:P,controllerUserDetails:_,isAiCfoAccessEnabled:V,onAskAiCfoClick:L,onClickMenuIcon:()=>{$(!0)}})]})},ws=U.div`
38
38
  display: flex;
39
39
  min-height: 100%;
40
40
  width: 100%;
@@ -42,7 +42,7 @@ import{j as l}from"./liveblocks-1thjzoaw.js";import{a as g}from"./sentry-CooVhpi
42
42
  flex-direction: column;
43
43
  align-items: center;
44
44
  background-color: ${e=>e.theme.colors.grey4};
45
- `,As=G(function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:c,currentUserRoleMap:d}=a,u=R.getSignedInUser(),i={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:c.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:wa(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:d?.bookkeeping_user===!0,filesEndPoint:Mt.fileMicroServiceBaseUrl,authParams:i,scrollToTrend:a.isTrendPeriodSelected}},function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:o,vendorEntity:c,tenantEmailDomain:d,location:u,firstMonthOfFY:i}=a,m=()=>{const r=Ze(u.state?.pathnameStackToGoBack),p=r.poppedPathname??((h=2)=>{let f=h;a.isTrendPeriodSelected===!0&&(f=5);let C="../";for(let y=0;y<f;y++)C=`${C}../`;return C})(1);s(p,{state:{pathnameStackToGoBack:r.newStack}})};return{onSaveVendor:()=>{t!=null&&((r,p)=>{const{vendorId:h,vendorName:f,existingCategory:C,existingClass:y,existingOwner:E,selectedCategory:D,selectedClass:I,selectedOwner:w,isRecommendedCategorySelected:k,isRecommendedClassSelected:b,categoryRecommendationTypeSelected:j,classRecommendationTypeSelected:F}=Oa(r,p);h!=null&&P.trackVendorDetailsSave(h,f??"",C,y,E,D,I,w,k,b,j,F)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(La(n,void 0))},onVendorSpendTrendFilterTabClick:r=>{e(Va(r))},saveVendorDetailLocalData:r=>{n!=null&&e(_a({vendorId:n,localData:r}))},saveContactsInVendorTabDetailLocalData:(r,p)=>{e(Pa({vendorId:r,localData:{contacts:p}}))},onCancelClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&P.trackVendorDetailsCancel(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email),e(lt()),e(it()),e(ct()),e(dt()),m()},handleSpendTrendPercentChangeClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView?.vendorBasic,r.id!=null&&P.trackVendorDetailsSpendTrendHotlinkClicked(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email))},onSaveSuccess:()=>{n!=null&&e(Fa("Not-Started",n)),e(lt()),e(it()),e(ct()),e(dt()),m()},onTrendSelectedPeriodChange:r=>{if(r==null)o!=null&&e(Fe(c,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const p=r.currentTimePeriod==null?r.addTimePeriod:{startDate:r.addTimePeriod.startDate,endDate:r.currentTimePeriod.endDate};e(_e(c,"EntityDetail",{timeframe:r.timeframe,timePeriod:r.addTimePeriod},i)),e(Fe(c,"EntityDetail",{timeframe:r.timeframe,timePeriod:p}))}},onVendorTabSelectionChanged:r=>{e(ja(r))},onAddressClick:(r,p)=>{if(d==null)return;const h=$n(d,r,p),f=N(u.state?.pathnameStackToGoBack,u.pathname);s(h,{state:{pathnameStackToGoBack:f}})},onVendorDetailUIChange:r=>{e(Aa({collapsableStatus:r}))},onTransactionItemClick:r=>{const p=`${H(r,d)}`,h=N(u.state?.pathnameStackToGoBack,u.pathname);s(p,{state:{pathnameStackToGoBack:h}})},onLoadPreviousTransactionsClick:(r,p)=>{e(Pt({timePeriod:Pe(r),numberOfQuartersFetched:p})),e(_t(c,Pe(r),!0,!0))}}})(An);function pt({referrerType:e,isFiling1099FeatureEnabled:a}){const s=Y(),t=q(),n=M(),o=wn(),[c,d]=g.useState(!1),[u,i]=g.useState(!1),[m,r]=g.useState(!1),p=B(),h=p.vendorId,f=p.qboId,{tenantEmailDomain:C,timeframe:y,startDate:E,endDate:D}=p,I={id:f??"",name:"",type:"vendor",zeniId:h??"",qboId:f??""};g.useEffect(()=>{y!=null&&E!=null&&D!=null?d(!0):(d(!1),m===!1&&(r(!0),s(Fe(I,"EntityDetail"))))},[y,E,D]);const w=re(),k=S(v=>O(v)),b=S(v=>h!=null?Ca(v,h,I):void 0),j=S(v=>v.vendorState.vendorByID[h??""]),F=S(v=>O(v).company?.companyInfo.firstMonthOfFY??1),V=S(()=>ya(F,2)),L=Pe({startDate:V.startDate,endDate:Da()}),x=Ia(F),_=S(v=>Ea(v.trendWithTransactionsState,I,"EntityDetail")),[T,A]=g.useState(!1),$=c===!1&&m===!1?void 0:_?.selectedPeriod?.timePeriod??x;return g.useEffect(()=>(e==null&&b?.fetchState!=="Not-Started"||h==null||s(ba(h,I)),()=>{e!=null&&h!=null&&s(ka(h))}),[h,t.state,s]),g.useEffect(()=>{b?.fetchState==="Completed"&&b?.vendorViewDetails.vendorView?.vendorBasic!=null&&((v,ue,je)=>{v.id!=null&&P.trackVendorDetails(v.id,v.name,je,v.account?.accountName,v.class?.className,v.owner?.email,ue.percentChange,ue.last30DaysSpend,ue.last90DaysSpend,ue.yearToDateSpend)})(b?.vendorViewDetails.vendorView?.vendorBasic,b?.vendorSpend,e),A(!1)},[b?.fetchState]),g.useEffect(()=>{if(b?.fetchState==="Completed"&&T===!1){$!=null&&c===!1&&(s(_e(I,"EntityDetail",{timeframe:_?.selectedPeriod?.timeframe??"quarter",timePeriod:$},F)),A(!0));const v=Ie.getLocalizedStrings().dateFormat.analytics;if(c===!0&&y!=null&&E!=null&&D!=null){A(!0);const ue=y,je={startDate:ot(E,v.YYYYDashMMDashDDFormat),endDate:ot(D,v.YYYYDashMMDashDDFormat)};s(_e(I,"EntityDetail",{timeframe:ue,timePeriod:je}))}}},[b?.fetchState,$,_?.selectedPeriod?.timeframe,c,F]),g.useEffect(()=>{b?.fetchState==="Completed"&&u===!1&&(s(Pt({timePeriod:L,numberOfQuartersFetched:3})),s(_t(I,b.allTransactionsTabData?.timePeriod??L,!1,!0)),i(!0))},[b?.fetchState,u]),h==null?l.jsx(ie,{}):l.jsx(ws,{windowSize:w,children:l.jsx(As,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:b,vendorId:h,currentTenant:k,selectedVendor:j,firstMonthOfFY:F,isTrendPeriodSelected:c,selectedPeriodTimePeriod:_?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:x,vendorEntity:I,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:C})})}const js=Ie.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,Fs={containerWidth:new Xe(100,58)},Ps=U(Fn)`
45
+ `,As=G(function(e,a){const{isFiling1099FeatureEnabled:s,vendorDetailView:t,selectedVendor:n,firstMonthOfFY:o,currentTenant:c,currentUserRoleMap:d}=a,u=R.getSignedInUser(),i={userId:u?.userId??"",sessionId:u?.zeniSessionId??"",tenantId:c.tenantId??""};return{firstMonthOfFY:o,isFiling1099FeatureEnabled:s,vendorDetailView:t,allTransactions:t?.allVendorTransactionsView,allTransactionsTabData:t?.allTransactionsTabData!=null?{timePeriod:wa(t?.allTransactionsTabData.timePeriod),numberOfQuartersFetched:t?.allTransactionsTabData.numberOfQuartersFetched}:void 0,vendorLogo:n?.logo,readOnlyMode:d?.bookkeeping_user===!0,filesEndPoint:Mt.fileMicroServiceBaseUrl,authParams:i,scrollToTrend:a.isTrendPeriodSelected}},function(e,a){const{navigate:s,vendorDetailView:t,vendorId:n,defaultTransactionTimePeriod:o,vendorEntity:c,tenantEmailDomain:d,location:u,firstMonthOfFY:i}=a,m=()=>{const r=Ze(u.state?.pathnameStackToGoBack),p=r.poppedPathname??((h=2)=>{let f=h;a.isTrendPeriodSelected===!0&&(f=5);let C="../";for(let y=0;y<f;y++)C=`${C}../`;return C})(1);s(p,{state:{pathnameStackToGoBack:r.newStack}})};return{onSaveVendor:()=>{t!=null&&((r,p)=>{const{vendorId:h,vendorName:f,existingCategory:C,existingClass:y,existingOwner:E,selectedCategory:D,selectedClass:I,selectedOwner:w,isRecommendedCategorySelected:k,isRecommendedClassSelected:b,categoryRecommendationTypeSelected:j,classRecommendationTypeSelected:F}=Oa(r,p);h!=null&&P.trackVendorDetailsSave(h,f??"",C,y,E,D,I,w,k,b,j,F)})(t?.vendorViewDetails,t?.vendorViewDetails.ownerList),n!=null&&e(La(n,void 0))},onVendorSpendTrendFilterTabClick:r=>{e(Va(r))},saveVendorDetailLocalData:r=>{n!=null&&e(_a({vendorId:n,localData:r}))},saveContactsInVendorTabDetailLocalData:(r,p)=>{e(Pa({vendorId:r,localData:{contacts:p}}))},onCancelClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView.vendorBasic).id!=null&&P.trackVendorDetailsCancel(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email),e(lt()),e(it()),e(ct()),e(dt()),m()},handleSpendTrendPercentChangeClick:()=>{var r;t?.vendorViewDetails.vendorView?.vendorBasic!=null&&(r=t.vendorViewDetails.vendorView?.vendorBasic,r.id!=null&&P.trackVendorDetailsSpendTrendHotlinkClicked(r.id??"",r.name,r.account?.accountName,r.class?.className,r.owner?.email))},onSaveSuccess:()=>{n!=null&&e(Fa("Not-Started",n)),e(lt()),e(it()),e(ct()),e(dt()),m()},onTrendSelectedPeriodChange:r=>{if(r==null)o!=null&&e(Fe(c,"EntityDetail",{timeframe:"quarter",timePeriod:o}));else{const p=r.currentTimePeriod==null?r.addTimePeriod:{startDate:r.addTimePeriod.startDate,endDate:r.currentTimePeriod.endDate};e(_e(c,"EntityDetail",{timeframe:r.timeframe,timePeriod:r.addTimePeriod},i)),e(Fe(c,"EntityDetail",{timeframe:r.timeframe,timePeriod:p}))}},onVendorTabSelectionChanged:r=>{e(ja(r))},onAddressClick:(r,p)=>{if(d==null)return;const h=$n(d,r,p),f=N(u.state?.pathnameStackToGoBack,u.pathname);s(h,{state:{pathnameStackToGoBack:f}})},onVendorDetailUIChange:r=>{e(Aa({collapsableStatus:r}))},onTransactionItemClick:r=>{const p=`${H(r,d)}`,h=N(u.state?.pathnameStackToGoBack,u.pathname);s(p,{state:{pathnameStackToGoBack:h}})},onLoadPreviousTransactionsClick:(r,p)=>{e(Pt({timePeriod:Pe(r),numberOfQuartersFetched:p})),e(_t(c,Pe(r),!0,!0))}}})(An);function pt({referrerType:e,isFiling1099FeatureEnabled:a}){const s=Y(),t=q(),n=M(),o=wn(),[c,d]=g.useState(!1),[u,i]=g.useState(!1),[m,r]=g.useState(!1),p=J(),h=p.vendorId,f=p.qboId,{tenantEmailDomain:C,timeframe:y,startDate:E,endDate:D}=p,I={id:f??"",name:"",type:"vendor",zeniId:h??"",qboId:f??""};g.useEffect(()=>{y!=null&&E!=null&&D!=null?d(!0):(d(!1),m===!1&&(r(!0),s(Fe(I,"EntityDetail"))))},[y,E,D]);const w=re(),k=S(v=>O(v)),b=S(v=>h!=null?Ca(v,h,I):void 0),j=S(v=>v.vendorState.vendorByID[h??""]),F=S(v=>O(v).company?.companyInfo.firstMonthOfFY??1),V=S(()=>ya(F,2)),L=Pe({startDate:V.startDate,endDate:Da()}),x=Ia(F),_=S(v=>Ea(v.trendWithTransactionsState,I,"EntityDetail")),[T,A]=g.useState(!1),$=c===!1&&m===!1?void 0:_?.selectedPeriod?.timePeriod??x;return g.useEffect(()=>(e==null&&b?.fetchState!=="Not-Started"||h==null||s(ba(h,I)),()=>{e!=null&&h!=null&&s(ka(h))}),[h,t.state,s]),g.useEffect(()=>{b?.fetchState==="Completed"&&b?.vendorViewDetails.vendorView?.vendorBasic!=null&&((v,ue,je)=>{v.id!=null&&P.trackVendorDetails(v.id,v.name,je,v.account?.accountName,v.class?.className,v.owner?.email,ue.percentChange,ue.last30DaysSpend,ue.last90DaysSpend,ue.yearToDateSpend)})(b?.vendorViewDetails.vendorView?.vendorBasic,b?.vendorSpend,e),A(!1)},[b?.fetchState]),g.useEffect(()=>{if(b?.fetchState==="Completed"&&T===!1){$!=null&&c===!1&&(s(_e(I,"EntityDetail",{timeframe:_?.selectedPeriod?.timeframe??"quarter",timePeriod:$},F)),A(!0));const v=Ie.getLocalizedStrings().dateFormat.analytics;if(c===!0&&y!=null&&E!=null&&D!=null){A(!0);const ue=y,je={startDate:ot(E,v.YYYYDashMMDashDDFormat),endDate:ot(D,v.YYYYDashMMDashDDFormat)};s(_e(I,"EntityDetail",{timeframe:ue,timePeriod:je}))}}},[b?.fetchState,$,_?.selectedPeriod?.timeframe,c,F]),g.useEffect(()=>{b?.fetchState==="Completed"&&u===!1&&(s(Pt({timePeriod:L,numberOfQuartersFetched:3})),s(_t(I,b.allTransactionsTabData?.timePeriod??L,!1,!0)),i(!0))},[b?.fetchState,u]),h==null?l.jsx(ie,{}):l.jsx(ws,{windowSize:w,children:l.jsx(As,{location:t,navigate:n,isFiling1099FeatureEnabled:a,vendorDetailView:b,vendorId:h,currentTenant:k,selectedVendor:j,firstMonthOfFY:F,isTrendPeriodSelected:c,selectedPeriodTimePeriod:_?.selectedPeriod?.timePeriod,defaultTransactionTimePeriod:x,vendorEntity:I,currentUserRoleMap:o?.loggedInUserRoleMap,tenantEmailDomain:C})})}const js=Ie.getLocalizedStrings().spendManagement.billPay.vendorCreation.vendorDetails,Fs={containerWidth:new Xe(100,58)},Ps=U(Fn)`
46
46
  width: ${W.sp4};
47
47
  height: ${W.sp4};
48
48
  cursor: pointer;
@@ -59,17 +59,17 @@ import{j as l}from"./liveblocks-1thjzoaw.js";import{a as g}from"./sentry-CooVhpi
59
59
  flex-direction: column;
60
60
  width: ${e=>`${Fs.containerWidth.value(e.windowSize)}%`};
61
61
  ${e=>e.windowSize!=="small"?"overflow: auto;":""}
62
- `,Ls=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},o=e.vendorFiling1099UploadDetailsState,c=e.vendorFiling1099UploadDetailsState;let d={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(d=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${Mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:o,vendorFiling1099UploadDetailsViewState:c,uploadStaus:c.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:P,entityId:a.billId,fetchVendorFetchStatus:d,vendorLegalName:a.vendorLegalName}},function(e,a){const s=a.vendorId;return{onInvoiceUpload:t=>{if(function(n){return n!=null&&"w9_form"in n}(t)&&(e(Ua({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Na({ocrData:t.w9_form[0],vendorId:s}));const n=(o=>({street:[o.street.join(" ")],city:o.city,state:o.state,postalCode:o.postal_code,countryCode:o.country_code??void 0,country:o.country??""}))(t.w9_form[0].address);e(Bt({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(Ve({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Ra(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Jt(t))},onDeleteClick:()=>{e(Ve({fetchState:"Not-Started",error:void 0})),e(Ot({vendorId:s,w9Documents:[]}))}}})(_n);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=Y(),t=M(),{vendorId:n}=B(),o=re(),c=de(),d=R.getSignedInUser(),[u,i]=g.useState(!1),{useFeatureGate:m}=ne(),{isFeatureEnabled:r}=m(z.isVendorRecommendationFeatureEnabled),p=S(x=>O(x)).companyName,h=new AbortController,f=h.signal;let C,y,E,D,I;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");C=S(x=>Vt(x,n)),y=S(x=>x.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus),E=S(x=>x.vendorViewState.editVendorStateById[n]?.fetchStatus),I=S(x=>x.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0]),D=S(x=>x.vendorFiling1099UploadDetailsState);const w=E?.fetchState==="In-Progress"||D?.w9FormUploadStatus?.fetchState==="In-Progress",k=()=>{c.toggle()};g.useEffect(()=>()=>{h.abort(),s(Lt(n))},[]),g.useEffect(()=>{u||n!=null&&(i(!0),s(Ja(!1,n,f)))},[n]);const b=Je(E?.fetchState),j=Je(y?.fetchState),F=C.vendor?.contactIds,V=F?.[F.length-1],L=S(x=>x.contactState.contactById[V]);if(g.useEffect(()=>{n!=null&&b==="In-Progress"&&E?.fetchState==="Completed"&&C?.vendor!=null&&(s(Ba(n,C.vendor,L)),C?.vendor.filing1099W9Files?.[0]!=null&&s(Ve({fetchState:"Completed",error:void 0})))},[n,C?.vendor]),g.useEffect(()=>{j==="In-Progress"&&y?.fetchState==="Completed"&&t("../../vendors/filing_1099")},[y?.fetchState]),a===!0&&E?.fetchState!=="Completed"&&E?.fetchState!=="Error")return l.jsx(Us,{children:l.jsx(jn,{})});if(d==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs(_s,{windowSize:o,children:[o!=="small"?l.jsxs(Js,{children:[l.jsx(Ps,{onClick:k}),l.jsxs(Os,{showContent:d.userEmailDomain==="zeni.ai",children:[l.jsx(Bs,{showAutofill:!1}),l.jsx(Rs,{showAutofill:!1,children:p})]})]}):null,l.jsx(Ls,{vendorId:n,file:I,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:r,pdfTitle:I?js.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:C?.vendor?.legalName,isLoading:w}),l.jsx(Vs,{windowSize:o,children:e})]})}const Os=U.div`
62
+ `,Ls=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""},o=e.vendorFiling1099UploadDetailsState,c=e.vendorFiling1099UploadDetailsState;let d={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(d=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{uploadInvoiceEndPoint:`${Mt.documentAIMicroServiceBaseUrl}`,vendorFiling1099UploadDetailsState:o,vendorFiling1099UploadDetailsViewState:c,uploadStaus:c.w9FormUploadStatus,authParams:n,billId:a.billId,vendorId:a.vendorId,file:a.file,showAutofill:a.showAutofill,type:a.type,analytics:P,entityId:a.billId,fetchVendorFetchStatus:d,vendorLegalName:a.vendorLegalName}},function(e,a){const s=a.vendorId;return{onInvoiceUpload:t=>{if(function(n){return n!=null&&"w9_form"in n}(t)&&(e(Ua({w9FormFile:t.files[0]})),t.w9_form[0]!=null)){e(Na({ocrData:t.w9_form[0],vendorId:s}));const n=(o=>({street:[o.street.join(" ")],city:o.city,state:o.state,postalCode:o.postal_code,countryCode:o.country_code??void 0,country:o.country??""}))(t.w9_form[0].address);e(Jt({addressType:"vendor_address",addressToCreate:n}))}},updateInvoiceUploadFetchState:t=>{e(Ve({fetchState:t,error:void 0}))},onSkipAutofill:t=>{e(Ra(t))},onVendorFiling1099UploadDetailsSave:t=>{e(Bt(t))},onDeleteClick:()=>{e(Ve({fetchState:"Not-Started",error:void 0})),e(Ot({vendorId:s,w9Documents:[]}))}}})(_n);function ht({appContent:e,showFullScreenSkeletonWhileLoading:a}){const s=Y(),t=M(),{vendorId:n}=J(),o=re(),c=de(),d=R.getSignedInUser(),[u,i]=g.useState(!1),{useFeatureGate:m}=ne(),{isFeatureEnabled:r}=m(z.isVendorRecommendationFeatureEnabled),p=S(x=>O(x)).companyName,h=new AbortController,f=h.signal;let C,y,E,D,I;if(n==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");C=S(x=>Vt(x,n)),y=S(x=>x.vendorFiling1099UploadDetailsState.vendor1099DetailsSaveStatus),E=S(x=>x.vendorViewState.editVendorStateById[n]?.fetchStatus),I=S(x=>x.vendorFiling1099UploadDetailsState.vendor1099DetailsLocalData.w9Documents?.[0]),D=S(x=>x.vendorFiling1099UploadDetailsState);const w=E?.fetchState==="In-Progress"||D?.w9FormUploadStatus?.fetchState==="In-Progress",k=()=>{c.toggle()};g.useEffect(()=>()=>{h.abort(),s(Lt(n))},[]),g.useEffect(()=>{u||n!=null&&(i(!0),s(Ba(!1,n,f)))},[n]);const b=Be(E?.fetchState),j=Be(y?.fetchState),F=C.vendor?.contactIds,V=F?.[F.length-1],L=S(x=>x.contactState.contactById[V]);if(g.useEffect(()=>{n!=null&&b==="In-Progress"&&E?.fetchState==="Completed"&&C?.vendor!=null&&(s(Ja(n,C.vendor,L)),C?.vendor.filing1099W9Files?.[0]!=null&&s(Ve({fetchState:"Completed",error:void 0})))},[n,C?.vendor]),g.useEffect(()=>{j==="In-Progress"&&y?.fetchState==="Completed"&&t("../../vendors/filing_1099")},[y?.fetchState]),a===!0&&E?.fetchState!=="Completed"&&E?.fetchState!=="Error")return l.jsx(Us,{children:l.jsx(jn,{})});if(d==null)throw Error("Can't access VendorFiling1099UploadScreen without signing in...");return l.jsxs(_s,{windowSize:o,children:[o!=="small"?l.jsxs(Bs,{children:[l.jsx(Ps,{onClick:k}),l.jsxs(Os,{showContent:d.userEmailDomain==="zeni.ai",children:[l.jsx(Js,{showAutofill:!1}),l.jsx(Rs,{showAutofill:!1,children:p})]})]}):null,l.jsx(Ls,{vendorId:n,file:I,showAutofill:!1,type:"w9",isVendorRecommendationEnabled:r,pdfTitle:I?js.w9FormTitle:void 0,showTitlebar:!0,showTitlebarIcon:!0,vendorLegalName:C?.vendor?.legalName,isLoading:w}),l.jsx(Vs,{windowSize:o,children:e})]})}const Os=U.div`
63
63
  display: ${e=>e.showContent?"flex":"none"};
64
64
  align-items: center;
65
- `,Js=U.div`
65
+ `,Bs=U.div`
66
66
  margin-bottom: ${W.sp3};
67
67
  margin-top: ${W.sp3};
68
68
  margin-left: ${W.sp8};
69
69
  position: absolute;
70
70
  display: flex;
71
71
  align-items: center;
72
- `,Bs=U.div`
72
+ `,Js=U.div`
73
73
  width: 1px;
74
74
  height: ${W.sp3};
75
75
  margin: ${W.sp0} ${W.sp3};
@@ -89,11 +89,11 @@ import{j as l}from"./liveblocks-1thjzoaw.js";import{a as g}from"./sentry-CooVhpi
89
89
  flex-direction: column;
90
90
  align-items: center;
91
91
  background-color: ${e=>e.theme.colors.grey4};
92
- `,$s=G(function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),o=e.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},d=O(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:P,authParams:c,attachmentEndpoint:d.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${X}/vendor_attachments_accounting_provider`:`${X}/vendor_attachments`}},function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(Le(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Xa({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(ut())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const d=Ks(n);e(Za({vendorId:t,currentSelection:d,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Wa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Qa({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(Ha({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(qa({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(Ya(t,n,o))},onClickCancelPopup:()=>{e(za())},onClearGlobalMerchantAutoCompleteResults:()=>{e(ut())},onClickRedirectToQBO:()=>{window.open(`${et.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Le(null))}}})(Ln);function mt(){const e=M(),a=Y(),s=q(),{tenantEmailDomain:t}=B(),n=re(),o=R.getSignedInUser(),{vendorId:c}=B(),d=S(p=>rt(p)),[u,i]=g.useState(!1),m=S(p=>rt(p).fetchState);if(g.useEffect(()=>{m==="Not-Started"&&u===!1&&(a(Le(null)),i(!0))},[]),o==null)throw Error("Can't access first review page without signing in...");const r=p=>p.trackPageLoaded(tt.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[m==="Completed"?l.jsx(Z,{analytics:P,onLoad:r}):null,l.jsx(Z,{analytics:P,onLoad:r}),l.jsx(Kn,{isOpen:c!=null,drawerLeftMargin:new Xe(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(zs,{onClick:p=>p.stopPropagation(),children:l.jsx(Ms,{})})}),l.jsx(Gs,{windowSize:n,children:l.jsx($s,{location:s,navigate:e,vendorFirstReviewDetails:d,tenantEmailDomain:t})})]})}const Ks=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,zs=U($t)`
92
+ `,$s=G(function(e,a){const{vendorFirstReviewDetails:s}=a,t=e.globalMerchantAutoCompleteState.autoCompleteText,n=R.getSignedInUser(),o=e.tenantState.currentTenantId,c={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""},d=O(e);return{vendorFirstReviewView:s,globalMerchantAutoCompleteData:{globalMerchantAutoCompleteView:s.globalMerchantAutoCompleteView,autoCompleteText:t},analytics:P,authParams:c,attachmentEndpoint:d.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${X}/vendor_attachments_accounting_provider`:`${X}/vendor_attachments`}},function(e,a){const{navigate:s}=a;return{onFetchVendorReviewView:(t,n,o)=>{e(Le(t,n,o))},onGlobalMerchantAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?e(Xa({searchString:t,globalMerchantType:n??"vendor"})):t.trim().length===0&&e(ut())},onUpdateLocalData:(t,n,o,c)=>{if(n!=null){const d=Ks(n);e(Za({vendorId:t,currentSelection:d,selectedGlobalMerchantId:o,vendorRenamedText:c}))}},onResetVendorLocalData:t=>{e(Wa({vendorId:t}))},onVendorNameClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onUpdatePageToken:t=>{e(Qa({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(Ha({sortOrder:t,sortKey:n}))},onUpdateScrollYOffset:t=>{e(qa({scrollYOffset:t}))},onClickSave:(t,n,o)=>{e(Ya(t,n,o))},onClickCancelPopup:()=>{e(za())},onClearGlobalMerchantAutoCompleteResults:()=>{e(ut())},onClickRedirectToQBO:()=>{window.open(`${et.qboRedirectionUrl}/vendors`,"_blank")},updateVendorDetailLocalData:t=>{e(Rt({vendorDetails:t})),s(`./vendor/${t.id}`)},onBackClick:()=>{s("../..")},onReloadList:()=>{e(Le(null))}}})(Ln);function mt(){const e=M(),a=Y(),s=q(),{tenantEmailDomain:t}=J(),n=re(),o=R.getSignedInUser(),{vendorId:c}=J(),d=S(p=>rt(p)),[u,i]=g.useState(!1),m=S(p=>rt(p).fetchState);if(g.useEffect(()=>{m==="Not-Started"&&u===!1&&(a(Le(null)),i(!0))},[]),o==null)throw Error("Can't access first review page without signing in...");const r=p=>p.trackPageLoaded(tt.Event.vendorTenantReviewListPage);return l.jsxs(l.Fragment,{children:[m==="Completed"?l.jsx(Z,{analytics:P,onLoad:r}):null,l.jsx(Z,{analytics:P,onLoad:r}),l.jsx(Kn,{isOpen:c!=null,drawerLeftMargin:new Xe(0,0,300,600),onClose:()=>{e("../review")},children:l.jsx(zs,{onClick:p=>p.stopPropagation(),children:l.jsx(Ms,{})})}),l.jsx(Gs,{windowSize:n,children:l.jsx($s,{location:s,navigate:e,vendorFirstReviewDetails:d,tenantEmailDomain:t})})]})}const Ks=e=>e.recommendedFirst===!0?"recommendedFirst":e.recommendedSecond===!0?"recommendedSecond":e.retain===!0?"retain":e.rename===!0?"rename":e.customMerchant===!0?"customMerchant":null,zs=U($t)`
93
93
  display: flex;
94
94
  min-height: 100%;
95
95
  flex-direction: column;
96
- `,Ys=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,o={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let c={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(c=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:P,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:et.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:c,vendor:a.vendorFiling1099UploadDetails?.vendor}},function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:o,vendorFiling1099UploadDetails:c}=a,{tenantEmailDomain:d}=s;return{onVendorFiling1099UploadDetailsSave:u=>{e(Jt(u)),P.trackVendor1099DetailSave(c.vendor.legalName??"")},onSaveChangesToLocalStore:u=>{e(Ot(u))},onResetVendorFiling1099FormStatus:()=>{e(en())},onAddressEditHandler:u=>{const i=Nn((m=>({street:m.vendor1099FilingSectionId.street,suite:m.vendor1099FilingSectionId.suite,city:m.vendor1099FilingSectionId.city,state:m.vendor1099FilingSectionId.state,country:m.vendor1099FilingSectionId.country,countryCode:m.vendor1099FilingSectionId.countryCode,postalCode:m.vendor1099FilingSectionId.postalCode,secondaryInfo:m.vendor1099FilingSectionId.secondaryInfo}))(u));e(Bt({addressType:"vendor_address",addressToCreate:i}))},goBackToListPage:()=>{e(Lt(o));const u=`/${d}/vendors/filing_1099/`,i=N(n.state?.pathnameStackToGoBack,n.pathname);t(u,{state:{pathnameStackToGoBack:i}})},onAddressClick:u=>{const i=function(r,p,h){let f=`/${r}/vendors/filing_1099/upload/${h}/edit`;return f=f.concat(`/new/${p}`),f}(d,u,o),m=N(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Jn}})(On);function qs(){const e=M(),a=q(),{vendorId:s}=B(),t=S(d=>O(d));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=S(d=>Vt(d,s));const{tenantEmailDomain:o}=t,c=t.companyId??R.getSignedInUserTenant(o)?.companyId;if(c==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return l.jsx(Ys,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:c})}const Hs=U.div`
96
+ `,Ys=G(function(e,a){const s=R.getSignedInUser(),t=e.tenantState.currentTenantId,n=e.vendorFiling1099UploadDetailsState,o={userId:s?.userId??"",sessionId:s?.zeniSessionId??"",tenantId:t??""};let c={fetchState:"Not-Started",error:void 0};return a.vendorId!=null&&(c=e.vendorViewState.editVendorStateById[a.vendorId]?.fetchStatus),{analytics:P,vendorFiling1099UploadDetailsViewState:n,authParams:o,googleAPIKey:et.googleMapsAPIKey,vendorId:a.vendorId,fetchVendorFetchStatus:c,vendor:a.vendorFiling1099UploadDetails?.vendor}},function(e,a){const{currentTenant:s,navigate:t,location:n,vendorId:o,vendorFiling1099UploadDetails:c}=a,{tenantEmailDomain:d}=s;return{onVendorFiling1099UploadDetailsSave:u=>{e(Bt(u)),P.trackVendor1099DetailSave(c.vendor.legalName??"")},onSaveChangesToLocalStore:u=>{e(Ot(u))},onResetVendorFiling1099FormStatus:()=>{e(en())},onAddressEditHandler:u=>{const i=Nn((m=>({street:m.vendor1099FilingSectionId.street,suite:m.vendor1099FilingSectionId.suite,city:m.vendor1099FilingSectionId.city,state:m.vendor1099FilingSectionId.state,country:m.vendor1099FilingSectionId.country,countryCode:m.vendor1099FilingSectionId.countryCode,postalCode:m.vendor1099FilingSectionId.postalCode,secondaryInfo:m.vendor1099FilingSectionId.secondaryInfo}))(u));e(Jt({addressType:"vendor_address",addressToCreate:i}))},goBackToListPage:()=>{e(Lt(o));const u=`/${d}/vendors/filing_1099/`,i=N(n.state?.pathnameStackToGoBack,n.pathname);t(u,{state:{pathnameStackToGoBack:i}})},onAddressClick:u=>{const i=function(r,p,h){let f=`/${r}/vendors/filing_1099/upload/${h}/edit`;return f=f.concat(`/new/${p}`),f}(d,u,o),m=N(n.state?.pathnameStackToGoBack,n.pathname);t(i,{state:{pathnameStackToGoBack:m}})},AddressFormPage:Bn}})(On);function qs(){const e=M(),a=q(),{vendorId:s}=J(),t=S(d=>O(d));let n;if(s==null)throw new Error("Vendor ID not found for Vendor Filing 1099 Details Screen");n=S(d=>Vt(d,s));const{tenantEmailDomain:o}=t,c=t.companyId??R.getSignedInUserTenant(o)?.companyId;if(c==null)throw new Error("Company ID not found for Vendor Filing 1099 Details Screen");return l.jsx(Ys,{location:a,navigate:e,currentTenant:t,vendorId:s,vendorFiling1099UploadDetails:n,companyId:c})}const Hs=U.div`
97
97
  display: flex;
98
98
  min-height: 100%;
99
99
  width: 100%;
@@ -101,7 +101,7 @@ import{j as l}from"./liveblocks-1thjzoaw.js";import{a as g}from"./sentry-CooVhpi
101
101
  flex-direction: column;
102
102
  align-items: center;
103
103
  background-color: ${e=>e.theme.colors.grey4};
104
- `,Qs=G(function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}},function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,o)=>{e(dn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(cn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onReloadVendors:()=>{e(Oe(!0))},onBackClick:()=>{e(on()),e(ln())},onVendorTabSelectionChanged:n=>{const o=xe(n);s(o),e(ce(Te(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:d}=o,u=zn(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=Yn(a.accountMappingView.expenseAccounts1099FilingAccountList,d),m={selectedBankAccounts1099FilingAccountIds:u.map(r=>r.accountId),selectedExpenseAccounts1099FilingAccountIds:i};e(sn({data:m}))},onSaveClick:()=>{e(nn()),t.track(tt.Event.vendor1099TabSettingsSave)}}})(Bn);function St({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=B(),i=re(),m=R.getSignedInUser(),[r,p]=g.useState(!1),[h,f]=g.useState(!1);if(m==null)throw Error("Can't access vendor filing 1099 page without signing in...");Ce();const C=S(j=>tn(j)),y=S(j=>an(j)),{isAiCfoAccessEnabled:E,onAskAiCfoClick:D}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — 1099"});ge({isDataReady:C.fetchState==="Completed"}),g.useEffect(()=>{h||(f(!0),c(Oe(!1)))},[h,f]),g.useEffect(()=>{y.saveState.fetchState==="Completed"&&c(Oe(!1))},[y.saveState.fetchState]);const I=j=>{p(j)},w=S(j=>O(j)),k={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:w.tenantId},b=g.useMemo(()=>({authParams:k,tenantName:w.companyName,filing1099ReportEndPoint:`${X}/filing1099Reports`}),[]);return l.jsxs(l.Fragment,{children:[C.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(Z,{analytics:P,onLoad:()=>P.trackPageLoaded(tt.Event.vendor1099ListPage)})}):null,l.jsxs(Hs,{windowSize:i,children:[l.jsx(ve,{isAppContentDrawerOpen:r,handleDrawerToggle:I}),l.jsx(Qs,{location:d,navigate:o,previousTabPosition:a,setPreviousTabPosition:s,analytics:P,vendorsFiling1099ListDetails:C,vendorTypeList:C.vendorTypeList,accountMappingView:y,downloadParams:b,tenantEmailDomain:u,vendorTabsToShow:e,isAiCfoAccessEnabled:E,onAskAiCfoClick:D,onClickMenuIcon:()=>{I(!0)}})]})]})}const Ws=U.div`
104
+ `,Qs=G(function(e,a){const{vendorsFiling1099ListDetails:s,accountMappingView:t,analytics:n}=a;return{analytics:n,vendorsFiling1099List:s.vendors,isVendor1099Populated:s.isVendor1099Populated,accountMappingView:t,fetchState:s.fetchState,uiState:s.uiState,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow}},function(e,a){const{navigate:s,analytics:t}=a;return{onUpdateSortUiState:(n,o)=>{e(dn({sortOrder:n,sortKey:o}))},onUpdateSearchUiState:n=>{e(cn({searchString:n}))},onVendorRowClick:n=>{if(a.tenantEmailDomain!=null){const o=`/${a.tenantEmailDomain}/vendors/filing_1099/upload/${encodeURIComponent(n)}/edit`,c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c}})}},onReloadVendors:()=>{e(Oe(!0))},onBackClick:()=>{e(on()),e(ln())},onVendorTabSelectionChanged:n=>{const o=xe(n);s(o),e(ce(Te(n)))},onAccountMappingChange:n=>{const{filing1099:o}=n,{bankAccount:c,expenseCategory1099:d}=o,u=zn(a.accountMappingView.bankAccounts1099FilingAccountList,c.selectedOptions),i=Yn(a.accountMappingView.expenseAccounts1099FilingAccountList,d),m={selectedBankAccounts1099FilingAccountIds:u.map(r=>r.accountId),selectedExpenseAccounts1099FilingAccountIds:i};e(sn({data:m}))},onSaveClick:()=>{e(nn()),t.track(tt.Event.vendor1099TabSettingsSave)}}})(Jn);function St({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),[r,p]=g.useState(!1),[h,f]=g.useState(!1);if(m==null)throw Error("Can't access vendor filing 1099 page without signing in...");Ce();const C=S(j=>tn(j)),y=S(j=>an(j)),{isAiCfoAccessEnabled:E,onAskAiCfoClick:D}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors — 1099"});ge({isDataReady:C.fetchState==="Completed"}),g.useEffect(()=>{h||(f(!0),c(Oe(!1)))},[h,f]),g.useEffect(()=>{y.saveState.fetchState==="Completed"&&c(Oe(!1))},[y.saveState.fetchState]);const I=j=>{p(j)},w=S(j=>O(j)),k={userId:m?.userId??"",sessionId:m?.zeniSessionId??"",tenantId:w.tenantId},b=g.useMemo(()=>({authParams:k,tenantName:w.companyName,filing1099ReportEndPoint:`${X}/filing1099Reports`}),[]);return l.jsxs(l.Fragment,{children:[C.fetchState==="Completed"?l.jsx(l.Fragment,{children:l.jsx(Z,{analytics:P,onLoad:()=>P.trackPageLoaded(tt.Event.vendor1099ListPage)})}):null,l.jsxs(Hs,{windowSize:i,children:[l.jsx(ve,{isAppContentDrawerOpen:r,handleDrawerToggle:I}),l.jsx(Qs,{location:d,navigate:o,previousTabPosition:a,setPreviousTabPosition:s,analytics:P,vendorsFiling1099ListDetails:C,vendorTypeList:C.vendorTypeList,accountMappingView:y,downloadParams:b,tenantEmailDomain:u,vendorTabsToShow:e,isAiCfoAccessEnabled:E,onAskAiCfoClick:D,onClickMenuIcon:()=>{I(!0)}})]})]})}const Ws=U.div`
105
105
  display: flex;
106
106
  min-height: 100%;
107
107
  width: 100%;
@@ -109,4 +109,4 @@ import{j as l}from"./liveblocks-1thjzoaw.js";import{a as g}from"./sentry-CooVhpi
109
109
  flex-direction: column;
110
110
  align-items: center;
111
111
  background-color: ${e=>e.theme.colors.grey4};
112
- `,Zs=G(function(e,a){const{vendorsListDetails:s}=a;return{vendorsList:s.vendors,totalVendorCount:s.totalVendorCount,fetchState:s.fetchState,uiState:s.uiState,searchText:s.searchString,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow,isAccountingClassesEnabled:ae(e),analytics:P}},function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(Sn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(mn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(hn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(pn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(un({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))}}})(Rn);function Xs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=B(),i=re(),m=R.getSignedInUser(),{useFeatureGate:r}=ne(),{isFeatureEnabled:p,isFeatureGateLoading:h}=r(z.isOpexByVendorFeatureEnabled);Ce();const f=e.includes("prepaid_expenses"),C=e.includes("fixed_assets"),y=e.includes("accrued_expenses"),E=S(A=>me(A));let D={};D=S(A=>rn(A,"vendorsTab"));const[I,w]=g.useState(!1),{isAiCfoAccessEnabled:k,onAskAiCfoClick:b}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors Summary"});ge({isDataReady:D.fetchState==="Completed"});const j=S(A=>te(A)),F=S(A=>Q(A).isReportGenerated);S(A=>Q(A).fetchState)==="Completed"&&F&&p&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[V,L]=g.useState(!1);if(g.useEffect(()=>{(f||C)&&V===!1&&j!=="Completed"&&(c(ye()),L(!0))},[V]),g.useEffect(()=>{c(De({shouldFetchAccruedExpenses:y,shouldFetchFixedAssets:C,shouldFetchPrepaidExpenses:f,shouldFetchOpexByVendor:p&&h===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))},[j,C,h,p]),g.useEffect(()=>{I||D.fetchState!=="Completed"||(w(!0),P.trackVendorList(E.currentTab,E.previousTab??null,D.totalVendorCount,D.uiState.sortKey,D.uiState.ytdSpendSelection))},[D.fetchState]),m==null)throw Error("Can't access address page without signing in...");const[x,_]=g.useState(!1),T=A=>{_(A)};return l.jsxs(Ws,{windowSize:i,children:[l.jsx(ve,{isAppContentDrawerOpen:x,handleDrawerToggle:T}),l.jsx(Zs,{location:d,navigate:o,vendorsListDetails:D,tenantEmailDomain:u,vendorTabsToShow:e,onClickMenuIcon:()=>{T(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:k,onAskAiCfoClick:b})]})}function bo(){const{useFeatureGate:e}=ne(),a=q().state?.referrer,[s,t]=g.useState(!1),[n,o]=g.useState(0),c=R.getSignedInUser(),d=fn(c),{isFeatureEnabled:u}=e(z.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e(z.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(z.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:r}=e(z.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:p}=e(z.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:h}=e(z.isFiling1099FeatureEnabled),f=S(w=>O(w)),C=f?.externalConnections?.accounting[0]?.connectionName,y=["vendors_tab"];C!=="netsuite"&&m===!0&&y.push("prepaid_expenses"),C!=="netsuite"&&r===!0&&y.push("fixed_assets"),C!=="netsuite"&&p===!0&&y.push("accrued_expenses"),C!=="netsuite"&&h&&d&&(y.push("filing_1099"),u&&y.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:E}=e(z.isDebitCardFeatureEnabled),D=gn(E,f),I=vn(f);return D===!0||I===!0?l.jsx(nt,{children:l.jsx(J,{path:"/*",element:l.jsx(Gn,{})})}):l.jsxs(nt,{children:[l.jsx(J,{path:"/opex",element:u===!0?l.jsx(Es,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../summary"})}),l.jsx(J,{path:"/summary",element:l.jsx(Xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y})}),l.jsx(J,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?l.jsx(os,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(J,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?l.jsx(es,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(J,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?l.jsx(us,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(J,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||r===!0?l.jsx(gs,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(J,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:p===!0?l.jsx(Qn,{setShouldNavigateBack:t}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(J,{path:"schedules/prepaid_expenses",element:m===!0?l.jsx(ks,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(J,{path:"schedules/fixed_assets",element:r===!0?l.jsx(ys,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(J,{path:"schedules/accrued_expenses",element:p===!0?l.jsx(Ts,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(J,{path:"/filing_1099",element:h&&d?l.jsx(St,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(J,{path:"/filing_1099/:vendorId",element:h&&d?l.jsx(St,{vendorTabsToShow:y,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx(K,{to:"../opex"})}),l.jsx(J,{path:"/filing_1099/upload/:vendorId/edit",element:h&&d?l.jsx(ht,{appContent:l.jsx(qs,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx(K,{to:"../opex"})}),l.jsx(J,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:h&&d?l.jsx(ht,{appContent:l.jsx(Mn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx(K,{to:"../opex"})}),l.jsx(J,{path:"/summary/:vendorId/:qboId",element:l.jsx(pt,{referrerType:a,isFiling1099FeatureEnabled:h&&d})}),l.jsx(J,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(pt,{referrerType:a,isFiling1099FeatureEnabled:h&&d})}),l.jsx(J,{path:"/review",element:i===!0?l.jsx(mt,{}):l.jsx(ie,{})}),l.jsx(J,{path:"/review/vendor/:vendorId",element:i?l.jsx(mt,{}):l.jsx(ie,{})}),l.jsx(J,{path:"/",element:l.jsx(K,{to:"summary"})}),l.jsx(J,{path:"*",element:l.jsx(ie,{})})]})}export{bo as default};
112
+ `,Zs=G(function(e,a){const{vendorsListDetails:s}=a;return{vendorsList:s.vendors,totalVendorCount:s.totalVendorCount,fetchState:s.fetchState,uiState:s.uiState,searchText:s.searchString,lastRefreshSuccessTime:s.lastRefreshSuccessTime,vendorTabsToShow:a.vendorTabsToShow,isAccountingClassesEnabled:ae(e),analytics:P}},function(e,a){const{navigate:s}=a;return{onFetchVendorsList:(t="",n,o)=>{e(Sn({searchString:t,keepExistingListItems:n,view:"vendorsTab",pageToken:o}))},onUpdatePageToken:t=>{e(mn({pageToken:t}))},onUpdateSortUiState:(t,n)=>{e(hn({sortOrder:t,sortkey:n}))},onUpdateCurrentYTDSelection:t=>{e(pn({ytdSpendSelection:t}))},onVendorRowClick:(t,n)=>{if(a.tenantEmailDomain!=null){const o=at(t,n,a.tenantEmailDomain),c=N(a.location.state?.pathnameStackToGoBack,a.location.pathname);a.navigate(o,{state:{pathnameStackToGoBack:c,referrer:"Vendor List"}})}},onReloadVendors:()=>{console.log("Reload vendors")},onUpdateScrollYOffset:t=>{e(un({scrollYOffset:t}))},onBackClick:()=>{s("../..")},onVendorTabSelectionChanged:t=>{const n=xe(t);s(n),e(ce(Te(t)))}}})(Rn);function Xs({vendorTabsToShow:e,previousTabPosition:a,setPreviousTabPosition:s}){const{isAiCfoOpen:t,setIsAiCfoOpen:n}=Se(),o=M(),c=Y(),d=q(),{tenantEmailDomain:u}=J(),i=re(),m=R.getSignedInUser(),{useFeatureGate:r}=ne(),{isFeatureEnabled:p,isFeatureGateLoading:h}=r(z.isOpexByVendorFeatureEnabled);Ce();const f=e.includes("prepaid_expenses"),C=e.includes("fixed_assets"),y=e.includes("accrued_expenses"),E=S(A=>me(A));let D={};D=S(A=>rn(A,"vendorsTab"));const[I,w]=g.useState(!1),{isAiCfoAccessEnabled:k,onAskAiCfoClick:b}=fe({isAiCfoOpen:t,setIsAiCfoOpen:n,mobileExploreReferrer:"Vendors Summary"});ge({isDataReady:D.fetchState==="Completed"});const j=S(A=>te(A)),F=S(A=>Q(A).isReportGenerated);S(A=>Q(A).fetchState)==="Completed"&&F&&p&&!e.includes("operating_expenses_by_vendor")&&e.splice(1,0,"operating_expenses_by_vendor");const[V,L]=g.useState(!1);if(g.useEffect(()=>{(f||C)&&V===!1&&j!=="Completed"&&(c(ye()),L(!0))},[V]),g.useEffect(()=>{c(De({shouldFetchAccruedExpenses:y,shouldFetchFixedAssets:C,shouldFetchPrepaidExpenses:f,shouldFetchOpexByVendor:p&&h===!1,shouldFetchVendorsList:!0,shouldFetchFiling1099Vendor:!1}))},[j,C,h,p]),g.useEffect(()=>{I||D.fetchState!=="Completed"||(w(!0),P.trackVendorList(E.currentTab,E.previousTab??null,D.totalVendorCount,D.uiState.sortKey,D.uiState.ytdSpendSelection))},[D.fetchState]),m==null)throw Error("Can't access address page without signing in...");const[x,_]=g.useState(!1),T=A=>{_(A)};return l.jsxs(Ws,{windowSize:i,children:[l.jsx(ve,{isAppContentDrawerOpen:x,handleDrawerToggle:T}),l.jsx(Zs,{location:d,navigate:o,vendorsListDetails:D,tenantEmailDomain:u,vendorTabsToShow:e,onClickMenuIcon:()=>{T(!0)},previousTabPosition:a,setPreviousTabPosition:s,isAiCfoAccessEnabled:k,onAskAiCfoClick:b})]})}function bo(){const{useFeatureGate:e}=ne(),a=q().state?.referrer,[s,t]=g.useState(!1),[n,o]=g.useState(0),c=R.getSignedInUser(),d=fn(c),{isFeatureEnabled:u}=e(z.isOpexByVendorFeatureEnabled),{isFeatureEnabled:i}=e(z.isVendorReviewFeatureEnabled),{isFeatureEnabled:m}=e(z.isScheduledJEPrepaidExpensesFeatureEnabled),{isFeatureEnabled:r}=e(z.isScheduledJEFixedAssetsFeatureEnabled),{isFeatureEnabled:p}=e(z.isScheduledJEAccruedExpensesFeatureEnabled),{isFeatureEnabled:h}=e(z.isFiling1099FeatureEnabled),f=S(w=>O(w)),C=f?.externalConnections?.accounting[0]?.connectionName,y=["vendors_tab"];C!=="netsuite"&&m===!0&&y.push("prepaid_expenses"),C!=="netsuite"&&r===!0&&y.push("fixed_assets"),C!=="netsuite"&&p===!0&&y.push("accrued_expenses"),C!=="netsuite"&&h&&d&&(y.push("filing_1099"),u&&y.splice(1,0,"operating_expenses_by_vendor"));const{isFeatureEnabled:E}=e(z.isDebitCardFeatureEnabled),D=gn(E,f),I=vn(f);return D===!0||I===!0?l.jsx(nt,{children:l.jsx(B,{path:"/*",element:l.jsx(Gn,{})})}):l.jsxs(nt,{children:[l.jsx(B,{path:"/opex",element:u===!0?l.jsx(Es,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../summary"})}),l.jsx(B,{path:"/summary",element:l.jsx(Xs,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y})}),l.jsx(B,{path:"schedules/fixed_assets/details/:scheduleDetailId",element:r===!0?l.jsx(os,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId",element:r===!0?l.jsx(es,{shouldNavigateBack:s,setShouldNavigateBack:t}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId",element:m===!0?l.jsx(us,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/:scheduleType/details/:scheduleDetailId/edit_link",element:m===!0||r===!0?l.jsx(gs,{}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/accrued_expenses/details/:scheduleDetailId/edit_link",element:p===!0?l.jsx(Qn,{setShouldNavigateBack:t}):l.jsx(K,{to:"../../vendors/opex"})}),l.jsx(B,{path:"schedules/prepaid_expenses",element:m===!0?l.jsx(ks,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"schedules/fixed_assets",element:r===!0?l.jsx(ys,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"schedules/accrued_expenses",element:p===!0?l.jsx(Ts,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099",element:h&&d?l.jsx(St,{previousTabPosition:n,setPreviousTabPosition:o,vendorTabsToShow:y}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/:vendorId",element:h&&d?l.jsx(St,{vendorTabsToShow:y,previousTabPosition:n,setPreviousTabPosition:o}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit",element:h&&d?l.jsx(ht,{appContent:l.jsx(qs,{}),showFullScreenSkeletonWhileLoading:!0}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/filing_1099/upload/:vendorId/edit/new/:addressType",element:h&&d?l.jsx(ht,{appContent:l.jsx(Mn,{isSubPage:!0,hideAddressBackButton:!0,hideAddressSubTitle:!0})}):l.jsx(K,{to:"../opex"})}),l.jsx(B,{path:"/summary/:vendorId/:qboId",element:l.jsx(pt,{referrerType:a,isFiling1099FeatureEnabled:h&&d})}),l.jsx(B,{path:"/summary/:vendorId/:qboId/:timeframe/:startDate/:endDate",element:l.jsx(pt,{referrerType:a,isFiling1099FeatureEnabled:h&&d})}),l.jsx(B,{path:"/review",element:i===!0?l.jsx(mt,{}):l.jsx(ie,{})}),l.jsx(B,{path:"/review/vendor/:vendorId",element:i?l.jsx(mt,{}):l.jsx(ie,{})}),l.jsx(B,{path:"/",element:l.jsx(K,{to:"summary"})}),l.jsx(B,{path:"*",element:l.jsx(ie,{})})]})}export{bo as default};