@zeniai/web-cockpit-ui 2.0.62-next → 2.0.62-prod
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/{CreditAgentRoutes-DF_JOjZH.js → CreditAgentRoutes-CHOmROOx.js} +1 -1
- package/dist/assets/{Preview-Ciq7dXYi-C6UHJ-dG.js → Preview-Ciq7dXYi-BIomkdVS.js} +1 -1
- package/dist/assets/{ScreenRoutes-xhS5KnwE.js → ScreenRoutes-B7wjlCly.js} +3 -3
- package/dist/assets/{SignInScreen-t_oI3_zX.js → SignInScreen-o-4PPERX.js} +1 -1
- package/dist/assets/{analytics-D0nfjXSz.js → analytics-BPGO8b57.js} +1 -1
- package/dist/assets/{analyticsHelper-BidapgRT.js → analyticsHelper-DKbII6U3.js} +1 -1
- package/dist/assets/{core-Jhwj2cWt.js → core-CAP-FD3g.js} +1 -1
- package/dist/assets/{dash.all.min-D0CkNF8g-0432FG2N.js → dash.all.min-D0CkNF8g-D9_yOFId.js} +1 -1
- package/dist/assets/{epic-CauFcFaa.js → epic-CzgzIV8O.js} +1 -1
- package/dist/assets/{index-CnaD4GI7.js → index-CUe3JVOn.js} +5 -5
- package/dist/assets/{index-C_rFPbpi-DsH_Uf7X.js → index-C_rFPbpi-BmvLnHwU.js} +1 -1
- package/dist/assets/{index-CsCrKvDl-C675kzjP.js → index-CsCrKvDl-c6qvDLig.js} +2 -2
- package/dist/assets/{lexical-CDqLTwdI.js → lexical-CJELSiUm.js} +1 -1
- package/dist/assets/{liveblocks-2qCiW-lz.js → liveblocks-gBcidJDD.js} +1 -1
- package/dist/assets/{lottie-DsFjtNAa.js → lottie-DBV1jHLR.js} +1 -1
- package/dist/assets/{mui-DK0XZjs0.js → mui-DXk9y9I2.js} +1 -1
- package/dist/assets/{react-3LeYKPCr-PCrhYwP8.js → react-3LeYKPCr-DQYxrxzx.js} +1 -1
- package/dist/assets/{react-6Tvfe2S2-AIR7GwlO.js → react-6Tvfe2S2-C3HExdIT.js} +1 -1
- package/dist/assets/{react-B2-P-PS--D8HoPiLp.js → react-B2-P-PS--jKLPCF39.js} +1 -1
- package/dist/assets/{react-CWXWcDMY-gRCgPi-n.js → react-CWXWcDMY-jdgkuHu3.js} +1 -1
- package/dist/assets/{react-CWt3gw2R-DR3R7x_6.js → react-CWt3gw2R-D9htCvfo.js} +1 -1
- package/dist/assets/{react-CytUn6Kg-eWmFZ2Rf.js → react-CytUn6Kg-3TKlgJbg.js} +1 -1
- package/dist/assets/{react-G6j-OGKl-BmOQta5r.js → react-G6j-OGKl-GY4UOU2R.js} +1 -1
- package/dist/assets/{react-kuaGVSkA-DCIamgmw.js → react-kuaGVSkA-CwkG8qcH.js} +3 -3
- package/dist/assets/{recharts-CDqLTwdI.js → recharts-CJELSiUm.js} +1 -1
- package/dist/assets/{sentry-Gbc14BJL.js → sentry-BwzxWoLh.js} +1 -1
- package/dist/assets/{utils-1Oo38JiV.js → utils-7tk2ftkc.js} +1 -1
- package/dist/assets/{zeni-epic-state-CvtUqjnz.js → zeni-epic-state-DAp72fC9.js} +3 -3
- package/dist/index.html +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{j as i}from"./liveblocks-
|
|
1
|
+
import{j as i}from"./liveblocks-gBcidJDD.js";import{z as w,$ as j,f as v,S as E,a0 as P,r as k,U as N,b as R,g as T,h as M,j as L,D as $}from"./index-CUe3JVOn.js";import{a as f}from"./sentry-BwzxWoLh.js";import{i as _,m as F,g as p,h as O,k as A,l as C,N as V}from"./core-CAP-FD3g.js";import{Ig as B,Ih as q,jM as Z,Ii as J,kg as G,kj as H,k3 as K,Ij as Q,Ik as W,kd as X,k9 as Y}from"./zeni-epic-state-DAp72fC9.js";import{n as ee}from"./mui-DXk9y9I2.js";import{P as te}from"./ScreenRoutes-B7wjlCly.js";import"./analytics-BPGO8b57.js";import"./utils-7tk2ftkc.js";import"./analyticsHelper-DKbII6U3.js";(function(){try{var a=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new a.Error().stack;t&&(a._sentryDebugIds=a._sentryDebugIds||{},a._sentryDebugIds[t]="147e1c96-92a9-4a84-9459-98ab6a6661fc",a._sentryDebugIdIdentifier="sentry-dbid-147e1c96-92a9-4a84-9459-98ab6a6661fc")}catch{}})();function ne(a,t){return{headerData:{allTabOptions:k,selectedTabOption:N("creditAgent")},creditAgentPageData:{macroData:{data:t.macroCombined.data,fetchState:t.macroCombined.fetchStatus.fetchState,updateState:t.macroCombined.updateStatus.fetchState},cardProfilesData:t.cardProfilesData}}}function ae(a,t){return{headerActions:{onTabChange:n=>{const u=M(n),r=T(n);R.trackCockpitTabClicked(r),t.navigate(`../../${u}`,{replace:!0})}},creditAgentPageActions:{onFetchMacro:()=>{a(Y())},onSaveMacro:n=>{a(X(n))},onResetSaveMacro:()=>{a(W())},onUIStateChange:n=>{a(Q(n))},cardProfilesActions:t.cardProfilesActions}}}const se=O(ne,ae)(P),oe=ee.div`
|
|
2
2
|
padding: ${E.sp5};
|
|
3
3
|
text-align: center;
|
|
4
4
|
`;function re(){const a=_(),t=F(),n=p(B),u=p(q),[r,g]=f.useState(new Set),m=f.useRef(new Set),y=p(e=>e.tenantState.currentTenantId),b=p(e=>e.companyViewState.zeniUsers.fetchState);f.useEffect(()=>{b==="Not-Started"&&t(Z())},[t,b]);const d=w.getSignedInUser(),I=d!=null&&[d.firstName,d.lastName].filter(Boolean).join(" ")||void 0,U=f.useMemo(()=>({onFetch:()=>{t(K())},onUpdateProfile:(e,s,o)=>{const c=o.updatedByName??I;t(H({tenantId:s,tenantEmailDomain:e,update:{...o,updatedByName:c}}))},onAnalyse:e=>{g(s=>new Set(s).add(e)),t(G(e))},onDownloadReport:()=>{const e=J(n.rows),s=d?.userId??"",o=d?.zeniSessionId??"",c=y??"";if(!s||!o||!c)return;const x=encodeURIComponent(JSON.stringify(e)),z=`${j}/tableDownload?query=${x}`;fetch(z,{headers:{"zeni-user-id":s,"zeni-session-id":o,"zeni-tenant-id":c}}).then(async l=>{if(!l.ok){const S=await l.text();throw new Error(`Download failed: ${l.status} ${S}`)}return l.blob()}).then(l=>{const S=URL.createObjectURL(l),h=document.createElement("a");h.href=S,h.download=`${e.file_name}.xlsx`,h.click(),URL.revokeObjectURL(S)}).catch(()=>{})}}),[t,I,d,y,n.rows]);f.useEffect(()=>{if(r.size===0)return;const e=new Set;for(const s of r){const o=n.rows.find(c=>c.tenantId===s);o!=null&&o.isAnalyzing?m.current.add(s):o!=null&&!o.isAnalyzing&&m.current.has(s)&&(e.add(s),m.current.delete(s))}e.size>0&&g(s=>{const o=new Set(s);for(const c of e)o.delete(c);return o})},[n.rows,r]);const D=f.useMemo(()=>({fetchState:n.fetchStatus.fetchState,rows:n.rows.map(e=>e.isAnalyzing||e.tenantId!=null&&r.has(e.tenantId)?{...e,isAnalyzing:!0}:e),uiState:n.uiState}),[n,r]);return d==null?i.jsx(oe,{children:v.getLocalizedStrings().cockpit.creditAgent.notSignedIn}):i.jsx(se,{macroCombined:u,navigate:a,cardProfilesActions:U,cardProfilesData:D})}function he(){const{useDynamicConfig:a}=L(),{configValue:t,isDynamicConfigLoading:n}=a($.creditAgentEnablement);if(n)return null;const r=w.getSignedInUser()?.userEmail,g=Array.isArray(t?.allowedUserEmails)?t.allowedUserEmails:[];return r!=null&&g.includes(r)?i.jsx(A,{children:i.jsx(C,{path:"/*",element:i.jsx(te,{element:i.jsx(re,{})})})}):i.jsx(A,{children:i.jsx(C,{path:"/*",element:i.jsx(V,{to:"/management",replace:!0})})})}export{he as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as h,e as a}from"./sentry-
|
|
1
|
+
import{a as h,e as a}from"./sentry-BwzxWoLh.js";(function(){try{var r=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new r.Error().stack;t&&(r._sentryDebugIds=r._sentryDebugIds||{},r._sentryDebugIds[t]="dd43bc33-0b00-4ff6-b688-fe88df021aa7",r._sentryDebugIdIdentifier="sentry-dbid-dd43bc33-0b00-4ff6-b688-fe88df021aa7")}catch{}})();const c="64px",b={};var k=({src:r,light:t,oEmbedUrl:n,onClickPreview:l,playIcon:w,previewTabIndex:m,previewAriaLabel:u})=>{const[f,i]=h.useState(null);h.useEffect(()=>{r&&t&&n&&v({src:r,light:t,oEmbedUrl:n})},[r,t,n]);const v=async({src:e,light:s,oEmbedUrl:E})=>{if(a.isValidElement(s))return;if(typeof s=="string")return void i(s);if(b[e])return void i(b[e]);i(null);const I=await fetch(E.replace("{url}",e)),y=await I.json();if(y.thumbnail_url){const g=y.thumbnail_url.replace("height=100","height=480").replace("-d_295x166","-d_640");i(g),b[e]=g}},d=a.isValidElement(t),p={display:"flex",alignItems:"center",justifyContent:"center"},o={preview:{width:"100%",height:"100%",backgroundImage:f&&!d?`url(${f})`:void 0,backgroundSize:"cover",backgroundPosition:"center",cursor:"pointer",...p},shadow:{background:"radial-gradient(rgb(0, 0, 0, 0.3), rgba(0, 0, 0, 0) 60%)",borderRadius:c,width:c,height:c,position:d?"absolute":void 0,...p},playIcon:{borderStyle:"solid",borderWidth:"16px 0 16px 26px",borderColor:"transparent transparent transparent white",marginLeft:"7px"}},_=a.createElement("div",{style:o.shadow,className:"react-player__shadow"},a.createElement("div",{style:o.playIcon,className:"react-player__play-icon"}));return a.createElement("div",{style:o.preview,className:"react-player__preview",tabIndex:m,onClick:e=>{l?.(e)},onKeyDown:e=>{e.key!=="Enter"&&e.key!==" "||l==null||l(e)},...u?{"aria-label":u}:{}},d?t:null,w||_)};export{k as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CreditAgentRoutes-
|
|
2
|
-
import{Hq as pp,Hr as Lh,Hs as qh,jK as Ct,ey as Ks,Ht as Mt,eH as hn,ew as jh,Hu as tr,eD as pn,Hv as mp,Hw as gp,Hx as pr,Hy as vp,im as Dh,jM as Pt,ij as yp,ir as Nh,Hz as Ys,it as _p,iu as bp,HA as Tr,HB as mr,hQ as wp,HC as bn,HD as gs,d3 as Sp,fQ as vs,fN as mn,fV as Ut,fT as Ep,HE as Mh,HF as Fh,iI as Rp,iF as Op,HG as Tp,iT as xp,iO as Js,iL as Ap,iA as Ip,HH as Cp,ee as Pp,da as kp,jY as Uh,HI as Lp,bc as dn,ix as Xs,iC as qp,rg as Bh,jL as wn,HJ as vt,j6 as ys,HK as jp,k2 as Dp,B as Ve,bj as _s,HL as Np,hN as Mp,HM as Fp,HN as $h,HO as Up,pQ as Qs,pl as Bp,HP as $p,pr as Mn,HQ as Vp,pt as zp,HR as xt,pi as Gp,cT as Hp,jP as Vh,jQ as zh,jO as bs,jN as ws,jR as Zp,HS as Wp,pT as Kp,HT as Yp,pA as Jp,pN as Xp,HU as Qp,pE as em,HV as tm,HW as rr,HX as Ss,HY as rm,HZ as nm,om as im,os as Gh,H_ as Hh,hi as am,Gs as Zh,H$ as om,Gm as sm,I0 as um,I1 as cm,ov as lm,I2 as fm,Gx as hm,Gl as dm,t0 as Wh,I3 as Fn,I4 as Kh,Db as Es,CZ as pm,De as Yh,D0 as mm,I5 as gm,D5 as vm,CT as ym,CW as _m,I6 as bm,Di as wm,D8 as Sm,bn as Em,bb as Rm,I7 as Om,I8 as Kt,I9 as Tm,Ia as xm,Ib as Am,iX as hs,j1 as Im,bv as Jh}from"./zeni-epic-state-CvtUqjnz.js";import{j as Y}from"./liveblocks-2qCiW-lz.js";import{a as we,p as Re,d as $e,c as Rs,g as Cm}from"./sentry-Gbc14BJL.js";import{r as Pm,n as km,u as gr,a as $t,W as Lm,U as St,Y as Xh,R as lt,b as Ke,h as kt,g as Vt,z as tt,c as qm,d as jm,C as Dm,_ as Nm,e as Sn,B as Mm,f as vr,A as En,S as Ft,i as Fm,M as Um,j as At,F as Rn,D as Bt,Z as Bm,k as $m,s as Un,O as Vm,X as Qh,N as zm,l as ed,m as td,o as ds,p as Gm,q as Hm,L as Zm,t as rd,v as Wm,w as Km,x as Ym,G as Jm,y as Xm,E as Qm,H as eg,I as tg,J as rg,K as ng,P as ig,Q as ag,T as nd}from"./index-CnaD4GI7.js";import{f as og}from"./analyticsHelper-BidapgRT.js";import{i as Ze,m as Qe,g as xe,n as ft,N as lr,k as _t,l as ke,o as id,h as Ye,u as Os,j as ps}from"./core-Jhwj2cWt.js";import{D as yr,n as st,S as Jt}from"./mui-DK0XZjs0.js";import{a as Xe,b as sg,c as Ts,d as ug,e as xs,f as As,g as cg,h as lg,i as Xt,j as ad,k as hr,l as On,m as fg,n as hg,o as dg,p as pg,q as mg,s as gg,t as vg,u as od,v as Tn,w as _r,x as yg}from"./utils-1Oo38JiV.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="23627070-4669-493f-8bc9-7d7669f91877",e._sentryDebugIdIdentifier="sentry-dbid-23627070-4669-493f-8bc9-7d7669f91877")}catch{}})();function Et(e){return pp(e).access.isAllowed?Pm:km}const _g={overlayWidth:new lt(100,100,50)};function eu(){const e=Ze(),n=Qe(),o=gr(),i=$t(),a=xe(Et),t=xe(B=>Lh(B)),r=t.uiState.selectedCustomerTenantId,s=we.useMemo(()=>r?t.customers.find(B=>B.tenantId===r):void 0,[t.customers,r]),p=xe(B=>r?qh(B.aiAccountantCustomerState,B.userState,r):[]),l=t.customerViewStateByTenantId[r],u=l?.jobsFetchStatus??{fetchState:"Not-Started"},f=l?.jobsPageToken!=null;we.useEffect(()=>{t.fetchState==="Completed"?n(Ct(!1)):(t.fetchState==="Not-Started"||t.fetchState==="Error")&&n(Ks())},[t.fetchState]);const h=B=>{const O=kt(B),T=Vt(B);Ke.trackCockpitTabClicked(T),e(`../../${O}`,{replace:!0})},b=(B,O,T,D)=>{n(Mt([B.tenantId])),n(hn(O,T,D))},d=(B,O,T)=>{n(hn(B,O,T))},v=(B,O)=>{n(Mt(t.unonboardedTenantIds)),n(hn("retrain",B,O))},m=B=>{const O=t.selectedTenantIds,T=O.includes(B)?O.filter(D=>D!==B):[...O,B];n(Mt(T))},c=B=>{if(B.length===0)return;const O=t.selectedTenantIds,T=new Set(O);if(B.every(M=>T.has(M))){const M=new Set(B);n(Mt(O.filter(G=>!M.has(G))))}else{const M=Array.from(new Set([...O,...B]));n(Mt(M))}},_=()=>{n(Mt([]))},w=B=>{n(jh(B.companyId,B.tenantId))},y=B=>{B==="aiAccountant"&&n(Ks())},S=(B,O)=>{n(tr({sortKey:B,sortOrder:O}))},x=B=>{n(tr({selectedCustomerTenantId:B.tenantId})),n(pn(B.tenantId))},R=()=>{n(tr({selectedCustomerTenantId:""}))},A=B=>{n(tr({filterText:B}))},q=(B,O)=>{n(tr({filters:O}))},z=()=>{r&&n(pn(r,!0))};return Y.jsxs(Y.Fragment,{children:[Y.jsx(Lm,{headerData:{allTabOptions:a,selectedTabOption:St("aiAccountant")},headerActions:{onTabChange:h},aiAccountantPageData:{aiAccountantView:t},aiAccountantPageActions:{onAction:b,onBulkAction:d,onCancelOnboarding:w,onClearSelection:_,onCockpitReloadData:y,onColumnSortConfigChanged:S,onCustomerSelected:x,onEvaluateAll:v,onFilterTextChanged:A,onFiltersChange:q,onToggleAllVisible:c,onToggleTenantSelection:m}}),Y.jsx(yr,{anchor:"right",open:s!=null,PaperProps:{style:{width:_g.overlayWidth.valuePercentage(o),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:R,children:s!=null&&Y.jsx(Xh,{customer:s,hasMoreJobs:f,jobs:p,jobsFetchStatus:u,onAction:b,onCancelOnboarding:w,onClose:R,onLoadMoreJobs:z})})]})}function bg(){const{tenantId:e=""}=ft(),n=Ze(),o=Qe(),i=xe(h=>mp(h.aiAccountantCustomerState,h.userState)),a=xe(h=>Lh(h)),t=i.find(h=>h.tenantId===e),r=a.customerViewStateByTenantId[e],s=xe(h=>qh(h.aiAccountantCustomerState,h.userState,e));if(we.useEffect(()=>{o(pn(e))},[e,o]),t==null)return null;const p=(h,b,d,v)=>{o(Mt([h.tenantId])),o(hn(b,d,v))},l=h=>{o(jh(h.companyId,h.tenantId))},u=()=>{n("../")},f=()=>{o(pn(e,!0))};return Y.jsx(Xh,{customer:t,hasMoreJobs:r?.jobsPageToken!=null,jobs:s,jobsFetchStatus:r?.jobsFetchStatus??{fetchState:"Not-Started"},onAction:p,onCancelOnboarding:l,onClose:u,onLoadMoreJobs:f})}const sd=(e,n)=>{const o=[...e??[]];return o.push(n),o},wg=e=>{const n=[...e??[]];return{poppedPathname:n.pop(),newStack:n}},Sg=(e=2)=>{let n="../";for(let o=0;o<e;o++)n=`${n}../`;return n},De=({state:e,element:n})=>tt.isSignedIn()===!0?Y.jsx(Y.Fragment,{children:n}):Y.jsx(lr,{to:"/signin/auth",replace:!0,state:{...e,message:"...",origin:window.location.pathname}});function Eg(){return Y.jsxs(_t,{children:[Y.jsx(ke,{path:"/",element:Y.jsx(De,{element:Y.jsx(eu,{})})}),Y.jsx(ke,{path:"/detail/:tenantId",element:Y.jsx(De,{element:Y.jsx(bg,{})})}),Y.jsx(ke,{path:"/*",element:Y.jsx(De,{element:Y.jsx(eu,{})})})]})}const zt=()=>{const[e,n]=id(),[o,i]=we.useState(),a=we.useRef(!1);return we.useEffect(()=>{if(a.current===!0||!(e.has("thread_id")||e.has("entity_type")||e.has("company_id")))return;const r=qm(e);r!=null&&i(r);const s=new URLSearchParams(e);s.delete("thread_id"),s.delete("entity_type"),s.delete("company_id"),n(s,{replace:!0}),a.current=!0},[e,n]),o},Rg={overlayWidth:new lt(100,100,50)},{common:{strings:tu}}=vr.getLocalizedStrings();function Og(e,n){return{headerActions:{onTabChange:o=>{const i=kt(o),a=Vt(o);Ke.trackCockpitTabClicked(a),n.navigate(`../../${i}`,{replace:!0})},filterActions:{onFilterTextChanged:(o,i)=>{e(Tr({uiState:{filterText:i}}))},onFiltersChange:(o,i)=>{i.categories!=null&&i.categoryCombinationOperator!=null&&Ke.trackHealthMonitorFiltersApplied({filterSelection:{condition:i.categories.map(a=>a.matchingOperator).join(tu.comma),logic:i.categoryCombinationOperator,parameter:i.categories.map(a=>a.field).join(tu.comma)}}),e(Tr({uiState:{filters:i}}))}}},healthPageActions:{onRowClick:o=>{e(Nh(o))},onColumnSortConfigChanged:(o,i)=>{e(Tr({uiState:{sortKey:o,sortOrder:i}}))},onCockpitReloadData:o=>{o==="healthMonitor"&&e(Dh())},onFiltersChange:o=>{e(Tr({uiState:{filters:o}}))}}}}function Tg(e,n){return{headerData:{allTabOptions:Et(e),selectedTabOption:St("healthMonitor")},healthPageData:{healthView:n.healthView,managementView:n.managementView,mixpanelUrl:n.mixpanelHMUrl}}}const xg=Ye(Tg,Og)(Mm);function Bn({isDrawerOpen:e}){const n=Ze(),o=Qe(),i=$t(),a=gr(),{companyId:t}=ft(),[r,s]=id(),[p,l]=we.useState(!1),u=zt(),f=xe(y=>gp(y)),h=xe(y=>pr(y)),{additionalChurnFactors:b}=xe(y=>vp(y)),{selectedCompanyDetail:d,selectedCompanyId:v,localFormDataAndStatusByCompanyId:m}=f,c=xe(y=>y.companyViewState.zeniUsers.fetchState),_=xe(y=>y.companyHealthMetricConfigViewState);if(we.useEffect(()=>{const y=S=>S==="Not-Started"||S==="Error";f.fetchState==="Completed"?o(Ct(!1)):y(f.fetchState)&&(o(Dh()),y(c)&&o(Pt()),y(_.fetchState)&&o(yp()))},[f.fetchState,_.fetchState]),we.useEffect(()=>{t!=null&&f.fetchState==="Completed"&&r.has("utm_source")===!0&&(o(Nh(t)),d!=null&&(jm(),Ke.trackCockpitHealthMonitorNotificationAlertClicked({companyId:d.companyInfo.companyId,companyName:d.companyInfo.name,churnProbability:d.companyHealthMetric.churnProbabilityPercentage??null}),l(!0),r.delete("utm_source"),s(r)))},[f.fetchState,d?.companyInfo.companyId,d?.companyInfo.name]),tt.getSignedInUser()==null)throw Error("Can't access Health Monitor page without signing in...");return Y.jsxs(Y.Fragment,{children:[e===!0||v!=null&&d!=null?Y.jsx(yr,{anchor:"right",open:v!=null,PaperProps:{style:{width:Rg.overlayWidth.valuePercentage(a),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>o(Ys()),children:Y.jsx(Dm,{roomId:`cockpit_${v}`,autoConnect:!0,children:Y.jsx(Nm,{onSaveClick:()=>{v!=null&&o(bp(v))},onSaveChangesToLocalStore:y=>{f.selectedCompanyId!=null&&o(_p({companyId:f.selectedCompanyId,updatedLocalData:y}))},localData:m?.companyHealthMetricLocalData??{netPromoterScore:void 0,externalProductServiceExposure:void 0,additionalChurnFactors:{increasingChurnProbability:[],decreasingChurnProbability:[]}},companyHealthMetricViewSelector:f,onCloseDrawer:()=>o(Ys()),analytics:Ke,urlSource:p,additionalChurnFactorsOptions:b})})}):null,Y.jsx(xg,{initialOpenThreadRequest:u??void 0,healthView:f,managementView:h,navigate:n,mixpanelHMUrl:Sn.mixpanelHMUrl})]})}function Ag(){return Y.jsxs(_t,{children:[Y.jsx(ke,{path:"/companies/:companyId",element:Y.jsx(De,{element:Y.jsx(Bn,{isDrawerOpen:!0})})}),Y.jsx(ke,{path:"/",element:Y.jsx(De,{element:Y.jsx(Bn,{})})}),Y.jsx(ke,{path:"/*",element:Y.jsx(De,{element:Y.jsx(Bn,{})})})]})}const Ig={drawerLeftMargin:new lt(0,0,240)};function br(e){const{isOpen:n,drawerLeftMargin:o,children:i,onClose:a}=e,t=gr(),r=o?.valuePx(t)??Ig.drawerLeftMargin.valuePx(t),s=$t();return Y.jsx(yr,{anchor:"right",open:n,PaperProps:{style:{width:`calc(100% - ${r})`}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:i})}const Cg=({fetchState:e})=>e==="In-Progress"||e==="Not-Started"?Y.jsx(Pg,{children:Y.jsx(En,{size:"ExtraLarge",start:!0})}):null,Pg=st.div`
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/CreditAgentRoutes-CHOmROOx.js","assets/liveblocks-gBcidJDD.js","assets/sentry-BwzxWoLh.js","assets/core-CAP-FD3g.js","assets/zeni-epic-state-DAp72fC9.js","assets/index-CUe3JVOn.js","assets/mui-DXk9y9I2.js","assets/analytics-BPGO8b57.js","assets/utils-7tk2ftkc.js","assets/index-DVThwdcI.css","assets/analyticsHelper-DKbII6U3.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
import{Hq as pp,Hr as Lh,Hs as qh,jK as Ct,ey as Ks,Ht as Mt,eH as hn,ew as jh,Hu as tr,eD as pn,Hv as mp,Hw as gp,Hx as pr,Hy as vp,im as Dh,jM as Pt,ij as yp,ir as Nh,Hz as Ys,it as _p,iu as bp,HA as Tr,HB as mr,hQ as wp,HC as bn,HD as gs,d3 as Sp,fQ as vs,fN as mn,fV as Ut,fT as Ep,HE as Mh,HF as Fh,iI as Rp,iF as Op,HG as Tp,iT as xp,iO as Js,iL as Ap,iA as Ip,HH as Cp,ee as Pp,da as kp,jY as Uh,HI as Lp,bc as dn,ix as Xs,iC as qp,rg as Bh,jL as wn,HJ as vt,j6 as ys,HK as jp,k2 as Dp,B as Ve,bj as _s,HL as Np,hN as Mp,HM as Fp,HN as $h,HO as Up,pQ as Qs,pl as Bp,HP as $p,pr as Mn,HQ as Vp,pt as zp,HR as xt,pi as Gp,cT as Hp,jP as Vh,jQ as zh,jO as bs,jN as ws,jR as Zp,HS as Wp,pT as Kp,HT as Yp,pA as Jp,pN as Xp,HU as Qp,pE as em,HV as tm,HW as rr,HX as Ss,HY as rm,HZ as nm,om as im,os as Gh,H_ as Hh,hi as am,Gs as Zh,H$ as om,Gm as sm,I0 as um,I1 as cm,ov as lm,I2 as fm,Gx as hm,Gl as dm,t0 as Wh,I3 as Fn,I4 as Kh,Db as Es,CZ as pm,De as Yh,D0 as mm,I5 as gm,D5 as vm,CT as ym,CW as _m,I6 as bm,Di as wm,D8 as Sm,bn as Em,bb as Rm,I7 as Om,I8 as Kt,I9 as Tm,Ia as xm,Ib as Am,iX as hs,j1 as Im,bv as Jh}from"./zeni-epic-state-DAp72fC9.js";import{j as Y}from"./liveblocks-gBcidJDD.js";import{a as we,p as Re,d as $e,c as Rs,g as Cm}from"./sentry-BwzxWoLh.js";import{r as Pm,n as km,u as gr,a as $t,W as Lm,U as St,Y as Xh,R as lt,b as Ke,h as kt,g as Vt,z as tt,c as qm,d as jm,C as Dm,_ as Nm,e as Sn,B as Mm,f as vr,A as En,S as Ft,i as Fm,M as Um,j as At,F as Rn,D as Bt,Z as Bm,k as $m,s as Un,O as Vm,X as Qh,N as zm,l as ed,m as td,o as ds,p as Gm,q as Hm,L as Zm,t as rd,v as Wm,w as Km,x as Ym,G as Jm,y as Xm,E as Qm,H as eg,I as tg,J as rg,K as ng,P as ig,Q as ag,T as nd}from"./index-CUe3JVOn.js";import{f as og}from"./analyticsHelper-DKbII6U3.js";import{i as Ze,m as Qe,g as xe,n as ft,N as lr,k as _t,l as ke,o as id,h as Ye,u as Os,j as ps}from"./core-CAP-FD3g.js";import{D as yr,n as st,S as Jt}from"./mui-DXk9y9I2.js";import{a as Xe,b as sg,c as Ts,d as ug,e as xs,f as As,g as cg,h as lg,i as Xt,j as ad,k as hr,l as On,m as fg,n as hg,o as dg,p as pg,q as mg,s as gg,t as vg,u as od,v as Tn,w as _r,x as yg}from"./utils-7tk2ftkc.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},n=new e.Error().stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="23627070-4669-493f-8bc9-7d7669f91877",e._sentryDebugIdIdentifier="sentry-dbid-23627070-4669-493f-8bc9-7d7669f91877")}catch{}})();function Et(e){return pp(e).access.isAllowed?Pm:km}const _g={overlayWidth:new lt(100,100,50)};function eu(){const e=Ze(),n=Qe(),o=gr(),i=$t(),a=xe(Et),t=xe(B=>Lh(B)),r=t.uiState.selectedCustomerTenantId,s=we.useMemo(()=>r?t.customers.find(B=>B.tenantId===r):void 0,[t.customers,r]),p=xe(B=>r?qh(B.aiAccountantCustomerState,B.userState,r):[]),l=t.customerViewStateByTenantId[r],u=l?.jobsFetchStatus??{fetchState:"Not-Started"},f=l?.jobsPageToken!=null;we.useEffect(()=>{t.fetchState==="Completed"?n(Ct(!1)):(t.fetchState==="Not-Started"||t.fetchState==="Error")&&n(Ks())},[t.fetchState]);const h=B=>{const O=kt(B),T=Vt(B);Ke.trackCockpitTabClicked(T),e(`../../${O}`,{replace:!0})},b=(B,O,T,D)=>{n(Mt([B.tenantId])),n(hn(O,T,D))},d=(B,O,T)=>{n(hn(B,O,T))},v=(B,O)=>{n(Mt(t.unonboardedTenantIds)),n(hn("retrain",B,O))},m=B=>{const O=t.selectedTenantIds,T=O.includes(B)?O.filter(D=>D!==B):[...O,B];n(Mt(T))},c=B=>{if(B.length===0)return;const O=t.selectedTenantIds,T=new Set(O);if(B.every(M=>T.has(M))){const M=new Set(B);n(Mt(O.filter(G=>!M.has(G))))}else{const M=Array.from(new Set([...O,...B]));n(Mt(M))}},_=()=>{n(Mt([]))},w=B=>{n(jh(B.companyId,B.tenantId))},y=B=>{B==="aiAccountant"&&n(Ks())},S=(B,O)=>{n(tr({sortKey:B,sortOrder:O}))},x=B=>{n(tr({selectedCustomerTenantId:B.tenantId})),n(pn(B.tenantId))},R=()=>{n(tr({selectedCustomerTenantId:""}))},A=B=>{n(tr({filterText:B}))},q=(B,O)=>{n(tr({filters:O}))},z=()=>{r&&n(pn(r,!0))};return Y.jsxs(Y.Fragment,{children:[Y.jsx(Lm,{headerData:{allTabOptions:a,selectedTabOption:St("aiAccountant")},headerActions:{onTabChange:h},aiAccountantPageData:{aiAccountantView:t},aiAccountantPageActions:{onAction:b,onBulkAction:d,onCancelOnboarding:w,onClearSelection:_,onCockpitReloadData:y,onColumnSortConfigChanged:S,onCustomerSelected:x,onEvaluateAll:v,onFilterTextChanged:A,onFiltersChange:q,onToggleAllVisible:c,onToggleTenantSelection:m}}),Y.jsx(yr,{anchor:"right",open:s!=null,PaperProps:{style:{width:_g.overlayWidth.valuePercentage(o),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:R,children:s!=null&&Y.jsx(Xh,{customer:s,hasMoreJobs:f,jobs:p,jobsFetchStatus:u,onAction:b,onCancelOnboarding:w,onClose:R,onLoadMoreJobs:z})})]})}function bg(){const{tenantId:e=""}=ft(),n=Ze(),o=Qe(),i=xe(h=>mp(h.aiAccountantCustomerState,h.userState)),a=xe(h=>Lh(h)),t=i.find(h=>h.tenantId===e),r=a.customerViewStateByTenantId[e],s=xe(h=>qh(h.aiAccountantCustomerState,h.userState,e));if(we.useEffect(()=>{o(pn(e))},[e,o]),t==null)return null;const p=(h,b,d,v)=>{o(Mt([h.tenantId])),o(hn(b,d,v))},l=h=>{o(jh(h.companyId,h.tenantId))},u=()=>{n("../")},f=()=>{o(pn(e,!0))};return Y.jsx(Xh,{customer:t,hasMoreJobs:r?.jobsPageToken!=null,jobs:s,jobsFetchStatus:r?.jobsFetchStatus??{fetchState:"Not-Started"},onAction:p,onCancelOnboarding:l,onClose:u,onLoadMoreJobs:f})}const sd=(e,n)=>{const o=[...e??[]];return o.push(n),o},wg=e=>{const n=[...e??[]];return{poppedPathname:n.pop(),newStack:n}},Sg=(e=2)=>{let n="../";for(let o=0;o<e;o++)n=`${n}../`;return n},De=({state:e,element:n})=>tt.isSignedIn()===!0?Y.jsx(Y.Fragment,{children:n}):Y.jsx(lr,{to:"/signin/auth",replace:!0,state:{...e,message:"...",origin:window.location.pathname}});function Eg(){return Y.jsxs(_t,{children:[Y.jsx(ke,{path:"/",element:Y.jsx(De,{element:Y.jsx(eu,{})})}),Y.jsx(ke,{path:"/detail/:tenantId",element:Y.jsx(De,{element:Y.jsx(bg,{})})}),Y.jsx(ke,{path:"/*",element:Y.jsx(De,{element:Y.jsx(eu,{})})})]})}const zt=()=>{const[e,n]=id(),[o,i]=we.useState(),a=we.useRef(!1);return we.useEffect(()=>{if(a.current===!0||!(e.has("thread_id")||e.has("entity_type")||e.has("company_id")))return;const r=qm(e);r!=null&&i(r);const s=new URLSearchParams(e);s.delete("thread_id"),s.delete("entity_type"),s.delete("company_id"),n(s,{replace:!0}),a.current=!0},[e,n]),o},Rg={overlayWidth:new lt(100,100,50)},{common:{strings:tu}}=vr.getLocalizedStrings();function Og(e,n){return{headerActions:{onTabChange:o=>{const i=kt(o),a=Vt(o);Ke.trackCockpitTabClicked(a),n.navigate(`../../${i}`,{replace:!0})},filterActions:{onFilterTextChanged:(o,i)=>{e(Tr({uiState:{filterText:i}}))},onFiltersChange:(o,i)=>{i.categories!=null&&i.categoryCombinationOperator!=null&&Ke.trackHealthMonitorFiltersApplied({filterSelection:{condition:i.categories.map(a=>a.matchingOperator).join(tu.comma),logic:i.categoryCombinationOperator,parameter:i.categories.map(a=>a.field).join(tu.comma)}}),e(Tr({uiState:{filters:i}}))}}},healthPageActions:{onRowClick:o=>{e(Nh(o))},onColumnSortConfigChanged:(o,i)=>{e(Tr({uiState:{sortKey:o,sortOrder:i}}))},onCockpitReloadData:o=>{o==="healthMonitor"&&e(Dh())},onFiltersChange:o=>{e(Tr({uiState:{filters:o}}))}}}}function Tg(e,n){return{headerData:{allTabOptions:Et(e),selectedTabOption:St("healthMonitor")},healthPageData:{healthView:n.healthView,managementView:n.managementView,mixpanelUrl:n.mixpanelHMUrl}}}const xg=Ye(Tg,Og)(Mm);function Bn({isDrawerOpen:e}){const n=Ze(),o=Qe(),i=$t(),a=gr(),{companyId:t}=ft(),[r,s]=id(),[p,l]=we.useState(!1),u=zt(),f=xe(y=>gp(y)),h=xe(y=>pr(y)),{additionalChurnFactors:b}=xe(y=>vp(y)),{selectedCompanyDetail:d,selectedCompanyId:v,localFormDataAndStatusByCompanyId:m}=f,c=xe(y=>y.companyViewState.zeniUsers.fetchState),_=xe(y=>y.companyHealthMetricConfigViewState);if(we.useEffect(()=>{const y=S=>S==="Not-Started"||S==="Error";f.fetchState==="Completed"?o(Ct(!1)):y(f.fetchState)&&(o(Dh()),y(c)&&o(Pt()),y(_.fetchState)&&o(yp()))},[f.fetchState,_.fetchState]),we.useEffect(()=>{t!=null&&f.fetchState==="Completed"&&r.has("utm_source")===!0&&(o(Nh(t)),d!=null&&(jm(),Ke.trackCockpitHealthMonitorNotificationAlertClicked({companyId:d.companyInfo.companyId,companyName:d.companyInfo.name,churnProbability:d.companyHealthMetric.churnProbabilityPercentage??null}),l(!0),r.delete("utm_source"),s(r)))},[f.fetchState,d?.companyInfo.companyId,d?.companyInfo.name]),tt.getSignedInUser()==null)throw Error("Can't access Health Monitor page without signing in...");return Y.jsxs(Y.Fragment,{children:[e===!0||v!=null&&d!=null?Y.jsx(yr,{anchor:"right",open:v!=null,PaperProps:{style:{width:Rg.overlayWidth.valuePercentage(a),boxShadow:"none"}},slotProps:{backdrop:{style:{backgroundColor:i.colors.black,opacity:.75,cursor:"pointer"}}},onClose:()=>o(Ys()),children:Y.jsx(Dm,{roomId:`cockpit_${v}`,autoConnect:!0,children:Y.jsx(Nm,{onSaveClick:()=>{v!=null&&o(bp(v))},onSaveChangesToLocalStore:y=>{f.selectedCompanyId!=null&&o(_p({companyId:f.selectedCompanyId,updatedLocalData:y}))},localData:m?.companyHealthMetricLocalData??{netPromoterScore:void 0,externalProductServiceExposure:void 0,additionalChurnFactors:{increasingChurnProbability:[],decreasingChurnProbability:[]}},companyHealthMetricViewSelector:f,onCloseDrawer:()=>o(Ys()),analytics:Ke,urlSource:p,additionalChurnFactorsOptions:b})})}):null,Y.jsx(xg,{initialOpenThreadRequest:u??void 0,healthView:f,managementView:h,navigate:n,mixpanelHMUrl:Sn.mixpanelHMUrl})]})}function Ag(){return Y.jsxs(_t,{children:[Y.jsx(ke,{path:"/companies/:companyId",element:Y.jsx(De,{element:Y.jsx(Bn,{isDrawerOpen:!0})})}),Y.jsx(ke,{path:"/",element:Y.jsx(De,{element:Y.jsx(Bn,{})})}),Y.jsx(ke,{path:"/*",element:Y.jsx(De,{element:Y.jsx(Bn,{})})})]})}const Ig={drawerLeftMargin:new lt(0,0,240)};function br(e){const{isOpen:n,drawerLeftMargin:o,children:i,onClose:a}=e,t=gr(),r=o?.valuePx(t)??Ig.drawerLeftMargin.valuePx(t),s=$t();return Y.jsx(yr,{anchor:"right",open:n,PaperProps:{style:{width:`calc(100% - ${r})`}},slotProps:{backdrop:{style:{backgroundColor:s.colors.black,opacity:.8,cursor:"pointer"}}},onClose:a,children:i})}const Cg=({fetchState:e})=>e==="In-Progress"||e==="Not-Started"?Y.jsx(Pg,{children:Y.jsx(En,{size:"ExtraLarge",start:!0})}):null,Pg=st.div`
|
|
3
3
|
display: flex;
|
|
4
4
|
width: 100%;
|
|
5
5
|
height: 100%;
|
|
@@ -182,4 +182,4 @@ Found: ${o.toString().split(`
|
|
|
182
182
|
`;function Xb(){return Y.jsxs(_t,{children:[Y.jsx(ke,{path:"/report/:companyId",element:Y.jsx(De,{element:Y.jsx(ls,{})})}),Y.jsx(ke,{path:"/warnings/:companyId",element:Y.jsx(De,{element:Y.jsx(ls,{})})}),Y.jsx(ke,{path:"/*",element:Y.jsx(De,{element:Y.jsx(ls,{})})})]})}function Qb(e,n){const o=Kh(e,n.tenantId),i=o.estimateStatus?.fetchState!=="In-Progress"?void 0:"readonly";return{localData:o,isDisabled:i}}function e0(e,n){const{tenantId:o,companyId:i,location:a,navigate:t}=n;return{onSubscriptionDetailsChanged:r=>{const{addPlan:s,invoiceOption:p}=r,{subscriptionPlan:l,recurringAddOns:u,coupon:f}=s,h={subscriptionPlanId:l.selectedOption??"",subscriptionAddOnIds:u.filter(b=>b.selectedOption!=null).map(b=>b.selectedOption),subscriptionCouponIds:f.selectedOption!=null?[f.selectedOption]:[],invoiceImmediately:p.invoicingOption!=null};s.planStartDate!=null&&(h.startDate=dn(s.planStartDate.toString())),e(Yh({tenantId:o,subscriptionData:h}))},onEstimateSuccess:()=>{const r=sd(a.state?.pathnameStackToGoBack,a.pathname);t(`../tenants/${o}/companies/${i}/summary`,{state:{pathnameStackToGoBack:r}})},onReviewClick:()=>{e(pm(o))},onBackClick:()=>{t(`../tenants/${o}/companies/${i}`)},onResetClick:()=>{e(Es(o))}}}const t0=Ye(Qb,e0)(eg),r0=e=>{const{tenantId:n,companyId:o,location:i,navigate:a}=e;return Y.jsx(t0,{tenantId:n,companyId:o,location:i,navigate:a})};function n0(e,n){const{companyId:o,tenantId:i}=n,a=gm(e,o,i),t=a.fetchState!=="In-Progress";return{subscriptionDetailView:a,canUpdate:t}}function i0(e,n){const{tenantId:o,location:i,navigate:a}=n;return{onUpdateOrAddPlanClick:t=>{e(Es(o,t)),e(vm()),e(ym()),e(_m()),t!=null?a(`${i.pathname}/update`):a(`${i.pathname}/add`)},onCloseClick:()=>{a("../")}}}const a0=Ye(n0,i0)(tg),o0=e=>{const{tenantId:n,companyId:o,location:i,navigate:a}=e,t=Qe(),[r,s]=we.useState(!1),p=xe(l=>l.subscriptionViewState.subscriptionDetailsByCompanyId[o]?.fetchStatus);return we.useEffect(()=>{!r&&(p==null||p?.fetchState==="Not-Started")&&(s(!0),t(mm(o)))},[r,p,o,t]),we.useEffect(()=>{r&&p!=null&&p?.fetchState==="Error"&&a("../subscription")},[r,p]),Y.jsx(a0,{tenantId:n,companyId:o,location:i,navigate:a})};function s0(e,n){return{subscriptionEstimateData:bm(e,n.tenantId)}}function u0(e,n){const{tenantId:o,companyId:i,location:a,navigate:t}=n,r=()=>{const s=wg(a.state?.pathnameStackToGoBack),p=s.poppedPathname??Sg(1);t(p,{state:{pathnameStackToGoBack:s.newStack}})};return{onBackClick:()=>{r()},onCancelClick:()=>{r()},onConfirmClick:()=>{e(wm(o))},onConfirmSuccess:()=>{t(`../tenants/${o}/companies/${i}`)}}}const c0=Ye(s0,u0)(rg),l0=e=>{const{tenantId:n,companyId:o,location:i,navigate:a}=e;return Y.jsx(c0,{companyId:o,tenantId:n,location:i,navigate:a})};function f0(e,n){const o=Kh(e,n.tenantId),i=o.estimateStatus.fetchState!=="In-Progress"?void 0:"readonly";return{localData:o,isDisabled:i}}function h0(e,n){const{tenantId:o,companyId:i,location:a,navigate:t}=n;return{onSubscriptionDetailsChanged:r=>{const{updatePlan:s,applyChanges:p}=r,{subscriptionPlan:l,recurringAddOns:u,coupon:f}=s,h={subscriptionPlanId:l.selectedOption??"",subscriptionAddOnIds:u.filter(b=>b.selectedOption!=null).map(b=>b.selectedOption),subscriptionCouponIds:f.selectedOption!=null?[f.selectedOption]:[],invoiceImmediately:!0,applyEndOfTerm:p.changeType==="applyEndOfTerm",shouldProrate:p.shouldProrate};e(Yh({tenantId:o,subscriptionData:h}))},onEstimateSuccess:()=>{const r=sd(a.state?.pathnameStackToGoBack,a.pathname);t(`../tenants/${o}/companies/${i}/summary`,{state:{pathnameStackToGoBack:r}})},onReviewClick:()=>{e(Sm(o))},onBackClick:()=>{t(`../tenants/${o}/companies/${i}`)},onResetClick:r=>{e(Es(o,r.subscription.subscription.subscriptionId))}}}const d0=Ye(f0,h0)(ng),p0=e=>{const{tenantId:n,companyId:o,location:i,navigate:a}=e;return Y.jsx(d0,{tenantId:n,companyId:o,location:i,navigate:a})},hp=["add","update","summary"],m0=e=>Rm(e,hp),g0=e=>Em(e,hp),v0=()=>{const[e,n]=we.useState(!0),{tenantId:o,companyId:i,updatePageType:a}=ft(),t=Ze(),r=xe(p=>o!=null?p.subscriptionViewState.subscriptionUpdateViewDataByTenantId[o]:null);if(tt.getSignedInUser()==null)throw Error("Can't access subscription details drawer without signing in...");return we.useEffect(()=>{(r==null&&a!=null||g0(a??"")==null)&&t(`../tenants/${o}/companies/${i}`)},[r]),Y.jsx(br,{isOpen:e,onClose:()=>{n(!1),t("../subscription")},children:Y.jsx(_0,{children:Y.jsx(y0,{tenantId:o,companyId:i,updatePageType:a!=null?m0(a):void 0})})})},y0=({tenantId:e,companyId:n,updatePageType:o})=>{const i=Ze(),a=Os(),t={tenantId:e,companyId:n,navigate:i,location:a};if(o==null)return Y.jsx(o0,{...t});switch(o){case"update":return Y.jsx(p0,{...t});case"add":return Y.jsx(r0,{...t});case"summary":return Y.jsx(l0,{...t});default:return console.error("Subscription Update Page - Invalid Url"),Y.jsx(lr,{to:"/",replace:!0})}},_0=st(Jt)`
|
|
183
183
|
display: flex;
|
|
184
184
|
min-height: 100%;
|
|
185
|
-
`;function b0(e,n){return{headerActions:{onTabChange:o=>{const i=kt(o),a=Vt(o);Ke.trackCockpitTabClicked(a),n.navigate(`../../${i}`,{replace:!0})},filterActions:{onFilterTextChanged:(o,i)=>{e(Kt({filterText:i}))},onFiltersChange:(o,i)=>{e(Kt({filters:i}))}}},subscriptionPageActions:{onColumnSortConfigChanged:(o,i)=>{e(Kt({sortKey:o,sortOrder:i}))},onCollapseToggled:(o,i)=>{e(Kt({isRowCollapseToggled:{companyId:o,isCollapsed:i}}))},onScroll:o=>{e(Kt({scrollYOffset:o}))},changeHandlers:(o,i)=>{const a=E0(i);Object.keys(a).length>0&&e(ys(o,a))},onCompanyNameClicked:o=>window.open(`/${o.company.company.companyInfo.primaryEmailDomain}/dashboard`),onPassportIconClicked:o=>window.open(`/${o.company.company.companyInfo.primaryEmailDomain}/dashboard/company_details`),onPlanOrAddOnClicked:(o,i)=>{e(Tm({tenantId:i})),n.navigate(`../tenants/${i}/companies/${o}`)},onFiltersChange:(o,i)=>{e(Kt({filters:i}))},onCockpitReloadData:o=>{o==="subscription"&&e(ws())}}}}function w0(e,n){return{headerData:{allTabOptions:Et(e),selectedTabOption:St("subscription")},subscriptionPageData:{loggedInUser:n.signedInUser,subscriptionView:n.subscriptionView}}}const S0=Ye(w0,b0)(ig);function fs({isDrawerOpen:e}){const n=Ze(),o=Qe(),i=zt(),a=xe(s=>Om(s)),t=xe(s=>s.companyViewState.zeniUsers.fetchState);we.useEffect(()=>{a.fetchState==="Completed"?o(Ct(!1)):(a.fetchState==="Not-Started"||a.fetchState==="Error")&&(o(ws()),(t==="Not-Started"||t==="Error")&&o(Pt()))},[a.fetchState]);const r=tt.getSignedInUser();return Y.jsxs(Y.Fragment,{children:[e===!0?Y.jsx(v0,{}):null,Y.jsx(S0,{initialOpenThreadRequest:i??void 0,signedInUser:r,subscriptionView:a,navigate:n})]})}const E0=e=>{const{users:n}=e;return n?{users:n}:{}};function R0(){return Y.jsxs(_t,{children:[Y.jsx(ke,{path:"/tenants/:tenantId/companies/:companyId",element:Y.jsx(De,{element:Y.jsx(fs,{isDrawerOpen:!0})})}),Y.jsx(ke,{path:"/tenants/:tenantId/companies/:companyId/:updatePageType",element:Y.jsx(De,{element:Y.jsx(fs,{isDrawerOpen:!0})})}),Y.jsx(ke,{path:"/*",element:Y.jsx(De,{element:Y.jsx(fs,{})})})]})}function O0(e,n){const{navigate:o}=n;return{headerActions:{onTabChange:i=>{const a=kt(i);o(`../../${a}`,{replace:!0})}},taskManagerPageActions:{onRowClick:(i,a)=>{window.open(`/${i}/tasks/${a}`)},onCockpitReloadData:i=>{i==="taskManager"&&e(hs(null,"dueDate","descending",!1))},onFetchTaskManagerView:(i,a,t,r,s)=>{e(hs(i,a,t,r,s))}}}}function T0(e,n){return{headerData:{allTabOptions:Et(e),selectedTabOption:St("taskManager")},isBirdsEyeViewEnabled:n.isBirdsEyeViewEnabled,taskManagerPageData:{companyTaskManagerView:n.companyTaskManagerView}}}const x0=Ye(T0,O0)(ag);function Ph(){const e=Ze(),n=Qe(),o=zt(),{useFeatureGate:i}=At(),{isFeatureEnabled:a}=i(Rn.isBirdsEyeViewEnabled),t=xe(l=>xm(l)),r=xe(l=>Am(l)),s=xe(l=>l.companyViewState.zeniUsers.fetchState);if(we.useEffect(()=>{t.fetchState==="Completed"?n(Ct(!1)):(t.fetchState==="Not-Started"||t.fetchState==="Error")&&(n(hs(null,"dueDate","descending",!1)),(s==="Not-Started"||s==="Error")&&n(Pt()))},[t.fetchState]),we.useEffect(()=>{a&&(t.metricsFetchState==="Not-Started"||t.metricsFetchState==="Error")&&n(Im())},[a,t.metricsFetchState]),tt.getSignedInUser()==null)throw Error("Can't access task manager page without signing in...");return Y.jsx(x0,{companyTaskManagerView:t,isBirdsEyeViewEnabled:a,initialOpenThreadRequest:o,navigate:e,reviewCount:r})}function A0(){return Y.jsxs(_t,{children:[Y.jsx(ke,{path:"/",element:Y.jsx(De,{element:Y.jsx(Ph,{})})}),Y.jsx(ke,{path:"/*",element:Y.jsx(De,{element:Y.jsx(Ph,{})})})]})}const I0=nd(()=>Jh(()=>import("./CreditAgentRoutes-
|
|
185
|
+
`;function b0(e,n){return{headerActions:{onTabChange:o=>{const i=kt(o),a=Vt(o);Ke.trackCockpitTabClicked(a),n.navigate(`../../${i}`,{replace:!0})},filterActions:{onFilterTextChanged:(o,i)=>{e(Kt({filterText:i}))},onFiltersChange:(o,i)=>{e(Kt({filters:i}))}}},subscriptionPageActions:{onColumnSortConfigChanged:(o,i)=>{e(Kt({sortKey:o,sortOrder:i}))},onCollapseToggled:(o,i)=>{e(Kt({isRowCollapseToggled:{companyId:o,isCollapsed:i}}))},onScroll:o=>{e(Kt({scrollYOffset:o}))},changeHandlers:(o,i)=>{const a=E0(i);Object.keys(a).length>0&&e(ys(o,a))},onCompanyNameClicked:o=>window.open(`/${o.company.company.companyInfo.primaryEmailDomain}/dashboard`),onPassportIconClicked:o=>window.open(`/${o.company.company.companyInfo.primaryEmailDomain}/dashboard/company_details`),onPlanOrAddOnClicked:(o,i)=>{e(Tm({tenantId:i})),n.navigate(`../tenants/${i}/companies/${o}`)},onFiltersChange:(o,i)=>{e(Kt({filters:i}))},onCockpitReloadData:o=>{o==="subscription"&&e(ws())}}}}function w0(e,n){return{headerData:{allTabOptions:Et(e),selectedTabOption:St("subscription")},subscriptionPageData:{loggedInUser:n.signedInUser,subscriptionView:n.subscriptionView}}}const S0=Ye(w0,b0)(ig);function fs({isDrawerOpen:e}){const n=Ze(),o=Qe(),i=zt(),a=xe(s=>Om(s)),t=xe(s=>s.companyViewState.zeniUsers.fetchState);we.useEffect(()=>{a.fetchState==="Completed"?o(Ct(!1)):(a.fetchState==="Not-Started"||a.fetchState==="Error")&&(o(ws()),(t==="Not-Started"||t==="Error")&&o(Pt()))},[a.fetchState]);const r=tt.getSignedInUser();return Y.jsxs(Y.Fragment,{children:[e===!0?Y.jsx(v0,{}):null,Y.jsx(S0,{initialOpenThreadRequest:i??void 0,signedInUser:r,subscriptionView:a,navigate:n})]})}const E0=e=>{const{users:n}=e;return n?{users:n}:{}};function R0(){return Y.jsxs(_t,{children:[Y.jsx(ke,{path:"/tenants/:tenantId/companies/:companyId",element:Y.jsx(De,{element:Y.jsx(fs,{isDrawerOpen:!0})})}),Y.jsx(ke,{path:"/tenants/:tenantId/companies/:companyId/:updatePageType",element:Y.jsx(De,{element:Y.jsx(fs,{isDrawerOpen:!0})})}),Y.jsx(ke,{path:"/*",element:Y.jsx(De,{element:Y.jsx(fs,{})})})]})}function O0(e,n){const{navigate:o}=n;return{headerActions:{onTabChange:i=>{const a=kt(i);o(`../../${a}`,{replace:!0})}},taskManagerPageActions:{onRowClick:(i,a)=>{window.open(`/${i}/tasks/${a}`)},onCockpitReloadData:i=>{i==="taskManager"&&e(hs(null,"dueDate","descending",!1))},onFetchTaskManagerView:(i,a,t,r,s)=>{e(hs(i,a,t,r,s))}}}}function T0(e,n){return{headerData:{allTabOptions:Et(e),selectedTabOption:St("taskManager")},isBirdsEyeViewEnabled:n.isBirdsEyeViewEnabled,taskManagerPageData:{companyTaskManagerView:n.companyTaskManagerView}}}const x0=Ye(T0,O0)(ag);function Ph(){const e=Ze(),n=Qe(),o=zt(),{useFeatureGate:i}=At(),{isFeatureEnabled:a}=i(Rn.isBirdsEyeViewEnabled),t=xe(l=>xm(l)),r=xe(l=>Am(l)),s=xe(l=>l.companyViewState.zeniUsers.fetchState);if(we.useEffect(()=>{t.fetchState==="Completed"?n(Ct(!1)):(t.fetchState==="Not-Started"||t.fetchState==="Error")&&(n(hs(null,"dueDate","descending",!1)),(s==="Not-Started"||s==="Error")&&n(Pt()))},[t.fetchState]),we.useEffect(()=>{a&&(t.metricsFetchState==="Not-Started"||t.metricsFetchState==="Error")&&n(Im())},[a,t.metricsFetchState]),tt.getSignedInUser()==null)throw Error("Can't access task manager page without signing in...");return Y.jsx(x0,{companyTaskManagerView:t,isBirdsEyeViewEnabled:a,initialOpenThreadRequest:o,navigate:e,reviewCount:r})}function A0(){return Y.jsxs(_t,{children:[Y.jsx(ke,{path:"/",element:Y.jsx(De,{element:Y.jsx(Ph,{})})}),Y.jsx(ke,{path:"/*",element:Y.jsx(De,{element:Y.jsx(Ph,{})})})]})}const I0=nd(()=>Jh(()=>import("./CreditAgentRoutes-CHOmROOx.js"),__vite__mapDeps([0,1,2,3,4,5,6,7,8,9,10])));let kh=!1;const C0=nd(()=>Jh(()=>Promise.resolve().then(()=>Wg),void 0));function P0(){const e=tt.getSignedInUser(),n=$t().mode;return we.useEffect(()=>{tt.isSignedIn()&&!kh&&e!=null&&(og(e,n),kh=!0)},[e]),Y.jsxs(_t,{children:[Y.jsx(ke,{path:"/ai-accountant/*",element:Y.jsx(Eg,{})}),Y.jsx(ke,{path:"/management/*",element:Y.jsx(tv,{})}),Y.jsx(ke,{path:"/subscription/*",element:Y.jsx(R0,{})}),Y.jsx(ke,{path:"/onboarding/*",element:Y.jsx(Ab,{})}),Y.jsx(ke,{path:"/portfolio/*",element:Y.jsx(kb,{})}),Y.jsx(ke,{path:"/audit/*",element:Y.jsx(Xb,{})}),Y.jsx(ke,{path:"/reconciliation/*",element:Y.jsx($b,{})}),Y.jsx(ke,{path:"/health-monitor/*",element:Y.jsx(Ag,{})}),Y.jsx(ke,{path:"/task-manager/*",element:Y.jsx(A0,{})}),Y.jsx(ke,{path:"/credit-agent/*",element:Y.jsx(I0,{})}),Y.jsx(ke,{path:"/*",element:Y.jsx(C0,{})})]})}const U0=Object.freeze(Object.defineProperty({__proto__:null,default:P0},Symbol.toStringTag,{value:"Module"}));export{De as P,U0 as S};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{j as l}from"./liveblocks-
|
|
1
|
+
import{j as l}from"./liveblocks-gBcidJDD.js";import{a as f,e as S,l as I}from"./sentry-BwzxWoLh.js";import{m,i as w,g as d,u as h,N as y,h as b}from"./core-CAP-FD3g.js";import{z as g,a as C,f as v,b as E,o as T,V as U,e as p}from"./index-CUe3JVOn.js";import{Ic as L,Id as x,Ie as z,If as D,bj as u}from"./zeni-epic-state-DAp72fC9.js";import{f as A}from"./analyticsHelper-DKbII6U3.js";import"./mui-DXk9y9I2.js";import"./analytics-BPGO8b57.js";import"./utils-7tk2ftkc.js";(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},o=new e.Error().stack;o&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[o]="85c6d1d8-0809-4d53-8a74-e0723cdc8a9c",e._sentryDebugIdIdentifier="sentry-dbid-85c6d1d8-0809-4d53-8a74-e0723cdc8a9c")}catch{}})();function N(e){const o=e.tenantState.fetchState,i=e.tenantState.sendEmailMagicLinkFetchState;return{googleClientId:p.googleClientId,microsoftClientId:p.microsoftClientId,signInError:e.tenantState.error?.error,fetchState:o,sendMagicLinkStatus:i,showEmailLogin:!1}}function j(e,o){const{location:i,navigate:s}=o;return console.warn(JSON.stringify(window.location)),{onOAuthError:(n,t)=>{I({message:`OAuth error from provider ${t} with error ${n}`,level:"error",tags:{authProvider:t,errorType:"zeni.login.error"},extra:{error:n,windowLocation:window.location.href}})},onOAuthSuccess:(n,t)=>{const r=t==="google"?window.location.origin:window.location.origin+window.location.pathname;e(D({authCode:n,oauthProvider:t,appType:"web",redirectUri:u(r),sourceUri:u(i.state!=null?i.state.origin:"")}))},getSignedInUser:()=>g.getSignedInUser(),onSignedInCallback:()=>{const n=i.state?.origin;n&&n!=="/"?s(n,{replace:!0}):window.open(window.location.origin,"_self")},clearSignInError:()=>{e(z())}}}const k=b(N,j)(U),P=S.memo(k);function R(){const e=m(),o=w(),i=g.getSignedInUser(),s=d(a=>a.tenantState.fetchState),n=d(a=>a.tenantState.signInState),t=d(a=>a.tenantState.loggedInUser),r=C().mode,c=h();if(f.useEffect(()=>{n==="In-Progress"&&s==="Completed"&&t?.zeniSessionId!=null&&(g.saveSignedInUserWithSession(t,t.zeniSessionId),L(t.userId,t.zeniSessionId),e(x("Completed")),v.updateAppLocaleID("en"),A(t,r),setTimeout(()=>{E.trackLogin(T.Event.loginSuccess,t.authProvider??"google")},2e3))},[]),n==="In-Progress"&&s==="Completed"&&t?.zeniSessionId!=null||i!=null){const a=c.state?.origin??"/";return l.jsx(y,{to:a,state:{...c.state,origin:""}})}else return l.jsx(P,{navigate:o,location:c})}export{R as default};
|