import{u as F,bJ as l,q as u,bo as V,bI as y,r as m,o as S,aJ as L,gi as P,eE as N,bx as k,by as w,j as i,cq as R,D as G,h as q,bT as J,ef as $}from"./index-Cc-6WbPt.js";import{P as H}from"./Panel-BCZwmXoJ.js";import{C as M}from"./Correlation-CYRgeKVJ.js";import{u as O}from"./useUserPermissions-BZCaq9wv.js";import{u as U}from"./useFeatureGroupView-c5Pf49JZ.js";import{u as Y}from"./useFeatureGroupVersions-BcL23mBJ.js";import"./Deprecated-BleiYoSW.js";import"./Project-BB6nGAyP.js";import"./alertManagerConfig.selectors-ob2Z93Rq.js";import"./complement-BOrTcrWV.js";import"./index-DeWhk8_Z.js";import"./useScreenWithScroll-zcr7TMGO.js";import"./symmetricDifference-FE3v46aY.js";import"./git-BLdzamrJ.js";import"./useCopyToClipboard-CGP_51ct.js";import"./Anchor-BpzIF9LH.js";import"./transform-DZgNhtp2.js";import"./string-CFFdVFMV.js";import"./linear-Fo8SwKqx.js";import"./project-BdhY6ntx.js";const pt=()=>{const{id:e,fsId:r,fgId:o,computationTime:a}=F(),d=l(s=>{var c;return(c=s.featureGroupStatistics)==null?void 0:c.entities.statistics}),g=l(s=>s.loading.effects.featureGroupStatistics.fetch),C=l(s=>s.featureGroupStatisticsCommits),{isLoading:h,data:t}=U(+e,+o,+r),{currentData:I=[t],isFetching:x,handleVersionChange:b}=Y(t==null?void 0:t.name,u.project.featureGroup.correlation),p=V(),n=y(),{canEdit:v,isLoading:D,isDataScientist:j}=O();m.useEffect(()=>{n.featureGroupStatisticsCommits.fetch({projectId:+e,featureStoreId:+r,featureGroupId:+o}),n.featureGroupStatistics.fetch({projectId:+e,featureStoreId:+r,featureGroupId:+o,computationTime:a})},[e,o,n,r,a]);const T=m.useCallback(()=>{n.featureGroupStatisticsCommits.fetch({projectId:+e,featureStoreId:+r,featureGroupId:+o}),n.featureGroupStatistics.fetch({projectId:+e,featureStoreId:+r,featureGroupId:+o,computationTime:a})},[n.featureGroupStatisticsCommits,n.featureGroupStatistics,e,r,o,a]),E=m.useCallback((s,c=o)=>{s&&a!==s&&p(S(u.project.featureGroup.correlationViewCommit,u.project.value,{id:e,fsId:r,fgId:c,computationTime:s}))},[e,r,p,o,a]),f=m.useMemo(()=>L(P(N,["extendedStatistics","correlations"]),d??{}),[d]);return k(`${w.correlation} ${t!=null&&t.name?t.name:"Feature group"}`),!h&&!t?i.jsx(R,{}):h?i.jsx(G,{}):i.jsxs(i.Fragment,{children:[i.jsx(H,{title:t.name,data:t,idColor:(t==null?void 0:t.type)==="onDemandFeaturegroupDTO"?"labels.blue":"labels.orange",isEditDisabled:!v||j||D,onClickEdit:()=>p(S(u.project.featureGroup.edit,u.project.value,{id:e,fsId:r,fgId:o})),onClickRefresh:T,version:t==null?void 0:t.version,versions:I||[],isVersionsLoading:x,onVersionChange:b,hasCommits:!0,commits:C||[],commit:a,handleCommitChange:E,pathnamePostFix:"/correlation",editRightText:j?"Your role is not allowed to perform this action":void 0}),g&&i.jsx(G,{}),!g&&(!f||q(f)?i.jsx(J,{mainText:"No feature correlation",secondaryText:""}):i.jsx(M,{item:t,correlation:f,type:$.fg}))]})};export{pt as default};
