import{_ as H,hs as O,g4 as U,bm as Y,u as z,bg as J,aY as K,hd as W,dv as X,t as Z,A as F,gl as ee,f as se,as as te,gm as w,bi as C,U as b,r as g,q as p,fn as ae,o as ie,cf as re,g3 as ne,ey as oe,l as ce,dL as de,dD as _,aB as le,dQ as ue,j as s,L as pe,d as E,an as P,T as S,aQ as Q,g as he,aV as k}from"./index-CK33qGU_.js";import{E as me,d as fe}from"./FileUploaderButton-Bppadu35.js";import{p as ge}from"./pathSatisfies-CSrP04yE.js";import{P as xe}from"./Panel-q_vviXAK.js";var Ve=H(function(t,e){return me(O(t),e)});const A=U(Y.DATE_TIME.DATE),De=()=>{var D,T;const{id:n,fsId:t,fvName:e,fvVersion:a,tdVersion:r}=z(),o=J(),{pathname:h}=K(),{currentData:c={items:[]}}=W({pId:+n,fsId:+t,id:e}),{currentData:x,isFetching:m,refetch:f}=X({pId:+n,fsId:+t,id:e,version:+a,params:{expand:["features"]}}),{currentData:l={items:[]},refetch:u}=Z({pId:+n,fsId:+t,id:e,version:+a}),L=l.items.find(F("version",+r)),{currentData:i,isFetching:G}=ee({pId:+n,fsId:+t,fvName:e,fvVersion:+a,id:+r,params:{fields:"content"}},{skip:Ve(F("version",+r),l.items)}),$=se(C(fe(b("version"))),te(({version:d,eventStartTime:v,eventEndTime:j})=>({value:`${d}`,label:`${d} (${A(w(v))} -> ${A(w(j))})`})))(l.items),R=g.useCallback(d=>{o(p.featureView.td.statistics,{fsId:t,fvName:e,fvVersion:d,tdVersion:+r})},[t,e,o,r]),q=g.useCallback(d=>{const v=[p.featureView.td.statistics,p.featureView.td.correlation].find(j=>ae(ie(j,p.project.value),h))??p.featureView.td.statistics;o(v,{fsId:t,fvName:e,fvVersion:+a,tdVersion:+d})},[t,e,a,o,h]),[I,M]=re("split",ne),y=i!=null&&i.entities?[]:C(oe(ce),de(i)),V=i!=null&&i.entities?i.entities.statistics:(T=(D=b(I??_(y),i))==null?void 0:D.entities)==null?void 0:T.statistics,N=g.useMemo(()=>le(ge(ue,["extendedStatistics","correlations"]),V??{}),[V]),B=g.useCallback(()=>{f(),u()},[u,f]);return{allFvs:c,correlations:N,fv:x,fvName:e,fvVersion:a,handleTdVersionChange:q,handleVersionChange:R,isFetching:m||G,refetchAllData:B,statistics:V,splitNames:y,setSplit:M,split:I,tdVersion:r,tdVersionOptions:$,trainingDataset:L}},Te=({isFetching:n,fvName:t,fvVersion:e,allFvs:a,handleVersionChange:r,handleTdVersionChange:o,refetchAllData:h,splitNames:c,setSplit:x,split:m,tdVersion:f,tdVersionOptions:l})=>s.jsxs(s.Fragment,{children:[n&&s.jsx(pe,{}),s.jsx(xe,{title:t,versions:(a==null?void 0:a.items)??[{version:+e}],version:+e,onVersionChange:r,idColor:"labels.purple",onClickRefresh:h,children:s.jsxs(E,{alignItems:"center",ml:"2px",children:[s.jsx(P,{icon:S.arrow_right,color:"grayShade1"}),s.jsx(Q,{width:"216px",value:f,options:l,placeholder:"version",onChange:o}),!he(c)&&s.jsxs(s.Fragment,{children:[s.jsx(P,{icon:S.arrow_right,color:"grayShade1"}),c.length>1?s.jsx(Q,{width:"140px",value:m||_(c),options:c.map(u=>({value:u,label:u})).reverse(),placeholder:"split",onChange:x}):s.jsxs(E,{alignItems:"flex-end",children:[s.jsx(k,{ml:"5px",color:"gray",children:"split"}),s.jsx(k,{mx:"5px",children:m})]})]})]})})]});export{Te as T,De as u};
