"use strict";var e=require("@babel/runtime/helpers/defineProperty"),r=require("@babel/runtime/helpers/slicedToArray"),t=require("react"),n=require("prop-types"),i=require("@material-ui/core"),o=require("./DraggableList.js"),c=require("react/jsx-runtime");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u=l(e),a=l(r),s=l(n);function d(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),t.push.apply(t,n)}return t}function f(e){for(var r=1;r<arguments.length;r++){var t=null!=arguments[r]?arguments[r]:{};r%2?d(Object(t),!0).forEach((function(r){u.default(e,r,t[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(t)):d(Object(t)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(t,r))}))}return e}function p(e){var r=e.open,n=e.columns,l=e.handleCloseWithOK,u=e.handleCloseWithCancel,s=t.useState(n),d=a.default(s,2),p=d[0],b=d[1];t.useEffect((function(){b(n)}),[n]);return c.jsxs(i.Dialog,{disableBackdropClick:!0,disableEscapeKeyDown:!0,fullWidth:!0,maxWidth:"xs",open:r,children:[c.jsx(i.DialogTitle,{children:"Customize Columns"}),c.jsx(i.DialogContent,{children:c.jsx(o,{items:p,onSort:function(e){b(e)},onClick:function(e){var r=p.map((function(r){return r.key===e.key?f(f({},r),{},{show:!!r.disabled||!r.show}):r}));b(r)}})}),c.jsxs(i.DialogActions,{children:[c.jsx(i.Button,{autoFocus:!0,onClick:function(){b(n),u()},color:"primary",children:"Cancel"}),c.jsx(i.Button,{onClick:function(){l(p)},color:"primary",variant:"contained",children:"Ok"})]})]})}p.propTypes={open:s.default.bool.isRequired,handleCloseWithOK:s.default.func.isRequired,handleCloseWithCancel:s.default.func.isRequired,columns:s.default.array.isRequired},module.exports=p;
