import{__rest as r,__assign as l}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as e,jsx as i}from"react/jsx-runtime";import n from"prop-types";import{Table as o,TableHead as d,TableRow as t,TableCell as u,TableBody as c}from"@material-ui/core";import{useState as p}from"react";import a from"./ResizableTableHeaderCell.js";import s from"./ResizableTableCell.js";var v=function(n){var v,h,m,f,y,b=n.children,j=r(n,["children"]),k=b,x=k[0],C=k[1],R=null===(v=null==C?void 0:C.props)||void 0===v?void 0:v.children,T=null===(y=null===(f=null===(m=null===(h=null==x?void 0:x.props)||void 0===h?void 0:h.children)||void 0===m?void 0:m.props)||void 0===f?void 0:f.children)||void 0===y?void 0:y.reduce((function(r,l){return Array.isArray(l)?r.push.apply(r,l):r.push(l),r}),[]),z=p({}),A=z[0],N=z[1],g=function(r){return N((function(e){return l(l({},e),r)}))};return e(o,l({},j,{children:[i(d,{children:i(t,{children:null==T?void 0:T.map((function(r,e){var n;return r?e===T.length-1?i(u,l({},r.props,{children:null===(n=r.props)||void 0===n?void 0:n.children}),r.key||e):i(a,l({cellName:"cell".concat(e),nextCellName:"cell".concat(e+1),handleWidthsUpdate:g,widths:A},{children:r}),r.key||e):null}))})}),i(c,{children:null==R?void 0:R.map((function(r){var l,e;return i(t,{children:null===(e=null===(l=null==r?void 0:r.props)||void 0===l?void 0:l.children)||void 0===e?void 0:e.map((function(r,l){return r&&i(s,{children:r},r.key||l)}))},r.key)}))})]}))},h={children:n.arrayOf(n.node).isRequired};v.propTypes=h;export{v as default};
