import{_ as Y,hU as z,gA as B,bP as K,u as Z,bL as H,bq as U,hF as X,e4 as J,v as W,z as D,gO as ee,p as se,ax as te,gP as C,bM as P,X as T,r as g,s as u,fY as ae,q as re,cF as ie,gz as ne,eY as oe,l as ce,aY as le,aR as L,aN as de,aO as pe,j as s,L as ue,B as w,as as E,Z as S,bm as k,g as he,bK as A}from"./index-dP1W1_bd.js";import{C as me,f as fe}from"./FileUploaderButton-frSujVRY.js";import{p as ge}from"./Project-CsYwwOpN.js";import{P as xe}from"./Panel-M9AVvYdm.js";var Ve=Y(function(t,e){return me(z(t),e)});const _=B(K.DATE_TIME.DATE),be=()=>{var b,y;const{id:n,fsId:t,fvName:e,fvVersion:a,tdVersion:i}=Z(),o=H(),{pathname:h}=U(),{currentData:c={items:[]}}=X({pId:+n,fsId:+t,id:e}),{currentData:x,isFetching:m,refetch:f}=J({pId:+n,fsId:+t,id:e,version:+a,params:{expand:["features"]}}),{currentData:d={items:[]},refetch:p}=W({pId:+n,fsId:+t,id:e,version:+a}),Q=d.items.find(D("version",+i)),{currentData:r,isFetching:G}=ee({pId:+n,fsId:+t,fvName:e,fvVersion:+a,id:+i,params:{fields:"content"}},{skip:Ve(D("version",+i),d.items)}),N=se(P(fe(T("version"))),te(({version:l,eventStartTime:v,eventEndTime:j})=>({value:`${l}`,label:`${l} (${_(C(v))} -> ${_(C(j))})`})))(d.items),R=g.useCallback(l=>{o(u.featureView.td.statistics,{fsId:t,fvName:e,fvVersion:l,tdVersion:+i})},[t,e,o,i]),$=g.useCallback(l=>{const v=[u.featureView.td.statistics,u.featureView.td.correlation].find(j=>ae(re(j,u.project.value),h))??u.featureView.td.statistics;o(v,{fsId:t,fvName:e,fvVersion:+a,tdVersion:+l})},[t,e,a,o,h]),[I,q]=ie("split",ne),F=r!=null&&r.entities?[]:P(oe(ce),le(r)),V=r!=null&&r.entities?r.entities.statistics:(y=(b=T(I??L(F),r))==null?void 0:b.entities)==null?void 0:y.statistics,M=g.useMemo(()=>de(ge(pe,["extendedStatistics","correlations"]),V??{}),[V]),O=g.useCallback(()=>{f(),p()},[p,f]);return{allFvs:c,correlations:M,fv:x,fvName:e,fvVersion:a,handleTdVersionChange:$,handleVersionChange:R,isFetching:m||G,refetchAllData:O,statistics:V,splitNames:F,setSplit:q,split:I,tdVersion:i,tdVersionOptions:N,trainingDataset:Q}},ye=({isFetching:n,fvName:t,fvVersion:e,allFvs:a,handleVersionChange:i,handleTdVersionChange:o,refetchAllData:h,splitNames:c,setSplit:x,split:m,tdVersion:f,tdVersionOptions:d})=>s.jsxs(s.Fragment,{children:[n&&s.jsx(ue,{}),s.jsx(xe,{title:t,versions:(a==null?void 0:a.items)??[{version:+e}],version:+e,onVersionChange:i,idColor:"labels.purple",onClickRefresh:h,children:s.jsxs(w,{alignItems:"center",ml:"2px",children:[s.jsx(E,{icon:S.arrow_right,color:"grayShade1"}),s.jsx(k,{width:"216px",value:f,options:d,placeholder:"version",onChange:o}),!he(c)&&s.jsxs(s.Fragment,{children:[s.jsx(E,{icon:S.arrow_right,color:"grayShade1"}),c.length>1?s.jsx(k,{width:"140px",value:m||L(c),options:c.map(p=>({value:p,label:p})).reverse(),placeholder:"split",onChange:x}):s.jsxs(w,{alignItems:"flex-end",children:[s.jsx(A,{ml:"5px",color:"gray",children:"split"}),s.jsx(A,{mx:"5px",children:m})]})]})]})})]});export{ye as T,be as u};
