"use strict";(self.webpackChunkgrafana=self.webpackChunkgrafana||[]).push([[3001],{93001(v,C,a){a.d(C,{HistogramTransformerEditor:()=>k});var t=a(14553),u=a(55501),n=a(1984),d=a(52358),o=a(72480),b=a(6634),E=a(29798),_=a(86979),c=a(75251);const k=({input:D,options:e,onChange:s})=>{const[r,i]=(0,u.useState)({bucketCount:!(0,c.N_)(e.bucketCount||""),bucketSize:!(0,c.N_)(e.bucketSize||""),bucketOffset:!(0,c.N_)(e.bucketOffset||"")}),m=(0,u.useCallback)(l=>{i({...r,bucketCount:!(0,c.N_)(l)}),s({...e,bucketCount:Number(l)===0?void 0:Number(l)})},[s,e,r]),O=(0,u.useCallback)(l=>{i({...r,bucketSize:!(0,c.N_)(l)}),s({...e,bucketSize:l})},[s,e,r,i]),h=(0,u.useCallback)(l=>{i({...r,bucketOffset:!(0,c.N_)(l)}),s({...e,bucketOffset:l})},[s,e,r,i]),g=(0,u.useCallback)(()=>{s({...e,combine:!e.combine})},[s,e]),f=(0,c.I9)();return(0,t.jsxs)("div",{children:[(0,t.jsx)(b.C,{children:(0,t.jsx)(o.I,{invalid:r.bucketCount,error:"Value needs to be an integer or a variable",labelWidth:18,label:n.Rt.bucketCount.name,tooltip:n.Rt.bucketCount.description,children:(0,t.jsx)(_.y,{suggestions:f,value:e.bucketCount,placeholder:(0,d.t)("transformers.histogram-transformer-editor.placeholder-default","Default: 30"),onChange:m})})}),(0,t.jsx)(b.C,{children:(0,t.jsx)(o.I,{invalid:r.bucketSize,error:"Value needs to be an integer or a variable",labelWidth:18,label:n.Rt.bucketSize.name,tooltip:n.Rt.bucketSize.description,children:(0,t.jsx)(_.y,{suggestions:f,value:e.bucketSize,placeholder:(0,d.t)("transformers.histogram-transformer-editor.placeholder-auto","Auto"),onChange:O})})}),(0,t.jsx)(b.C,{children:(0,t.jsx)(o.I,{labelWidth:18,label:n.Rt.bucketOffset.name,tooltip:n.Rt.bucketOffset.description,invalid:r.bucketOffset,error:"Value needs to be an integer or a variable",children:(0,t.jsx)(_.y,{suggestions:f,value:e.bucketOffset,placeholder:(0,d.t)("transformers.histogram-transformer-editor.placeholder-none","None"),onChange:h})})}),(0,t.jsx)(b.C,{children:(0,t.jsx)(o.I,{labelWidth:18,label:n.Rt.combine.name,tooltip:n.Rt.combine.description,children:(0,t.jsx)(E.K,{value:e.combine??!1,onChange:g})})})]})}}}]);

//# sourceMappingURL=3001-react19.67860df6adb7870964d7.js.map