import{d as j,iO as N,iP as X,iQ as q,iR as H,gO as K,b9 as W,u as J,b2 as U,ca as Y,e4 as Z,ax as F,hw as ee,W as se,m as te,hz as T,g6 as k,w as C,r as y,b as f,gs as ae,c as re,cz as ne,gN as ie,fi as oe,gK as ce,ff as le,dB as $,j as r,a$ as de,Q as P,ag as _,z as Q,bg as S,al as ue,b4 as A}from"./index-ea7817a2.js";import{f as fe,u as he}from"./index-6ffd126a.js";import{d as pe}from"./FileUploaderButton-495e1c87.js";import{P as me}from"./Panel-041c5d61.js";var ge=function(){function t(e,s){this.xf=s,this.f=e,this.all=!0}return t.prototype["@@transducer/init"]=N.init,t.prototype["@@transducer/result"]=function(e){return this.all&&(e=this.xf["@@transducer/step"](e,!0)),this.xf["@@transducer/result"](e)},t.prototype["@@transducer/step"]=function(e,s){return this.f(s)||(this.all=!1,e=X(this.xf["@@transducer/step"](e,!1))),e},t}(),xe=j(function(e,s){return new ge(e,s)}),Ve=j(q(["all"],xe,function(e,s){for(var a=0;a<s.length;){if(!e(s[a]))return!1;a+=1}return!0})),ve=j(function(e,s){return Ve(H(e),s)});const ye=ve,E=K(W.DATE_TIME.DATE),De=()=>{var b,D;const{id:t,fsId:e,fvName:s,fvVersion:a,tdVersion:i}=J(),o=U(),{pathname:h}=Y(),{currentData:c={items:[]}}=fe({pId:+t,fsId:+e,id:s}),{currentData:g,isFetching:p,refetch:m}=he({pId:+t,fsId:+e,id:s,version:+a,params:{expand:["features"]}}),{currentData:u={items:[]},refetch:x}=Z({pId:+t,fsId:+e,id:s,version:+a}),l=u.items.find(F("version",+i)),{currentData:n,isFetching:z}=ee({pId:+t,fsId:+e,fvName:s,fvVersion:+a,id:+i,params:{fields:"content"}},{skip:ye(F("version",+i),u.items)}),G=se(k(pe(C("version"))),te(({version:d,eventStartTime:V,eventEndTime:v})=>({key:d,label:`${d} (${E(T(V))} -> ${E(T(v))})`})))(u.items),R=y.useCallback(d=>{o(f.featureView.td.statistics,{fsId:e,fvName:s,fvVersion:d,tdVersion:+i})},[e,s,o,i]),L=y.useCallback(d=>{const V=[f.featureView.td.statistics,f.featureView.td.correlation].find(v=>ae(re(v,f.project.value),h))??f.featureView.td.statistics;o(V,{fsId:e,fvName:s,fvVersion:+a,tdVersion:+d.key})},[e,s,a,o,h]),[I,O]=ne("split",ie),w=n!=null&&n.entities?[]:k(oe(ce),le(n)),B=n!=null&&n.entities?n.entities.statistics:(D=(b=C(I??$(w),n))==null?void 0:b.entities)==null?void 0:D.statistics,M=y.useCallback(()=>{m(),x()},[x,m]);return{allFvs:c,fv:g,fvName:s,fvVersion:a,isFetching:p||z,handleTdVersionChange:L,handleVersionChange:R,refetchAllData:M,statistics:B,splitNames:w,setSplit:O,split:I,tdVersion:i,tdVersionOptions:G,trainingDataset:l}},Fe=({isFetching:t,fvName:e,fvVersion:s,allFvs:a,handleVersionChange:i,handleTdVersionChange:o,refetchAllData:h,splitNames:c,setSplit:g,split:p,tdVersion:m,tdVersionOptions:u,fv:x})=>r.jsxs(r.Fragment,{children:[t&&r.jsx(de,{}),r.jsx(me,{title:e,versions:(a==null?void 0:a.items)??[{version:+s}],version:+s,onVersionChange:i,idColor:"labels.purple",onClickRefresh:h,children:r.jsxs(P,{alignItems:"center",ml:"2px",children:[r.jsx(_,{icon:Q.arrow_right,color:"grayShade1"}),r.jsx(S,{width:"216px",value:+m,options:u,placeholder:"version",onChange:o,isMulti:!1,format:"fill"}),!ue(c)&&r.jsxs(r.Fragment,{children:[r.jsx(_,{icon:Q.arrow_right,color:"grayShade1"}),c.length>1?r.jsx(S,{width:"140px",value:p||$(c),options:c.map(l=>({key:l,label:l})),placeholder:"split",onChange:l=>g(l.key)}):r.jsxs(P,{alignItems:"flex-end",children:[r.jsx(A,{ml:"5px",color:"gray",children:"split"}),r.jsx(A,{mx:"5px",children:p})]})]})]})})]});export{Fe as T,De as u};
