import{r as j,j as e}from"./vendor-react-wBh_31cN.js";import{a as C,b as F,C as c}from"./index.esm-CAGtek53.js";import{C as o}from"./checkbox-DbZXziG0.js";import{L as l}from"./label-Dnebucx5.js";import{I as N}from"./input-H6_qmzms.js";import{R as v,a0 as m}from"./index-BKr2rJhV.js";import{T as x}from"./tooltip-Da8-EbK8.js";import{u as q}from"./useUpdateTdOrFvInfoService-YRu8cKIO.js";const B=({isLoading:n})=>{const{setValue:r,control:a}=C(),[i,h,b,g,u,p]=F({name:["enabled","histograms","correlations","exactUniqueness","kll","histogramBins"]});return q({enabled:i,histograms:h,correlations:b,exactUniqueness:g,kll:u,histogramBins:p}),j.useEffect(()=>{i||(r("histograms",!1),r("correlations",!1),r("exactUniqueness",!1),r("kll",!1),r("histogramBins",void 0))},[i]),e.jsxs(e.Fragment,{children:[e.jsx(v,{bold:!0,className:"mb-2",children:"Statistic configuration"}),e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(c,{control:a,name:"enabled",render:({field:{onChange:t,value:s}})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o,{id:"stats-enabled",checked:s,disabled:n,onCheckedChange:()=>{t(!s),s&&r("statisticsColumns",[])}}),e.jsx(l,{htmlFor:"stats-enabled",children:"enable statistics"})]})}),e.jsx(x,{content:"Includes descriptive statistics",children:e.jsx("span",{children:e.jsx(m,{icon:"info_block",size:"xs"})})})]}),e.jsx(c,{control:a,name:"histograms",render:({field:{onChange:t,value:s}})=>e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(o,{id:"stats-histograms",checked:s,disabled:!i||n,onCheckedChange:()=>t(!s)}),e.jsx(l,{htmlFor:"stats-histograms",children:"histograms"})]})}),e.jsx("div",{className:"ml-6 mb-2",children:e.jsx(c,{control:a,name:"histogramBins",render:({field:{onChange:t,value:s}})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(N,{type:"number",step:"1",min:"1",placeholder:"20",label:"Histogram bins",disabled:!i||!h||n,value:s??"",onChange:k=>{const f=k.target.value;if(f===""){t(void 0);return}const d=Number(f);t(Number.isFinite(d)&&d>=1?d:void 0)}}),e.jsx(x,{content:"Bucket count for histograms (default 20).",children:e.jsx("span",{children:e.jsx(m,{icon:"info_block",size:"xs"})})})]})})}),e.jsx(c,{control:a,name:"correlations",render:({field:{onChange:t,value:s}})=>e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(o,{id:"stats-correlations",checked:s,disabled:!i||n,onCheckedChange:()=>t(!s)}),e.jsx(l,{htmlFor:"stats-correlations",children:"correlations"})]})}),e.jsx(c,{control:a,name:"exactUniqueness",render:({field:{onChange:t,value:s}})=>e.jsxs("div",{className:"mb-2 flex items-center gap-2",children:[e.jsx(o,{id:"stats-exact-uniqueness",checked:s,disabled:!i||n,onCheckedChange:()=>t(!s)}),e.jsx(l,{htmlFor:"stats-exact-uniqueness",children:"exact uniqueness"})]})}),e.jsx(c,{control:a,name:"kll",render:({field:{onChange:t,value:s}})=>e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(o,{id:"stats-kll",checked:!!s,disabled:!i||n,onCheckedChange:()=>t(!s)}),e.jsx(l,{htmlFor:"stats-kll",children:"KLL sketch"}),e.jsx(x,{content:"KLL mergeable sketch; required for rolling-window PDF monitoring.",children:e.jsx("span",{children:e.jsx(m,{icon:"info_block",size:"xs"})})})]})})]})},K=j.memo(B);export{K as S};
