"use strict";var e=require("prop-types"),t=require("@material-ui/core"),r=require("@material-ui/icons"),a=require("classnames"),i=require("react/jsx-runtime");function o(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var n=o(a),l=t.makeStyles((function(e){return{wellCell:{minWidth:function(e){var t=e.isTablet,r=e.isMobile;return t||!r?"330px":"180px"},maxWidth:function(e){var t=e.isTablet,r=e.isMobile;return!t&&r&&"200px"},position:"sticky",left:0,zIndex:1,background:e.palette.background.b9},wellName:{display:"-webkit-box",alignItems:"center",overflow:"hidden",WebkitLineClamp:2,WebkitBoxOrient:"vertical",overflowWrap:"break-word"},iconCell:{textAlign:"center",width:"60px"},rightAlign:{textAlign:"center"},doneIcon:{height:"16px",color:e.palette.primary.light},shadow:{position:"sticky",zIndex:10,border:0,padding:0,margin:0,"&::after":{content:"' '",pointerEvents:"none",position:"absolute"}},topShadow:{height:0,top:"48px","&::after":{left:0,right:0,height:"16px",background:"linear-gradient(0deg, rgba(65, 65, 65, 0) 0%, ".concat(e.palette.background.b9," 100%)")}},bottomShadow:{height:0,bottom:"16px","&::after":{left:0,right:0,height:"16px",background:"linear-gradient(180deg, rgba(65, 65, 65, 0) 0%, ".concat(e.palette.background.b9," 100%)")}},rightShadow:{right:0,padding:"0 !important","&::after":{width:"16px",top:0,bottom:0,right:0,background:"linear-gradient(90deg, rgba(65, 65, 65, 0) 0%, ".concat(e.palette.background.b9," 100%)")}}}}));function s(e,t,r){return t[r]<e[r]?-1:t[r]>e[r]?1:0}function d(e,t){return"desc"===e?function(e,r){return s(e,r,t)}:function(e,r){return-s(e,r,t)}}var c=t.withStyles({root:{boxSizing:"border-box",padding:"6px 8px !important"}})(t.TableCell);function u(e){var a,o,s,u=e.rows,b=e.headCells,p=e.order,h=e.orderBy,g=e.isTablet,x=e.isMobile,f=l({isTablet:g,isMobile:x});return i.jsxs(t.TableBody,{children:[u.length>0&&i.jsx(t.TableRow,{children:i.jsx(t.TableCell,{colSpan:"100%",className:n.default(f.shadow,f.topShadow)})}),(a=u,o=d(p,h),s=a.map((function(e,t){return[e,t]})),s.sort((function(e,t){var r=o(e[0],t[0]);return 0!==r?r:e[1]-t[1]})),s.map((function(e){return e[0]}))).map((function(e,a){return i.jsxs(t.TableRow,{children:[i.jsx(c,{id:"enhanced-table-checkbox-".concat(a),scope:"row",className:f.wellCell,children:i.jsx(t.Typography,{variant:"body2",className:f.wellName,children:e.name})}),b.map((function(t){return i.jsx(c,{className:f.iconCell,children:e[t.id]?i.jsx(r.Done,{className:f.doneIcon}):""},"offset-well-table-row-".concat(t.id))})),i.jsx(t.TableCell,{colSpan:"100%",className:n.default(f.shadow,f.rightShadow)})]},e.id)})),u.length>0&&i.jsx(t.TableRow,{children:i.jsx(t.TableCell,{colSpan:"100%",className:n.default(f.shadow,f.bottomShadow)})})]})}u.propTypes={rows:e.arrayOf(e.shape({})).isRequired,headCells:e.arrayOf(e.shape({})).isRequired,order:e.string.isRequired,orderBy:e.string.isRequired,isTablet:e.bool.isRequired,isMobile:e.bool.isRequired},module.exports=u;
//# sourceMappingURL=OffsetWellTableRows.js.map
