import e from"@babel/runtime/helpers/defineProperty";import r from"@babel/runtime/helpers/slicedToArray";import{useState as t}from"react";import o from"prop-types";import n from"moment";import{KeyboardDateTimePicker as a}from"@material-ui/pickers";import{jsx as i}from"react/jsx-runtime";function m(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);r&&(o=o.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,o)}return t}function c(r){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?m(Object(o),!0).forEach((function(t){e(r,t,o[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(r,Object.getOwnPropertyDescriptors(o)):m(Object(o)).forEach((function(e){Object.defineProperty(r,e,Object.getOwnPropertyDescriptor(o,e))}))}return r}var p=["MM/DD/YYYY HH:mm","M/D/YYYY HH:mm","MM/DD/YYYY, HH:mm","M/D/YYYY, HH:mm","MMM DD, YYYY HH:mm","MMM D, YYYY HH:mm","MM/DD/YY HH:mm","M/D/YY HH:mm"],f=new RegExp("[^\\.\\ \\,\\[a-zA-Z0-9_]*$]+","gi"),Y=function(e){var o=e.format,m=e.onChange,Y=e.label,s=e["data-testid"],u=t(o),l=r(u,2),b=l[0],D=l[1],d=t(null),H=r(d,2),y=H[0],M=H[1];return i(a,c(c({rifmFormatter:function(e){return e},refuse:f,inputValue:y},e),{},{"data-testid":"".concat(s,"_").concat(Y),format:b,onChange:function(e,r){var t=n(r,[].concat(p,[o]),!0),a=t.isValid();D((function(e){return a?t.creationData().format:e})),M(r),m(a?t:e,r)}}))};Y.propTypes={onChange:o.func.isRequired,format:o.string,label:o.string,"data-testid":o.string},Y.defaultProps={format:"MM/DD/YYYY HH:mm",label:"Date","data-testid":"KeyboardDateTimePicker"};export{Y as default};
//# sourceMappingURL=KeyboardDateTimePicker.js.map
