import e from"@babel/runtime/helpers/slicedToArray";import{useState as r,useEffect as t}from"react";import i from"prop-types";import{withStyles as a,Tooltip as o,TextField as s}from"@material-ui/core";import{debounce as n}from"lodash";import{jsx as l}from"react/jsx-runtime";var u=n((function(e){e()}),1500);function d(i){var a=i.radius,n=i.editable,d=i.onChange,m=i.classes,p=i["data-testid"],c=r(a),f=e(c,2),b=f[0],h=f[1],g=r(null),v=e(g,2),R=v[0],C=v[1];t((function(){h(a)}),[a]);return l(o,{title:n?"":"To make radius active select Subject Well.",children:l(s,{"data-testid":p,type:"number",label:"Radius (miles)",value:b,disabled:!n,onChange:function(e){var r=e.target.value;!Number.isFinite(+r)||+r<0?C("Incorrect radius"):(C(null),u((function(){d(+r)}))),h(r)},error:!!R,helperText:R,className:m.formControl})})}d.propTypes={radius:i.number.isRequired,editable:i.bool.isRequired,onChange:i.func.isRequired,classes:i.shape({}).isRequired,"data-testid":i.string},d.defaultProps={"data-testid":"RadiusInput"};var m=a({formControl:{width:130,marginLeft:10,marginTop:8}})(d);export{m as default};
