@zeniai/web-app-ui 5.1.63-qa → 5.1.64-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 (161) hide show
  1. package/dist/assets/AddressRoutes-DTd0NBaA.js +1 -0
  2. package/dist/assets/{AddressScreen-DZz6iLRi.js → AddressScreen-BnC-xeNO.js} +2 -2
  3. package/dist/assets/AiCfoScreen-D7S1jmtC.js +22 -0
  4. package/dist/assets/BillPayApprovalRoutes-BKtx1kJ3.js +1 -0
  5. package/dist/assets/BillPayRoutes-g07_m1Yx.js +119 -0
  6. package/dist/assets/BusinessVerificationPageScreen-CpGRtjnS.js +9 -0
  7. package/dist/assets/ChargeCardRoutes-WsjwCttT.js +71 -0
  8. package/dist/assets/CompanyPassportScreen-Cx74K6-1.js +1 -0
  9. package/dist/assets/ConnectionAuthScreen-BIRo2BaP.js +11 -0
  10. package/dist/assets/CustomerOnboardingAuthScreen-L8PntkLo.js +1 -0
  11. package/dist/assets/CustomerOnboardingRoutes-BV1QbewZ.js +23 -0
  12. package/dist/assets/DashboardRoutes-ClXxpw2D.js +20 -0
  13. package/dist/assets/DefaultTenantHome-k3m2vfzP.js +1 -0
  14. package/dist/assets/DomesticWireDetailScreen-DuPKfc2x.js +18 -0
  15. package/dist/assets/DrawerScreen-1fdGLdyV.js +1 -0
  16. package/dist/assets/EntityDetailRoutes-Brh486Q-.js +1 -0
  17. package/dist/assets/ExpenseAutomationRoutes-DNJSb5io.js +25 -0
  18. package/dist/assets/FeaturePreviewScreen-wzurtqwt.js +1 -0
  19. package/dist/assets/HubSpotOAuthCallbackScreen-0mV19jgL.js +1 -0
  20. package/dist/assets/MagicLinkRoutes-D6TmVWte.js +72 -0
  21. package/dist/assets/MagicLinkSignInScreen-C6WlM5JI.js +12 -0
  22. package/dist/assets/MobileAppDrawer-w7Ih7RbS.js +1 -0
  23. package/dist/assets/NotFoundScreen-BNcKpH4N.js +1 -0
  24. package/dist/assets/NotificationRoutes-CQSd1khI.js +1 -0
  25. package/dist/assets/OAuthConsentScreen-BbKUoIMi.js +1 -0
  26. package/dist/assets/PandLWithForecastRoutes-DeUji8s7.js +1 -0
  27. package/dist/assets/PeopleRoutes-Bv6D04K8.js +22 -0
  28. package/dist/assets/PerformanceRoutes-B4uBsUKn.js +1 -0
  29. package/dist/assets/{Preview-C7zW6Q7F.js → Preview-44tjfNzS.js} +1 -1
  30. package/dist/assets/{QBOConnectionScreen-_B3wLRiT.js → QBOConnectionScreen-Dppvtafz.js} +1 -1
  31. package/dist/assets/ReferralListScreen-BH3bO2h_.js +5 -0
  32. package/dist/assets/ReimbursementApprovalRoutes-DrhBbGrt.js +1 -0
  33. package/dist/assets/ReimbursementApprovalRuleDetailScreen-_CUcSO8M.js +1 -0
  34. package/dist/assets/ReimbursementRoutes-Ck88YnRC.js +68 -0
  35. package/dist/assets/ReportsRoutes-EgjleUVF.js +1 -0
  36. package/dist/assets/RewardsRoutes-Cs04goLx.js +1 -0
  37. package/dist/assets/ScreenRoutes-DAVGJEPC.js +2 -0
  38. package/dist/assets/SettingsRoutes-CGwpR34_.js +57 -0
  39. package/dist/assets/SetupPagesScreen-DVYIUml2.js +29 -0
  40. package/dist/assets/SignInScreen-BfIi8mxH.js +1 -0
  41. package/dist/assets/SignOutScreen-CRjp33Uq.js +9 -0
  42. package/dist/assets/TaskListScreen-zDige7Qx.js +9 -0
  43. package/dist/assets/TaskRoutes-DZSVbSVg.js +9 -0
  44. package/dist/assets/TransactionDetailRoutes-CAIheVGH.js +1 -0
  45. package/dist/assets/TransactionDetailScreen-Nhb9Cdoj.js +5 -0
  46. package/dist/assets/TransactionListRoutes-CCSHgT8f.js +1 -0
  47. package/dist/assets/TreasuryRoutes-BEe2hzHB.js +37 -0
  48. package/dist/assets/{VendorsRoutes-MlvyyMTe.js → VendorsRoutes-DkoRIuON.js} +27 -27
  49. package/dist/assets/WiseConfirmationScreen-C2xx_UCS.js +12 -0
  50. package/dist/assets/ZeniAccountRoutes-CAOHS1Ia.js +57 -0
  51. package/dist/assets/ZeniAccountStatementScreen-CO_1LwB4.js +9 -0
  52. package/dist/assets/{accountMappingHelper-BPzhOzDQ.js → accountMappingHelper-CDd_SN9l.js} +1 -1
  53. package/dist/assets/{analytics-Bqx0zRxd.js → analytics-CStLmwuB.js} +1 -1
  54. package/dist/assets/{analyticsHelper-bAQTI-GF.js → analyticsHelper-DLbyZBKc.js} +1 -1
  55. package/dist/assets/{core-Bv1T7LZC.js → core-DvGkVhX0.js} +2 -2
  56. package/dist/assets/{decodeURIComponentSafe-CgJ-EbJc.js → decodeURIComponentSafe-D3G61A3x.js} +1 -1
  57. package/dist/assets/dnd-DVf98RdY.js +6 -0
  58. package/dist/assets/{empty-BGU_c4p_.js → empty-C73IrULF.js} +1 -1
  59. package/dist/assets/empty-C94l7QZZ.js +1 -0
  60. package/dist/assets/{emptyVideoElement-D0DWhAqS.js → emptyVideoElement-C0Gsi5o3.js} +1 -1
  61. package/dist/assets/epic-6iIIFADw.js +2 -0
  62. package/dist/assets/getLocaleForTenant-cEMfjXsu.js +1 -0
  63. package/dist/assets/index-CR_F8qmF.js +1 -0
  64. package/dist/assets/{index-CVpYlrKc.js → index-ChP5wU0r.js} +38720 -44339
  65. package/dist/assets/{index-B-VkC3pW.js → index-D4KKzLMy.js} +1 -1
  66. package/dist/assets/{index-C7MHnpYf.js → index-D82ghQVK.js} +1 -1
  67. package/dist/assets/{index-BcMhlMw0.js → index-DBkI4Pc2.js} +1 -1
  68. package/dist/assets/{index-Bf0yAk1h.js → index-DH8DxHEc.js} +2 -2
  69. package/dist/assets/{empty-DZLujeFc.js → index-DKlRxDbB.js} +1 -1
  70. package/dist/assets/{index-BfDh5m3J.js → index-Dm6nOQvo.js} +1 -1
  71. package/dist/assets/{index-BUmr5maU.css → index-R6GjjTB3.css} +1 -1
  72. package/dist/assets/{lexical-DtmspfR6.js → lexical-BStGoUxq.js} +1 -1
  73. package/dist/assets/{liveblocks-DC3GaKoW.js → liveblocks-CfHMBm08.js} +1 -1
  74. package/dist/assets/{lottie-BAdftm7g.js → lottie-Byecfo2L.js} +1 -1
  75. package/dist/assets/{mui-VYhJrGDQ.js → mui-D2FQmczV.js} +1 -1
  76. package/dist/assets/{pathToGoBack-BPhnwklb.js → pathToGoBack-DSTCEkoM.js} +1 -1
  77. package/dist/assets/{pdf-DyfSqkK5.js → pdf-CojJ326Z.js} +4 -4
  78. package/dist/assets/{pdf-lib-CPh8no6v.js → pdf-lib-D37uSEI7.js} +1 -1
  79. package/dist/assets/{plaid-BlhDSPsk.js → plaid-DzUK2ot_.js} +1 -1
  80. package/dist/assets/{pusher-DGAKVhUw.js → pusher-9dHg1-dz.js} +1 -1
  81. package/dist/assets/{react-EkeFt_9c.js → react-8lRluBI7.js} +1 -1
  82. package/dist/assets/{react-mFsTSWE1.js → react-C8Da0Bh3.js} +1 -1
  83. package/dist/assets/{react-D_wg-5Ag.js → react-CpxXCBmF.js} +1 -1
  84. package/dist/assets/{react-D4kHPPtw.js → react-D0gT4wkv.js} +1 -1
  85. package/dist/assets/{react-BJZHoUnV.js → react-DgijNfbO.js} +1 -1
  86. package/dist/assets/{react-B1_zGwIA.js → react-DhZhbZXR.js} +1 -1
  87. package/dist/assets/{recharts-D979ncoh.js → recharts-CnIvro2v.js} +3 -3
  88. package/dist/assets/{routePaths-DdjVf9j1.js → routePaths-CL9hJjr9.js} +1 -1
  89. package/dist/assets/{sentry-CuaXjR5n.js → sentry-0vIaNqsr.js} +1 -1
  90. package/dist/assets/{url-DXrWvdUh.js → url-D3bpmQ93.js} +1 -1
  91. package/dist/assets/{url-73U0aVt0.js → url-DBgQsa85.js} +1 -1
  92. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-DsMWHBWn.js +1 -0
  93. package/dist/assets/useAskAiCfoHostNavButtonProps-RTOhQENK.js +1 -0
  94. package/dist/assets/{useDeviceId-BVyTAih4.js → useDeviceId-BXBJZ6FP.js} +1 -1
  95. package/dist/assets/useInitialThreadRequest-CLh-E-cE.js +1 -0
  96. package/dist/assets/{utils-DPYDOv00.js → utils-DF5mLbko.js} +2 -2
  97. package/dist/assets/withTransactionSidePanel-rHr5DjOB.js +21 -0
  98. package/dist/assets/zeni-epic-state-D_HFZhXl.js +13 -0
  99. package/dist/index.html +1 -1
  100. package/package.json +4 -4
  101. package/dist/assets/AddressRoutes-DgZlzwKj.js +0 -1
  102. package/dist/assets/AiCfoScreen-BJy_pYhd.js +0 -22
  103. package/dist/assets/BillPayApprovalRoutes-DJjLicyn.js +0 -1
  104. package/dist/assets/BillPayRoutes-DAczZIUA.js +0 -119
  105. package/dist/assets/BusinessVerificationPageScreen-CbhS3pML.js +0 -9
  106. package/dist/assets/CardsAiCfoScreen-D3HVbkzL.js +0 -14
  107. package/dist/assets/ChargeCardRoutes-lmFHLgNx.js +0 -71
  108. package/dist/assets/CompanyPassportScreen-BUt2L6sz.js +0 -1
  109. package/dist/assets/ConnectionAuthScreen-BT3IRUL8.js +0 -11
  110. package/dist/assets/CustomerOnboardingAuthScreen-BAn5X2Wb.js +0 -1
  111. package/dist/assets/CustomerOnboardingRoutes-Dzhhfcds.js +0 -30
  112. package/dist/assets/DashboardRoutes-CDKfXwLt.js +0 -20
  113. package/dist/assets/DefaultTenantHome-CXh59aBD.js +0 -1
  114. package/dist/assets/DomesticWireDetailScreen-iXO5zWUm.js +0 -18
  115. package/dist/assets/DrawerScreen-B_vR9_qC.js +0 -1
  116. package/dist/assets/EntityDetailRoutes-BcZQKkh1.js +0 -1
  117. package/dist/assets/ExpenseAutomationRoutes-CWOOkRUe.js +0 -25
  118. package/dist/assets/FeaturePreviewScreen-BQvRhW1f.js +0 -1
  119. package/dist/assets/HubSpotOAuthCallbackScreen-DeESKpku.js +0 -1
  120. package/dist/assets/MagicLinkRoutes-6x7Us6_Q.js +0 -72
  121. package/dist/assets/MagicLinkSignInScreen-BsUi7-40.js +0 -12
  122. package/dist/assets/MobileAppDrawer-CHF9nCsW.js +0 -1
  123. package/dist/assets/NotFoundScreen-D0AQGcoe.js +0 -1
  124. package/dist/assets/NotificationRoutes-BPu1VkFm.js +0 -1
  125. package/dist/assets/OAuthConsentScreen-DkCTDJwq.js +0 -1
  126. package/dist/assets/PandLWithForecastRoutes-BEFahy-o.js +0 -1
  127. package/dist/assets/PeopleRoutes-sN-axVAc.js +0 -22
  128. package/dist/assets/PerformanceRoutes-DXXEZbBB.js +0 -1
  129. package/dist/assets/ReferralListScreen-CzPMgGBj.js +0 -5
  130. package/dist/assets/ReimbursementApprovalRoutes-DCrHBh1u.js +0 -1
  131. package/dist/assets/ReimbursementApprovalRuleDetailScreen-SmUpbSJe.js +0 -1
  132. package/dist/assets/ReimbursementRoutes-xFL2a98D.js +0 -68
  133. package/dist/assets/ReportsRoutes-BCmFjTfI.js +0 -1
  134. package/dist/assets/RewardsRoutes-OtuIPjdr.js +0 -1
  135. package/dist/assets/ScreenRoutes-CEUjM6GK.js +0 -2
  136. package/dist/assets/SettingsRoutes-BtEyetWY.js +0 -57
  137. package/dist/assets/SetupPagesScreen-CCip2k58.js +0 -29
  138. package/dist/assets/SignInScreen-jXShH9LP.js +0 -1
  139. package/dist/assets/SignOutScreen-CnWA4YZp.js +0 -9
  140. package/dist/assets/TaskListScreen-qq0yWrR-.js +0 -9
  141. package/dist/assets/TaskRoutes-B3fEaAUN.js +0 -9
  142. package/dist/assets/TransactionDetailRoutes-DWDGqu2s.js +0 -1
  143. package/dist/assets/TransactionDetailScreen-DW8t3EC2.js +0 -5
  144. package/dist/assets/TransactionListRoutes-DHSwzqfn.js +0 -1
  145. package/dist/assets/TreasuryRoutes-Cxtbe06-.js +0 -37
  146. package/dist/assets/WiseConfirmationScreen-D-axhjl6.js +0 -12
  147. package/dist/assets/ZeniAccountRoutes-BG6yVxGl.js +0 -73
  148. package/dist/assets/ZeniAccountStatementScreen-D1CXmWJM.js +0 -9
  149. package/dist/assets/dnd-CrtLd1r-.js +0 -6
  150. package/dist/assets/epic-C0x_kZHk.js +0 -2
  151. package/dist/assets/getLocaleForTenant-DrFh6zlq.js +0 -1
  152. package/dist/assets/index-Bgxmla6x.js +0 -1
  153. package/dist/assets/index-Dvxx9UaB.js +0 -1
  154. package/dist/assets/useAiCfoDashboardSuggestedQuestionsChips-CA141hZU.js +0 -1
  155. package/dist/assets/useAskAiCfoHostNavButtonProps-w5iOFbal.js +0 -1
  156. package/dist/assets/useCashManagementBanner-Drz7Ezu4.js +0 -1
  157. package/dist/assets/useChargeCardPusherEvents-FFGUOH8U.js +0 -1
  158. package/dist/assets/useEmailConnectResultRefresh-DsiaZGrG.js +0 -1
  159. package/dist/assets/useInitialThreadRequest-B3tsIQAR.js +0 -1
  160. package/dist/assets/withTransactionSidePanel-Dy09Dwri.js +0 -21
  161. package/dist/assets/zeni-epic-state-DuQa9FMz.js +0 -13
@@ -0,0 +1,5 @@
1
+ import{j as w}from"./liveblocks-CfHMBm08.js";import{a as r}from"./sentry-0vIaNqsr.js";import{u as N,k as Je,j as h,t as Qe,g as he,h as ge,i as Se,N as Xe,n as Ke}from"./core-DvGkVhX0.js";import{mU as me,eR as J,fO as Ze,m5 as ea,m3 as aa,bn as ta,cO as ye,bs as Te,qj as G,La as $,Mb as be,Mc as ae,LA as Ee,jT as Ie,Md as ve,LF as te,LG as ne,kI as Ce,Ia as oe,L4 as M,jN as De,jL as ke,jX as na,mH as oa,Me as sa,Mf as ia,up as Y,jS as Ae,Hv as xe,cT as ra,cU as ca,Mg as la,L3 as da,Mh as ua,ul as ma,Mi as pa,Mj as fa,Mk as ha,Ml as ga,Mm as Sa,jW as ya,Mn as Ta,Mo as ba,L5 as Ea,Mp as Ia,Mq as va,Mr as Ca,Hp as Da,Hf as ka,HE as Aa,jY as xa,Ib as pe,mM as wa}from"./zeni-epic-state-D_HFZhXl.js";import{a as H,G as F,z as we,aN as Fe,m as Fa,J as Ua,aO as Pa,E as _a,r as Z,k as La,aP as Va,s as ee,_ as Ba,aQ as Oa,e as Ue,aR as Ra,at as za,a2 as K}from"./index-ChP5wU0r.js";import{n as Ma,S as Na,D as ja}from"./mui-D2FQmczV.js";import{u as Ga}from"./useAskAiCfoHostNavButtonProps-RTOhQENK.js";import{d as Pe}from"./decodeURIComponentSafe-D3G61A3x.js";import{h as _e,c as Le,g as $a,e as Ha}from"./routePaths-CL9hJjr9.js";import{t as qa}from"./utils-DF5mLbko.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]="7bc5d0f3-7017-4c55-910c-362657a0df5b",a._sentryDebugIdIdentifier="sentry-dbid-7bc5d0f3-7017-4c55-910c-362657a0df5b")}catch{}})();function Wa(a=!0){const e=N(),s=Je(),{useFeatureGate:t}=H(),{isFeatureEnabled:n}=t(F.isCreateTransferEntryFromExpenseEnabled);r.useEffect(()=>{if(!a||n!==!0)return;const o=i=>{const l=s.getState().createTransferEntryState.transferAccountsByType[i].fetchState;return l!=="In-Progress"&&l!=="Completed"};o("transferEntryEligible")&&e(me({kind:"transferEntryEligible"})),o("creditCardOnlyEligible")&&e(me({kind:"creditCardOnlyEligible"}))},[a,n,e,s])}function Ya(a,e){const s=function(){const l=N(),[m,f]=r.useState(!1),[E,p]=r.useState(null),{useDynamicConfig:g}=H(),{configValue:U,isDynamicConfigLoading:T}=g("transaction_categorization_config"),u=!T&&U?.capitalization_enabled===!0,D=h(v=>J(v)),I=D.companyId,A=h(v=>Ze(v.companyState,D.companyId)?.company.companyLocaleInfo?.currencySymbol??"$"),{capitalizableAccounts:b,globalThreshold:k,maxCeiling:P,onboardingShownForPrepaid:_,onboardingShownForFixedAsset:B}=h(v=>{const S=v.tenantState.currentTenantId,c=S!=null?v.tenantState.tenantsById[S]:void 0;return{capitalizableAccounts:c?.capitalizableAccounts??null,globalThreshold:c?.capitalizationThreshold??null,maxCeiling:c?.capitalizationThresholdMaxCeiling??null,onboardingShownForPrepaid:c?.capitalizationOnboardingShownForPrepaid===!0,onboardingShownForFixedAsset:c?.capitalizationOnboardingShownForFixedAsset===!0}},Qe),j=r.useCallback(v=>{if(!u||b==null||k!=null&&k>0)return;const S=b.accounts??[],c=new Set(v);let V=!1,C=!1;for(const x of S)c.has(x.accountId)&&(x.classificationType==="prepaid"?V=!0:x.classificationType==="fixed_asset"&&(C=!0));V&&!_?(p("prepaid"),f(!0)):C&&!B&&(p("fixed_asset"),f(!0))},[u,b,k,_,B]),O=r.useCallback(v=>{E!=null&&(l(ea(I,v,P,E)),f(!1),p(null))},[l,I,E,P]),L=r.useCallback(()=>{E!=null&&(l(aa(I,E)),f(!1),p(null))},[l,I,E]);return{showPopup:m&&u,popupType:E,currencySymbol:A,checkAndShowPopup:j,handleSubmit:O,handleDismiss:L}}(),t=r.useRef(void 0),n=r.useRef([]),o=r.useRef(s.checkAndShowPopup);o.current=s.checkAndShowPopup;const i=r.useRef(e);return i.current=e,r.useEffect(()=>{a==="In-Progress"&&(n.current=i.current()),a==="Completed"&&t.current==="In-Progress"&&n.current.length>0&&(o.current(n.current),n.current=[]),t.current=a},[a]),s}const se=()=>{const a=we.getSignedInUser(),{useFeatureGate:e}=H(),{isFeatureEnabled:s}=e(F.isChainOfThoughtEnabled);return r.useMemo(()=>ta(a)&&s,[a,s])};function Ve(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 ft(a,e){const s=N(),{useFeatureGate:t,useDynamicConfig:n}=H(),o=h(y=>J(y)),i=o.userRole.includes("charge_card_user")||o.userRole.includes("charge_card_admin"),l=o.userRole!=null&&ye(o.userRole),m=o.userRole!=null&&Te(o.userRole),{isFeatureEnabled:f}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:E}=t(F.isExpenseAutomationEnabled),{configValue:p}=n(Fe.enableUncategorizedExpenseCategory),g=p?.uncategorized_expense_category_enabled===!0,U=se(),T=r.useMemo(()=>({id:a,type:G(e)}),[a,e]),u=h(y=>$(y,T)),D=u?.transactionDetailUpdateStatus?.fetchState,I=u?.transactionDetailLocalData?.lineItemById,A=h(y=>{const W=$(y,T)?.transactionDetailLocalData.vendorUpdates?.id;return W==null?"Not-Started":y.transactionVendorViewState.editVendorStateById[W]?.saveStatus.fetchState??"Not-Started"}),b=r.useMemo(()=>u?.fetchState==="Completed"?Ve(u?.transaction):void 0,[u?.fetchState,u?.transaction]),k=h(y=>{if(b!=null)return be(y.customerIncomeState,y.vendorExpenseState,y.trendState,b,"month")}),P=h(y=>ae(y)),_=h(y=>{if(b!=null)return Ee(y.trendWithTransactionsState,b,"TransactionDetail")}),B=o.company?.companyInfo.firstMonthOfFY??1,j=h(y=>Ie(y.accountState,y.accountListState,"accountList")),[O,L]=r.useState(!1),[v,S]=r.useState(!1),[c,V]=r.useState(!1);r.useEffect(()=>{L(!1),S(!1),V(!1)},[a,e]);const C=r.useCallback(()=>{L(!1),S(!1)},[]),[x,R]=r.useState(!1),q=_?.selectedPeriod?.timePeriod;return r.useEffect(()=>{c||u==null||u.transaction==null||(s(ve({id:u.transaction.id,type:u.transaction.type})),V(!0)),b!=null&&(!i||l&&m===!1)&&(O?v||k==null||(S(!0),s(oe(b,"TransactionDetail",{timeframe:"month",timePeriod:q??k}))):(s(te()),s(ne()),L(!0),s(Ce(b))))},[s,c,u?.fetchState,u?.transaction,b,i,l,m,O,v,k,q]),r.useEffect(()=>{P.newVendorState?.vendorDetailLocalData?.vendorName!=null?R(!0):R(!1)},[P.newVendorState?.vendorDetailLocalData?.vendorName]),r.useEffect(()=>()=>{s(M("common"))},[s]),{currentTenant:o,loggedInUserHasCardUserOrAdminRole:i,isUserHasDashboardAccess:l,isUserHasInvestorOrBankerAccess:m,isVendorBulkUpdateOnTransactionEnabled:f,isExpenseAutomationEnabled:E,isUncategorizedExpenseCategoryEnabled:g,isChainOfThoughtEnabled:U,selectedTransaction:T,transactionDetail:u,rawDetailSaveStatus:D,rawDetailLineItemById:I,vendorSaveStatus:A,tranEntity:b,defaultTrendTransactionTimePeriod:k,vendorViewDetails:P,uiState:_,firstMonthOfFY:B,uncategorizedAccounts:j,resetTrendIsFetchedStates:C,isCreateVendorDrawerOpen:x,setIsCreateVendorDrawerOpen:R}}const Ja={overlayWidth:new _a(100,100,58)},Qa=({isOpen:a,onSaveVendor:e,onSaveSuccess:s,onCancel:t,vendorViewDetails:n})=>{const o=Fa(),i=Ua(),l=N(),m=h(p=>ae(p)),f=()=>{t()},E={vendorDetailView:n??m,onSaveSuccess:()=>{l(ke()),l(na("Not-Started")),s()},onSaveVendor:e,onCancelClick:f,saveVendorDetailLocalData:p=>{l(De({vendorId:void 0,localData:p}))}};return w.jsx(ja,{anchor:"right",open:a,PaperProps:{style:{width:Ja.overlayWidth.valuePercentage(i),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:o.colors.black,opacity:.4,cursor:"pointer"}}},onClose:f,children:w.jsx(Xa,{onClick:p=>p.stopPropagation(),children:w.jsx(Pa,{...E})})})},Xa=Ma(Na)`
2
+ display: flex;
3
+ min-height: 100%;
4
+ flex-direction: column;
5
+ `;function Ka(a,e){a(oa({transactionId:e.transactionId,creditAccountIntegrationId:e.creditAccountIntegrationId,debitAccountIntegrationId:e.debitAccountIntegrationId,memo:e.memo,transactionType:G(e.transactionType),sourceTransactionType:G(e.sourceTransactionType)}))}function Za({currentTransactionId:a,enabled:e=!0,buildPath:s,beforeNavigate:t,navigate:n,navigateState:o}){const i=h(m=>m.createTransferEntryState.lastTransferEntryReplacement),l=r.useRef(null);r.useEffect(()=>{if(!e||i==null||a==null||l.current===i)return;const{previousTransactionId:m,newTransactionId:f}=i;a.id===m.id&&a.type===m.type&&(l.current=i,t?.(),n(s(f),{replace:!0,state:o}))},[e,i,a,s,t,n,o])}const et=({closeDrawerHandler:a,overrideTransactionId:e,overrideTransactionType:s})=>{const t=he(),n=ge(),o=N(),i=se(),{transactionTypeEncoded:l,transactionId:m}=Se(),f=e??m,E=s??Pe(l??"");let p;_e(f,E)&&(p={id:f,type:G(E)});const g=p!=null?h(T=>$(T,p)):void 0,U=()=>{const T=Z(t.state?.pathnameStackToGoBack),u=T.poppedPathname??((D=2)=>{let I="../";for(let A=0;A<D;A++)I=`${I}../`;return I})(1);n(u,{state:{pathnameStackToGoBack:T.newStack}})};return{transactionId:p,onSaveVendor:()=>{o(Ae(p,void 0))},onSaveSuccess:()=>{if(g!=null&&g?.transaction&&g?.transactionDetailLocalData.vendorUpdates?.qboId!=null&&g?.transactionDetailLocalData.vendorUpdates?.id!=null){const T=g?.transactionDetailLocalData.vendorUpdates,u={id:g?.transactionDetailLocalData.vendorUpdates?.qboId,zeniId:g?.transactionDetailLocalData.vendorUpdates?.id,type:"vendor",name:T?.name,qboId:g?.transactionDetailLocalData.vendorUpdates?.qboId??""},D={transactionId:{id:g?.transaction?.id,type:g?.transaction?.type},transaction:g?.transaction,lineIds:g?.transaction?.lines?.map(I=>I.id)??[]};o(Y({entity:u,amount:g?.transaction?.amount.amount,transactionDetails:D,flowType:"detail",isFetchCOT:i}))}U()},onCancel:()=>{p!=null&&o(sa({transactionId:p})),o(ke()),o(ia()),a(!0),U()}}},at=Ke(function(a,e){const s=$(a,e.selectedTransaction);let t;s==null&&console.warn("Check if the you've selected the transaction before getting the details");const n=we.getSignedInUser(),o=a.tenantState.currentTenantId,i={userId:n?.userId??"",sessionId:n?.zeniSessionId??"",tenantId:o??""};s!=null&&s.fetchState==="Completed"&&s.transaction!=null&&e.entity!=null&&(t=la(a,e.entity,"TransactionDetail"));const l=a.entityAutoCompleteState.autoCompleteText.common,m=da(a,"common"),f=J(a);return{transactionDetail:s,transactionAttachmentEndpointToDownload:`${K}/transaction_attachment`,transactionAttachmentsEndpointToFetch:f.externalConnections?.accounting[0]?.connectionName==="netsuite"?`${K}/transaction_attachments_accounting_provider`:`${K}/transaction_attachments`,attachmentUploadEndpoint:`${za.accountMicroServiceBaseUrl}`,isCOTEnabled:e.isCOTEnabled,authParams:i,trendReport:t,analytics:Ue,uncategorizedAccounts:e.uncategorizedAccounts,autoCompleteData:{autoCompleteText:l,entityAutoCompleteView:m},isVendorBulkUpdateOnTransactionEnabled:e.isVendorBulkUpdateOnTransactionEnabled,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled,enableBackClickOnSave:e.location.state?.message?.startsWith("comingFromScheduleDetails")}},function(a,e){const{isCOTEnabled:s}=e;return{onBackClick:()=>{if(a(M("common")),e.onBackClick!=null)return void e.onBackClick();const t=Z(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Be(2);e.navigate(n,{state:{pathnameStackToGoBack:t.newStack,message:"comingFromTransactionDetail"}})},discardTransactionDetailLocalData:(t,n)=>{e.transaction!=null&&a(wa({transactionId:{id:e.transaction.id,type:e.transaction.type},vendorId:t,customerId:n}))},onTransactionClick:t=>{e.resetTrendIsFetchedStates(),a(te()),a(ne());const n=ee(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(Le(t,e.tenantEmailDomain),{state:{pathnameStackToGoBack:n}})},onTrendSelectedPeriodChange:t=>{if(t==null)e.defaultTrendTransactionTimePeriod!=null&&a(pe(e.entity,"TransactionDetail",{timeframe:"month",timePeriod:e.defaultTrendTransactionTimePeriod}));else{const n=t.currentTimePeriod==null?t.addTimePeriod:{startDate:t.addTimePeriod.startDate,endDate:t.currentTimePeriod.endDate};a(oe(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:t.addTimePeriod})),a(pe(e.entity,"TransactionDetail",{timeframe:t.timeframe,timePeriod:n}))}},onSaveUpdates:(t,n,o,i)=>{a(i===!0&&o!=null?Ae(t,o,!0,e.isExpenseAutomationEnabled,e.isUncategorizedExpenseCategoryEnabled):xa({transactionId:t,isExpenseAutomationEnabled:e.isExpenseAutomationEnabled,cotTransactionTracking:n,isUncategorizedExpenseCategoryEnabled:e.isUncategorizedExpenseCategoryEnabled})),a(M("common"))},onUploadAttachmentAttachment:t=>{a(Aa(t))},onDeleteAttachment:t=>{e.transaction!=null&&a(ka(t,{id:e.transaction.id,type:e.transaction.type}))},onSaveTransactionDetailLocalData:(t,n)=>{a(Da({transactionId:t,transactionLocalData:n}))},onUpdateAllChecked:(t,n,o,i)=>{e.transaction!=null&&a(Ca(e.selectedTransaction,e.transaction,t,n,o,i))},onResetLineItemsCategoryClassInLocalData:(t,n,o,i,l,m)=>{a(va(t,n,o,i,l,m))},onChangeCategoryClassWhenUpdateAllIsChecked:(t,n)=>{e.transaction!=null&&a(Ia({id:e.transaction.id,type:e.transaction.type},e.transaction,t,n))},onSaveSuccess:()=>{const t=Z(e.location.state?.pathnameStackToGoBack);if(t.poppedPathname!=null){const n=qa(t.poppedPathname,"/").split("/"),o=n[n.length-1];if(["uncategorized-income","uncategorized-expense","missing-receipts"].includes(o)&&e.navigate(t.poppedPathname,{state:{pathnameStackToGoBack:t.newStack}}),e.location.state?.message==="comingFromScheduleDetails"){const i=`${$a(e.tenantEmailDomain)}`;e.navigate(i)}else if(e.location.state?.message==="comingFromScheduleDetailsFixedAssets"){const i=`${Ha(e.tenantEmailDomain)}`;e.navigate(i)}}},onPageRefresh:()=>{a(xe(e.selectedTransaction,!0))},autoCompleteActions:{onAutoCompleteInputChange:(t,n)=>{t.trim().length>=2?a(Ea({searchString:t,entityType:n,searchOrigin:"common"})):t.trim().length===0&&a(M("common"))},onCancelAutoComplete:()=>{a(M("common"))}},onFetchRecommendationsForEntity:(t,n,o,i)=>{a(Y({entity:t,amount:n,transactionDetails:o,flowType:"detail",isFetchCOT:s}))},clearRecommendationForLineId:t=>{const{transactionId:n,transaction:o,lineId:i}=t;a(ba(n,o,i))},resetUpdateErrorState:()=>{const t={id:e.selectedTransaction.id,type:e.selectedTransaction.type};a(Ta(t))},onSaveVendorInLocalData:(t,n,o,i,l)=>{if(a(ya({transactionId:t,vendorUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(Y({entity:o,amount:i,transactionDetails:l,flowType:"detail",isFetchCOT:s})),a(De({vendorId:n.id?n.id:void 0,localData:{vendorName:n.name,vendorId:n.id?n.id:void 0}})),!n.id&&e.transaction!=null){const m=e.transaction,f=ee(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(`/${e.tenantEmailDomain}/transaction/${encodeURIComponent(m.type??"")}/${m.id}/vendor/create`,{state:{pathnameStackToGoBack:f}})}},onSaveCustomerInLocalData:(t,n,o,i,l)=>{a(Sa({transactionId:t,customerUpdates:n,entity:o})),n.id!=null&&o!=null&&i!=null&&l!=null&&a(Y({entity:o,amount:i,transactionDetails:l,flowType:"detail",isFetchCOT:s}))},onUpdateAllTranactionsWithCurrentVendorChecked:t=>{a(ga({transactionId:{id:e.selectedTransaction.id,type:e.selectedTransaction.type},isUpdateEnabled:t}))},onClickUpdateVendorToAllLineItems:(t,n,o)=>{a(ha(t,n,o))},onResetVendorToAllLineItems:(t,n,o)=>{a(fa(t,n,o))},saveLatestSelectedEntity:(t,n,o)=>{a(pa({transactionId:t,lineId:n,entity:o}))},updateVendorBulkRecommendationsFetchStatus:(t,n)=>{a(ma(t,n))},setIsVendorUpdateAllChecked:(t,n,o)=>{a(ua(t,n,o))},onCreateTransferEntry:e.isCreateTransferEntryFromExpenseEnabled===!0?t=>Ka(a,t):void 0}})(Ra);function ht(){const a=ge(),e=N(),s=he(),{useFeatureGate:t,useDynamicConfig:n}=H(),o=La(),i=h(d=>J(d)),l=i.userRole.includes("charge_card_user")||i.userRole.includes("charge_card_admin"),m=i.userRole!=null&&ye(i.userRole),f=i.userRole!=null&&Te(i.userRole),{isFeatureEnabled:E}=t(F.isVendorBulkUpdateOnTransactionEnabled),{isFeatureEnabled:p}=t(F.isExpenseAutomationEnabled),{configValue:g}=n(Fe.enableUncategorizedExpenseCategory),U=g?.uncategorized_expense_category_enabled===!0,{tenantEmailDomain:T,transactionTypeEncoded:u,transactionId:D}=Se(),[I,A]=r.useState(!1),b=Pe(u??""),k=_e(D,b),P=h(d=>d.transactionVendorViewState),_=se(),{isFeatureEnabled:B}=t(F.isTransactionCommentingEnabled),{isFeatureEnabled:j}=t(F.isCreateTransferEntryFromExpenseEnabled),{isFeatureEnabled:O}=t(F.isProjectsTransactionsEnabled),L=o?.currentTenant?.companyId,v=o?.currentTenant?.companyName,S=r.useMemo(()=>{if(k)return{id:D,type:G(b)}},[k,D,b]),c=S!=null?h(d=>$(d,S)):void 0,V=c?.transactionDetailLocalData.vendorUpdates?.id!=null?P.editVendorStateById[c?.transactionDetailLocalData.vendorUpdates.id]?.saveStatus.fetchState:"Not-Started",C=c?.fetchState==="Completed"?Ve(c?.transaction):void 0,x=h(d=>C!=null?be(d.customerIncomeState,d.vendorExpenseState,d.trendState,C,"month"):void 0),R=h(d=>ae(d)),q=h(d=>C!=null?Ee(d.trendWithTransactionsState,C,"TransactionDetail"):void 0),y=i.company?.companyInfo.firstMonthOfFY??1,W=h(d=>Ie(d.accountState,d.accountListState,"accountList")),[Oe,ie]=r.useState(!1),[Re,re]=r.useState(!1),[ze,ce]=r.useState(!1),Me=r.useCallback(d=>Le(d,T??"")+s.search,[T,s.search]),Ne=r.useCallback(()=>{ce(!1)},[]);Za({currentTransactionId:S,enabled:T!=null&&T!=="",buildPath:Me,beforeNavigate:Ne,navigate:a,navigateState:s.state});const le=()=>{ie(!1),re(!1)},de=Va();Wa();const Q=r.useRef(c?.transaction);Q.current=c?.transaction;const je=c?.transactionDetailUpdateStatus?.fetchState,z=Ya(je,()=>{const d=[];if(Q.current!=null)for(const X of Q.current.lines??[])"account"in X&&X.account?.accountId!=null&&d.push(X.account.accountId);return d});r.useEffect(()=>{S!=null&&c!=null&&c.fetchState==="Not-Started"&&(e(xe(S,!1)),le())},[e,S,c?.fetchState]),r.useEffect(()=>{if(S!=null&&c?.fetchState==="Error"){const d=ee(s.state?.pathnameStackToGoBack,s.pathname);a("page-not-found",{replace:!0,state:de?{pathnameStackToGoBack:d,message:"expenseAutomation",origin:"transaction_categorization"}:{pathnameStackToGoBack:d,message:"pageNotFound",origin:"transaction_detail"}})}},[S,c?.fetchState,a,s.state,s.pathname,de]),r.useEffect(()=>{ze||c==null||c.transaction==null||(e(ve({id:c.transaction.id,type:c.transaction.type})),ce(!0)),C==null&&c?.fetchState==="Completed"&&fe(c?.transaction),C!=null&&(!l||m&&f===!1)&&(Oe?Re||x==null||(re(!0),e(oe(C,"TransactionDetail",{timeframe:"month",timePeriod:q?.selectedPeriod?.timePeriod??x}))):(e(te()),e(ne()),fe(c?.transaction),ie(!0),e(Ce(C))))},[c?.fetchState,c?.transaction,x,l]),r.useEffect(()=>{R.newVendorState?.vendorDetailLocalData?.vendorName!=null?A(!0):A(!1)},[R.newVendorState?.vendorDetailLocalData?.vendorName]),r.useEffect(()=>()=>{e(M("common"))},[]);const Ge=[u,D].filter(d=>d!=null),{transactionId:ue,onSaveVendor:$e,onSaveSuccess:He,onCancel:qe}=et({closeDrawerHandler:d=>{A(!1),a(d?"../":"../..")}}),{isAiCfoAccessEnabled:We,onAskAiCfoClick:Ye}=Ga({mobileExploreReferrer:"Transaction Details"});return Ba({isDataReady:c?.fetchState==="Completed"}),k?w.jsxs(w.Fragment,{children:[ue!=null&&I&&w.jsx(Qa,{isOpen:I,transactionId:ue,onSaveVendor:$e,onSaveSuccess:He,onCancel:qe}),w.jsx(at,{hideDeleteAttachment:!0,firstMonthOfFY:y,isDisabled:c?.transaction?.type==="transfer"&&o?.connectionName==="netsuite"?"readonly":void 0,tenantEmailDomain:T,location:s,navigate:a,selectedTransaction:S,entity:C,isCOTEnabled:_,defaultTrendTransactionTimePeriod:x,resetTrendIsFetchedStates:le,transaction:c?.transaction,uncategorizedAccounts:W,vendorSaveStatus:V,isVendorBulkUpdateOnTransactionEnabled:E,isCreateTransferEntryFromExpenseEnabled:j,isExpenseAutomationEnabled:p,isUncategorizedExpenseCategoryEnabled:U,isAiCfoAccessEnabled:We,onAskAiCfoClick:Ye,isTransactionCommentingEnabled:B,isProjectsTransactionsEnabled:O,companyId:L,companyName:v}),z.showPopup&&z.popupType!=null&&w.jsx(Oa,{popupType:z.popupType,currencySymbol:z.currencySymbol,onSubmit:z.handleSubmit,onDismiss:z.handleDismiss})]}):w.jsx(Xe,{to:Be(Ge.length)})}const Be=(a=2)=>{let e="../";for(let s=0;s<a;s++)e=`${e}../`;return e},fe=a=>{if(a!=null){const{transactionCategory:e,transactionClass:s}=tt(a),t=nt(a);Ue.trackTransactionDetails(a.account?.accountId,a.account?.accountName,a.id,t,e.length>0?e:void 0,s.length>0?s:void 0,a.type,a.amount,a.memo,a.lines?.length??0,a.attachments?.map(n=>n.fileName))}},tt=a=>{const e=[],s=[];return a.lines?.forEach(t=>{switch(t.type){case"transaction_with_account_and_class_line":case"transaction_with_product_or_service_line":case"journal_entry_transaction_line":case"linked_transaction_line":{const n=t;n!=null&&n.account!=null&&n.account.accountName?.length>0&&e.push(n.account.accountName),n.class!=null&&n.class.className?.length>0&&s.push(n.class.className);break}}}),{transactionCategory:e,transactionClass:s}},nt=a=>ra(a)===!0?a.customer?.name??"":ca(a)===!0?a.vendor?.name??"":a.memo!=null?a.memo:a.type;export{Qa as C,ht as T,Wa as a,Ya as b,et as c,at as d,Za as e,se as f,Ka as g,ft as u};
@@ -0,0 +1 @@
1
+ import{j as s}from"./liveblocks-CfHMBm08.js";import{h as K,g as H,u as W,i as Z,j as h,N as G,n as Q,o as Ye,p as j}from"./core-DvGkVhX0.js";import{eR as U,p_ as X,j5 as u,Py as ee,I1 as De,bo as le,Pz as ve,jI as te,LC as ae,PA as ue,PB as be,bE as P,HZ as ye,PC as Ee,PD as me,PE as je,I0 as Ae,PF as xe,PG as pe,PH as Me,PI as ge,PJ as Le,PK as Ce,PL as fe,Je as Be}from"./zeni-epic-state-D_HFZhXl.js";import{D as de,a as ne,G as q,e as w,ce,s as J,r as oe,W as Fe,d as Oe}from"./index-ChP5wU0r.js";import"./mui-D2FQmczV.js";import{a as g}from"./sentry-0vIaNqsr.js";import{w as se}from"./withTransactionSidePanel-rHr5DjOB.js";import{p as ie,c as re}from"./routePaths-CL9hJjr9.js";import{u as ze}from"./utils-DF5mLbko.js";import{d as v}from"./decodeURIComponentSafe-D3G61A3x.js";import{Z as we}from"./ZeniAccountStatementScreen-CO_1LwB4.js";import"./recharts-CnIvro2v.js";import"./analytics-CStLmwuB.js";import"./plaid-DzUK2ot_.js";import"./dnd-DVf98RdY.js";import"./stripe-DMRn4zHo.js";import"./lottie-Byecfo2L.js";import"./lexical-BStGoUxq.js";import"./pdf-CojJ326Z.js";import"./useAskAiCfoHostNavButtonProps-RTOhQENK.js";import"./TransactionDetailScreen-Nhb9Cdoj.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]="cb8d9a0f-d706-4eef-a8df-d5566befc699",a._sentryDebugIdIdentifier="sentry-dbid-cb8d9a0f-d706-4eef-a8df-d5566befc699")}catch{}})();const Ge=["uncategorized-income","uncategorized-expense","miscategorized-income","miscategorized-expense","missing-receipts"],N=a=>ze(a),Re=Q(function(a,e){const t=ve(a.transactionState,a.transactionListState,e.selectedAccount.period,e.selectedAccount.timeframe,N(e.selectedAccount.tranListType));return{title:e.selectedAccount.title,subTitle:e.selectedAccount.subTitle,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:e.dataAvailableForPeriod,report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??"../../";e.navigate(n,{state:{pathnameStackToGoBack:t.newStack}})},onTimePeriodChange:(t,n,c)=>{e.closeSidePanel?.();const o=de.getLocalizedStrings(),l=N(e.selectedAccount.tranListType),m=Ve(t,n,c,l,e.bookCloseDate);w.trackTransactionList(void 0,void 0,void 0,e.selectedAccount.title,void 0,!0),a(ue({uiState:{dateRange:m},type:N(e.selectedAccount.tranListType)})),a(De(l,u(m),!1,l==="missingReceipts"?o.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0)),e.onSelectedTimePeriodChange(u(m))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(ue({uiState:{scrollYOffset:t},type:N(e.selectedAccount.tranListType)}))}}})(ce),V=se(function({...a}){const e=K(),t=H(),n=W(),c=t.pathname.split("/").find(r=>Ge.includes(r)),o=c??"uncategorized-expense",{tenantEmailDomain:l}=Z(),m=de.getLocalizedStrings(),{accountType:I,title:T,subTitle:D}=_e(o),y="month",S=h(r=>U(r)),p=S.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:A}=ne(),{isFeatureEnabled:k}=A(q.isProjectsTransactionsEnabled),x=h(r=>X(r))&&k,{dataAvailable:C,initialTimeframeTick:b}=$e(o,p,S.bookCloseDate),[B,E]=g.useState(!1),[F,O]=g.useState(void 0),f=g.useMemo(()=>{const r=u(b);return{tranListType:o,accountType:ee(I),title:T,subTitle:D,timeframe:y,period:r}},[o,y,I,C]);g.useEffect(()=>{if(!B&&f!=null){E(!0),w.trackTransactionList(void 0,void 0,void 0,f.title);const r=N(f.tranListType);n(De(r,f.period,!0,r==="missingReceipts"?m.uncategorizedTransactionList.missingReceipt.missingReceiptMinAmount:void 0))}},[B,f,n]);let M=f;return f!=null&&F!=null&&(M={...f,period:F}),c==null||M==null?s.jsx(G,{to:"../"}):s.jsx(Re,{firstMonthOfFY:p,tenantEmailDomain:l,location:t,useFixedPeriod:{timeframe:"month",numberOfPeriods:12},dataAvailableForPeriod:C,navigate:e,showProjectField:x,selectedAccount:M,referrerType:o,bookCloseDate:S.bookCloseDate,onSelectedTimePeriodChange:r=>O(r),...a})}),_e=a=>{let e="",t="";const n=de.getLocalizedStrings();switch(a){case"uncategorized-income":e="income",t=n.uncategorizedTransactionList.income.title;break;case"uncategorized-expense":e="expenses",t=n.uncategorizedTransactionList.expense.title;break;case"miscategorized-expense":e="expenses",t=n.miscategorizedTransactionList.expense.title;break;case"miscategorized-income":e="income",t=n.miscategorizedTransactionList.income.title;break;case"missing-receipts":t=n.uncategorizedTransactionList.missingReceipt.title}return{accountType:e,title:t,subTitle:""}},$e=(a,e,t)=>{const n=le();let c=le().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:ie(5,e),initialTimeframeTick:{startDate:c,endDate:n}}},Ve=(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},Ne=Q(function(a,e){const t=Ee(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:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??he();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)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{dateRange:o}})),a(ye(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.classId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(me({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,classId:e.selectedAccount.classId,uiState:{scrollYOffset:t}}))}}})(ce),qe=se(function({referrerType:a,...e}){const t=K(),n=H(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,classIdEncoded:I,timeframe:T,startDate:D,endDate:y,titleEncoded:S}=Z(),p=v(l??""),A=v(m??""),k=v(I??""),x=v(S??""),C=h(d=>be(d.transactionListState,A,p,k)),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>U(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=h(d=>X(d))&&r;let i;const z=Je(p,A,k,T,D,y,x);if(z){const d={startDate:P(D,"YYYY-MM-DD"),endDate:P(y,"YYYY-MM-DD")},_=He(C?.dateRange,d);i={accountId:A,accountType:ee(p),classId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{b||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(ye(i.accountId,i.accountType,i.classId,i.period)))},[b,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,I,T,D,y,S].filter(d=>d!=null);return z&&L!=null?s.jsx(Ne,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:he($.length)})}),he=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Je=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&P(c,"YYYY-MM-DD").isValid()&&P(o,"YYYY-MM-DD").isValid()&&l!=null,He=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Ue=Q(function(a,e){const t=xe(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,e.selectedAccount.timeframe,e.selectedAccount.period);return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Ie();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)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{dateRange:o}})),a(Ae(e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.projectId,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(pe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,projectId:e.selectedAccount.projectId,uiState:{scrollYOffset:t}}))}}})(ce),Ke=se(function({referrerType:a,...e}){const t=K(),n=H(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,projectIdEncoded:I,timeframe:T,startDate:D,endDate:y,titleEncoded:S}=Z(),p=v(l??""),A=v(m??""),k=v(I??""),x=v(S??""),C=h(d=>je(d.transactionListState,A,p,k)),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(d=>U(d)),f=O.company?.companyInfo.firstMonthOfFY??1,{useFeatureGate:M}=ne(),{isFeatureEnabled:r}=M(q.isProjectsTransactionsEnabled),R=h(d=>X(d))&&r;let i;const z=We(p,A,k,T,D,y,x);if(z){const d={startDate:P(D,"YYYY-MM-DD"),endDate:P(y,"YYYY-MM-DD")},_=Ze(C?.dateRange,d);i={accountId:A,accountType:ee(p),projectId:k,title:x,timeframe:T,period:_}}g.useEffect(()=>{b||i==null||(B(!0),w.trackTransactionList(i.accountId,void 0,a,i.title),c(Ae(i.accountId,i.accountType,i.projectId,i.period)))},[b,i,c]);let L=i;i!=null&&E!=null&&(L={...i,period:E});const $=[l,m,I,T,D,y,S].filter(d=>d!=null);return z&&L!=null?s.jsx(Ue,{firstMonthOfFY:f,tenantEmailDomain:o,location:n,navigate:t,showProjectField:R,selectedAccount:L,referrerType:a,onSelectedTimePeriodChange:d=>F(d),...e}):s.jsx(G,{to:Ie($.length)})}),Ie=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},We=(a,e,t,n,c,o,l)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&o!=null&&(n==="month"||n==="quarter")&&P(c,"YYYY-MM-DD").isValid()&&P(o,"YYYY-MM-DD").isValid()&&l!=null,Ze=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),Qe=Q(function(a,e){const t=Le(a.transactionState,a.transactionListState,e.selectedAccount.accountId,e.selectedAccount.accountType,e.selectedAccount.timeframe,e.selectedAccount.period),n=t.account?.coaId,c=e.isConnectedAccountProviderUnit&&Ce(n??"");return{accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,title:e.selectedAccount.title,timeframe:e.selectedAccount.timeframe,timePeriod:ae(e.selectedAccount.period),dataAvailableForPeriod:ie(5,e.firstMonthOfFY),report:t,currentScrollYOffset:t.uiState?.scrollYOffset??0,showStatementPageIcon:c,isAccountingClassesEnabled:te(a)}},function(a,e){return{onBackClick:()=>{const t=oe(e.location.state?.pathnameStackToGoBack),n=t.poppedPathname??Se();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)}`),w.trackTransactionList(e.selectedAccount.accountId,void 0,e.referrerType,e.selectedAccount.title,void 0,!0),a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{dateRange:o}})),a(ge(e.selectedAccount.accountId,e.selectedAccount.accountType,u(o))),e.onSelectedTimePeriodChange(u(o))},onTransactionItemClick:t=>{if(e.openTransactionPanel)return void e.openTransactionPanel(t.id,t.type);const n=re(t,e.tenantEmailDomain),c=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(n,{state:{pathnameStackToGoBack:c}})},onTransactionListScroll:t=>{a(fe({accountId:e.selectedAccount.accountId,accountType:e.selectedAccount.accountType,uiState:{scrollYOffset:t}}))},onStatementPageIconClick:()=>{const t=tt(e.tenantEmailDomain),n=J(e.location.state?.pathnameStackToGoBack,e.location.pathname);e.navigate(t,{state:{pathnameStackToGoBack:n}})}}})(ce),Te=se(function({referrerType:a,...e}){const t=K(),n=H(),c=W(),{tenantEmailDomain:o,accountTypeEncoded:l,accountIdEncoded:m,timeframe:I,startDate:T,endDate:D,titleEncoded:y,excludeSubAccounts:S}=Z(),p=v(l??""),A=v(m??""),k=v(y??""),x=!(S!=null&&S==="exclude_subaccounts"),C=h(Y=>Me(Y.transactionListState,A,p)),[b,B]=g.useState(!1),[E,F]=g.useState(void 0),O=h(Y=>U(Y)),f=O.company?.featuresActivationInfo.connectedAccountProvider==="unit",M=O.company?.companyInfo.firstMonthOfFY??1;let r;const R=Xe(p,A,I,T,D,k);if(R){const Y={startDate:P(T,"YYYY-MM-DD"),endDate:P(D,"YYYY-MM-DD")},Pe=et(C?.dateRange,Y);r={accountId:A,accountType:ee(p),title:k,timeframe:I,period:Pe}}let i=r;r!=null&&E!=null&&(i={...r,period:E});const{useFeatureGate:z}=ne(),{isFeatureEnabled:L}=z(q.isTransactionCommentingEnabled),{isFeatureEnabled:$}=z(q.isProjectsTransactionsEnabled),d=h(Y=>X(Y))&&$,{areTenantIdsInSync:_}=Fe();g.useEffect(()=>{!b&&r!=null&&_&&(B(!0),w.trackTransactionList(r.accountId,void 0,a,r.title),c(ge(r.accountId,r.accountType,r.period,void 0,!1,x)))},[b,r,c,_]);const ke=[l,m,I,T,D,y].filter(Y=>Y!=null);return R&&i!=null?s.jsx(Qe,{firstMonthOfFY:M,tenantEmailDomain:o,location:n,navigate:t,isConnectedAccountProviderUnit:f,isTransactionCommentingEnabled:L,showProjectField:d,selectedAccount:i,referrerType:a,onSelectedTimePeriodChange:Y=>F(Y),...e}):s.jsx(G,{to:Se(ke.length)})}),Se=(a=7)=>{let e="../";for(let t=0;t<a;t++)e=`${e}../`;return e},Xe=(a,e,t,n,c,o)=>a!=null&&e!=null&&t!=null&&n!=null&&c!=null&&(t==="month"||t==="quarter")&&P(n,"YYYY-MM-DD").isValid()&&P(c,"YYYY-MM-DD").isValid()&&o!=null,et=(a,e)=>a!=null&&a.endDate.isSame(e.endDate,"day")&&a.startDate.isBefore(e.startDate,"day")?u(a):u(e),tt=a=>`/${a}/transactions/${Be}/statements`;function kt(){const a=H().state?.referrer,e=h(n=>n.expenseAutomationViewState.selectedPeriodByTenantId)[h(n=>U(n)).tenantId],t=Oe();return s.jsxs(Ye,{children:[s.jsx(j,{path:"/:accountTypeEncoded/:accountIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/:excludeSubAccounts/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/zeni-clearing-account/statements",element:s.jsx(we,{})}),s.jsx(j,{path:"/*",element:s.jsx(Te,{referrerType:a})}),s.jsx(j,{path:"/uncategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/uncategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-income/*",element:s.jsx(V,{})}),s.jsx(j,{path:"/miscategorized-expense/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/transaction_categorization/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/missing-receipts/*",element:t?s.jsx(G,{to:`../../month_end_close_checks/review/missing_receipts/${e.month}-${e.year}`}):s.jsx(V,{})}),s.jsx(j,{path:"/by-class/:accountTypeEncoded/:accountIdEncoded/:classIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(qe,{referrerType:a})}),s.jsx(j,{path:"/by-project/:accountTypeEncoded/:accountIdEncoded/:projectIdEncoded/:timeframe/:startDate/:endDate/:titleEncoded/*",element:s.jsx(Ke,{referrerType:a})})]})}export{kt as default};
@@ -0,0 +1,37 @@
1
+ import{j as e}from"./liveblocks-CfHMBm08.js";import{h as B,g as P,u as U,i as M,j as f,N as L,n as V,o as we,p as k}from"./core-DvGkVhX0.js";import{cl as N,eR as D,Oj as O,En as ae,fj as H,E5 as ne,Ol as Te,Eq as Ie,Oh as Ce,Oi as se,OB as ke,Cx as je,tc as Ee,On as be,EJ as Ae,Ok as re,cN as W,xs as oe,e_ as ve,f0 as De,Pv as Fe,Pw as Le,E6 as Be,Px as Pe,E7 as Ue,Eg as Oe,bs as Re,bF as Me,cw as Ve,bG as Ne,ck as _e,fi as ze,bt as Ge,J_ as $e,cj as qe}from"./zeni-epic-state-D_HFZhXl.js";import{k as _,aq as He,z as b,y as z,e as j,c7 as We,c8 as Je,c9 as q,J,m as Ze,W as Ke,_ as Qe,a as ie,G as v,E as Xe,B as Ye,ca as et,at as Z,s as tt,cb as at,r as K,cc as nt,n as X,cd as st,a9 as rt}from"./index-ChP5wU0r.js";import{D as ot,n as R,S as it}from"./mui-D2FQmczV.js";import ct from"./NotFoundScreen-BNcKpH4N.js";import{S as Y}from"./SetupPagesScreen-DVYIUml2.js";import{a as d}from"./sentry-0vIaNqsr.js";import{u as lt}from"./useAskAiCfoHostNavButtonProps-RTOhQENK.js";import{u as ut}from"./useInitialThreadRequest-CLh-E-cE.js";import{M as ce}from"./MobileAppDrawer-w7Ih7RbS.js";import{F as dt}from"./FeaturePreviewScreen-wzurtqwt.js";import{a as ee}from"./analyticsHelper-DLbyZBKc.js";import"./recharts-CnIvro2v.js";import"./analytics-CStLmwuB.js";import"./plaid-DzUK2ot_.js";import"./dnd-DVf98RdY.js";import"./stripe-DMRn4zHo.js";import"./lottie-Byecfo2L.js";import"./lexical-BStGoUxq.js";import"./pdf-CojJ326Z.js";import"./utils-DF5mLbko.js";import"./routePaths-CL9hJjr9.js";import"./BusinessVerificationPageScreen-CpGRtjnS.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]="30108cda-34a7-4b36-b6ea-050de8f689ea",t._sentryDebugIdIdentifier="sentry-dbid-30108cda-34a7-4b36-b6ea-050de8f689ea")}catch{}})();const pt=V(function(t,a){const{companyId:n}=a;return{treasurySetupView:O(t,n),analytics:j}},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(Ie(!0))},onUpdateFundAllocation:r=>{o.trackTreasuryAllocationAction("update",ee(r)),t(Te(r))}}})(We);function mt(){const t=B(),a=P(),n=U(),{tenantEmailDomain:o}=M(),p=_(),r=f(C=>C.treasurySetupViewState.portfolioAllocationUpdateStatus?.fetchState),m=He(r),s=N(p?.loggedInUserRoleMap),[l,i]=d.useState(!1),[g,I]=d.useState(!1),[u,c]=d.useState(!1),h=f(C=>D(C)),y=b.getSignedInUserTenant(o)?.companyId??h.companyId,w=b.getSignedInUser(),S=f(C=>O(C,y)),T=f(C=>C.treasurySetupViewState.fetchState),x=f(C=>C.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),F=f(C=>C.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState);if(w==null)throw Error("Can't access treasury portfolio allocation page without signing in...");if(d.useEffect(()=>{l||T!=="Not-Started"||y==null||(i(!0),n(ae(y,!0,!1)))},[l,T,y,n]),d.useEffect(()=>{u||F!=="Not-Started"||y==null||(c(!0),n(H()))},[u,F,y,n]),d.useEffect(()=>{g||x!=="Not-Started"||y==null||(I(!0),n(ne()))},[g,x,y,n]),d.useEffect(()=>{m==="In-Progress"&&r==="Completed"&&t("../")},[m,r,t]),h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted===!1)return e.jsx(L,{to:"../promo"});const A=h.companyTreasuryInfo?.info?.isTreasuryTOSAccepted!==!0||T!=="Completed";return e.jsxs(e.Fragment,{children:[!A&&e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(pt,{navigate:t,location:a,companyId:y,isEditMode:!0,isLoading:A,isReadOnly:!s,treasurySetupView:S,analytics:j})]})}const ft=V(function(t,a){const n=a.currentTenant?.companyId;return{plaidConnectionDetails:ke(t,n,"zeni_treasury","treasury_setup").plaidConnectionDetails,treasurySetupView:O(t,n)}},function(t,a){const{navigate:n,transferDetails:o,treasurySetupView:p}=a,r=o.treasuryTransferMoneyLocalData,m=p.fundAllocationLocalData;return{onCancelClick:()=>{q(a.analytics,"cancel",r,m,"Transfer"),t(se()),n("../")},onTransferClick:()=>{q(a.analytics,"confirm",r,m,"Transfer"),t(Ae())},onSaveChangesToLocalStore:s=>{t(be(s))},onFetchLinkTokenClick:s=>{t(Ee("treasury_setup",s))},onEstablishConnectionClick:s=>{t(je(s,a.currentTenant?.companyId,"treasury_setup","zeni_treasury"))}}})(Je),yt=({isFirstTransfer:t})=>{const a=B(),{tenantEmailDomain:n}=M(),o=U(),[p,r]=d.useState(!1),[m,s]=d.useState(!1),[l,i]=d.useState(!1),[g,I]=d.useState(!1),u=f(x=>x.treasurySetupViewState.fetchState),c=f(x=>x.treasurySetupViewState.treasuryFundsDetails?.fetchStatus?.fetchState),h=f(x=>x.treasurySetupViewState.currentAllocation.fetchStatus?.fetchState),y=f(x=>D(x)),w=b.getSignedInUserTenant(n)?.companyId??y.companyId,S=f(x=>Ce(x)),T=f(x=>O(x,w));if(b.getSignedInUser()==null)throw Error("Can't access treasury transfer page without signing in...");return d.useEffect(()=>{m||u!=="Not-Started"||w==null||(s(!0),o(ae(w,!0,!1)))},[m,u,w,o]),d.useEffect(()=>{l||c!=="Not-Started"||w==null||(i(!0),o(H()))},[l,c,w,o]),d.useEffect(()=>{g||h!=="Not-Started"||w==null||(I(!0),o(ne()))},[g,h,w,o]),e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:()=>{}}),e.jsx(ft,{analytics:j,navigate:a,transferDetails:S,onAnotherTransferClick:()=>{r(!1),o(se())},currentTenant:y,treasurySetupView:T,showReviewContent:p,maxInsuredAmount:5e5,onReviewClick:()=>{q(j,"review",S.treasuryTransferMoneyLocalData,T.fundAllocationLocalData,"Transfer"),r(!0)},isFirstTransfer:t,setShowReviewContent:r,onBackClick:()=>{}})]})},gt=R.div`
2
+ display: flex;
3
+ min-height: 100%;
4
+ width: 100%;
5
+ flex: 1 1 auto;
6
+ flex-direction: column;
7
+ align-items: center;
8
+ background-color: ${t=>t.theme.colors.grey4};
9
+ `,ht={overlayWidth:new Xe(100,100,48)},St=V(function(t,a){const n=re(t),{companyId:o}=a;return{treasuryDetail:n,treasurySetupView:O(t,o),downloadEndPoint:`${Z.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:l=>{let i="page-not-found";l==="editPortfolio"?i=xt(s):l==="statements"?i=wt(s):l==="taxLetter"?i=Tt(s):l==="settings"&&(i=It(s));const g=tt(p.state?.pathnameStackToGoBack,p.pathname);n(i,{state:{pathnameStackToGoBack:g}})},onColumnSortConfigChanged:(l,i)=>{t(Fe({uiState:{sortKey:l,sortOrder:i}}))},onTransferClick:()=>{n("./transfer")},onBackClick:()=>{n("../../")},onClickMenuIcon:()=>{r(!0)},onAutoTransferClick:()=>{n("../../checking/auto-transfer")}}})(et);function $({isTransferDrawerOpen:t,isEditPortfolioDrawerOpen:a}){const n=P(),o=B(),p=U(),r=J(),m=Ze(),s=f(E=>D(E)),{tenantEmailDomain:l}=M(),i=s.companyId??b.getSignedInUserTenant(l)?.companyId,[g,I]=d.useState(!1),u=f(E=>re(E)),c=u.fetchState,h=u.accountSummary?.totalBalance?.amount,y=f(E=>E.treasurySetupViewState.treasuryFundsDetails?.fetchStatus),w=s.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified",S=_(),T=!!s.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,x=N(S?.loggedInUserRoleMap),F=W(S?.loggedInUserRoleMap),{areTenantIdsInSync:A}=Ke();d.useEffect(()=>{c==="Not-Started"&&!g&&A&&(I(!0),p(oe(!0)))},[g,p,c,A]),d.useEffect(()=>{u.transactionsFetchState.fetchState==="Completed"&&u.transactions.length===0&&!n.pathname.includes("transfer")&&x&&o("./transfer")},[u.transactionsFetchState.fetchState,u.transactions.length]);const C=()=>{o("..")},[le,ue]=d.useState(!1),Q=E=>{ue(E)},{isAiCfoAccessEnabled:de,onAskAiCfoClick:pe}=lt({mobileExploreReferrer:"Treasury"});Qe({isDataReady:c==="Completed"});const{useFeatureGate:G}=ie(),{isFeatureEnabled:me}=G(v.isDebitCardFeatureEnabled),{isFeatureEnabled:fe}=G(v.isAutoTransferRuleEnabled),{isFeatureEnabled:ye}=G(v.isTreasuryCommentingEnabled),ge=ut(i,{clearParams:c==="Completed"&&y?.fetchState==="Completed"}),he=ve(s),Se=De(me,s);if(he===!0&&Se!==!0)return e.jsx(dt,{});if(w){const E=y?.fetchState!=="Completed"||u.accountSummaryFetchState.fetchState!=="Completed";return e.jsxs(e.Fragment,{children:[u.accountSummaryFetchState.fetchState==="Completed"&&y?.fetchState==="Completed"&&t===!1&&a===!1?e.jsx(z,{analytics:j,onLoad:()=>{}}):null,e.jsx(ot,{onClose:C,anchor:"right",open:a||t,transitionDuration:250,PaperProps:{style:{width:ht.overlayWidth.valuePercentage(r),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:m.colors.black,opacity:.75,cursor:"pointer"}}},children:e.jsxs(Ct,{onClick:xe=>xe.stopPropagation(),children:[t===!0?e.jsx(yt,{isFirstTransfer:u.transactions.length===0||h===0}):null,a===!0?e.jsx(mt,{}):null]})}),e.jsxs(gt,{windowSize:r,children:[e.jsx(ce,{isAppContentDrawerOpen:le,handleDrawerToggle:Q}),e.jsx(St,{treasuryDetailsView:u,isAutoTransferRuleEnabled:fe,navigate:o,currentTenant:s,location:n,companyId:i,analytics:j,isTreasuryCommentingEnabled:ye,handleDrawerToggle:Q,initialOpenThreadRequest:ge,isLoading:E,isAiCfoAccessEnabled:de,onAskAiCfoClick:pe})]})]})}return T&&x?e.jsx(L,{to:"../setup"}):s.companyTreasuryInfo?.info&&!T&&F?e.jsx(L,{to:"../promo",state:n.state}):e.jsx(Ye,{fetchState:"In-Progress",style:{backgroundColor:m.colors.grey5}})}const xt=t=>`/${t}/treasury/edit-portfolio`,wt=t=>`/${t}/treasury/statements`,Tt=t=>`/${t}/treasury/tax-letter`,It=t=>`/${t}/treasury/setup`,Ct=R(it)`
10
+ display: flex;
11
+ min-height: 100%;
12
+ flex-direction: column;
13
+ `,kt=R.div`
14
+ display: flex;
15
+ height: 100vh;
16
+ width: 100%;
17
+ flex: 1 1 auto;
18
+ flex-direction: column;
19
+ align-items: center;
20
+ background-color: ${t=>t.theme.colors.grey4};
21
+ `;function jt(){const t=B(),a=U(),n=J(),o=P(),p=`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Le(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),a(Be(!1)))},[r,s.fetchState,a]);const l=b.getSignedInUser(),i=f(c=>D(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access statements page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(kt,{windowSize:n,children:e.jsx(at,{currentTenantCompanyName:I,statementListView:s,isLoading:u,onBackClick:()=>{const c=K(o.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const Et=R.div`
22
+ display: flex;
23
+ height: 100vh;
24
+ width: 100%;
25
+ flex: 1 1 auto;
26
+ flex-direction: column;
27
+ align-items: center;
28
+ background-color: ${t=>t.theme.colors.grey4};
29
+ `;function bt(){const t=B(),a=J(),n=P(),o=U(),p=`${Z.bankingMicroServiceBaseUrl}/1.0/treasury-account`,[r,m]=d.useState(!1),s=f(c=>Pe(c));d.useEffect(()=>{r||s.fetchState!=="Not-Started"||(m(!0),o(Ue(!1)))},[r,s.fetchState,o]);const l=b.getSignedInUser(),i=f(c=>D(c)),g={userId:l?.userId??"",sessionId:l?.zeniSessionId??"",tenantId:i.tenantId??""},I=i.company?.companyInfo.companyLegalName??i.companyName;if(l==null)throw Error("Can't access tax letter page without signing in...");const u=s.fetchState!=="Completed";return e.jsx(Et,{windowSize:a,children:e.jsx(nt,{currentTenantCompanyName:I,taxLetterListView:s,isLoading:u,onBackClick:()=>{const c=K(n.state?.pathnameStackToGoBack),h=c.poppedPathname??"..";t(h,{state:{pathnameStackToGoBack:c.newStack}})},authParams:g,downloadEndPoint:p})})}const At=V(function(t,a){const{companyId:n}=a,o=O(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"})}}})(st),vt=()=>{const t=B(),a=P(),n=U(),{tenantEmailDomain:o}=M(),[p,r]=d.useState(!1),m=f(S=>D(S)),[s,l]=d.useState(!1),i=f(S=>S.treasurySetupViewState.treasuryFundsDetails?.fetchStatus);d.useEffect(()=>{s||i?.fetchState!=="Not-Started"||g==null||(l(!0),n(H()))},[i,n]);const g=b.getSignedInUserTenant(o)?.companyId??m.companyId,I=b.getSignedInUser(),u=!!m.companyTreasuryInfo?.info?.isTreasuryTOSAccepted,c=S=>{r(S)};if(I==null)throw Error("Can't access treasury promo page without signing in...");const h=_(),y=N(h?.loggedInUserRoleMap),w=W(h?.loggedInUserRoleMap);if(u&&y)return e.jsx(L,{to:"../../treasury/setup"});if(m.company?.companyTreasuryInfo&&(!u&&y||w)){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(X,{size:"ExtraLarge",start:!0})}):e.jsxs(e.Fragment,{children:[e.jsx(z,{analytics:j,onLoad:S=>(T=>T.trackTreasuryPromoView("Treasury Promo Page"))(S)}),e.jsx(ce,{isAppContentDrawerOpen:p,handleDrawerToggle:c}),e.jsx(At,{analytics:j,navigate:t,companyId:g,onClickMenuIcon:()=>{c(!0)}})]})}return e.jsx(te,{children:e.jsx(X,{size:"ExtraLarge",start:!0})})},te=R.div`
30
+ display: flex;
31
+ width: 100%;
32
+ height: 100%;
33
+ flex-direction: row;
34
+ justify-content: center;
35
+ align-items: center;
36
+ background-color: ${t=>t.theme.colors.grey5};
37
+ `;function ea(){const t=P(),a=f(A=>D(A)),{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),l=(a?.company==null||a.company.featuresActivationInfo?.isBillPayFeatureEnabled&&!s)&&Me(r?.loggedInUserRoleMap),i=Ve(r?.loggedInUserRoleMap),g=(a?.company==null||a.company.featuresActivationInfo?.isReimbursementFeatureEnabled&&!s)&&Ne(r?.loggedInUserRoleMap),{isFeatureEnabled:I}=n(v.isDepositAccountsFeatureEnabled),u=I&&!s&&_e(r?.loggedInUserRoleMap),c=a.company!=null&&ze(a.company),h=o&&c===!0&&!s&&N(r?.loggedInUserRoleMap),{isFeatureEnabled:y}=n(v.isChargeCardFeatureEnabled),{isFeatureEnabled:w}=n(v.isDebitCardFeatureEnabled),S=rt(a,y,w)&&!s&&Ge(r?.loggedInUserRoleMap),T=$e(r?.loggedInUserRoleMap),x=qe(r?.loggedInUserRoleMap),F=a.companyTreasuryInfo?.info?.businessVerificationStatus?.code==="verified";return e.jsxs(we,{children:[x?null:e.jsx(k,{path:"setup",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:T,isUserHasOnlyBillPayAccess:i,productType:"zeni_treasury",type:"setup"})}),x?null:e.jsx(k,{path:"verification",element:e.jsx(Y,{isBillPayAdminLevelAccess:l,isUserHasOnlyBillPayAccess:i,isReimbursementAdminLevelAccess:g,isZeniAccountAdminLevelAccess:u,isChargeCardAdminLevelAccess:S,isTreasuryAdminLevelAccess:h,isUserHasOnlyCardAccess:T,productType:"zeni_treasury",type:"verification"})}),e.jsx(k,{path:"promo",element:e.jsx(vt,{})}),e.jsx(k,{path:"statements",element:e.jsx(jt,{})}),e.jsx(k,{path:"tax-letter",element:e.jsx(bt,{})}),F?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"/",element:e.jsx($,{isTransferDrawerOpen:!1,isEditPortfolioDrawerOpen:!1})}),h?e.jsxs(e.Fragment,{children:[e.jsx(k,{path:"edit-portfolio",element:e.jsx($,{isEditPortfolioDrawerOpen:!0,isTransferDrawerOpen:!1})}),e.jsx(k,{path:"transfer",element:e.jsx($,{isTransferDrawerOpen:!0,isEditPortfolioDrawerOpen:!1})})]}):null,e.jsx(k,{path:"*",element:e.jsx(ct,{})})]}):p&&h?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{ea as default};