"use strict";var e=require("@babel/runtime/helpers/defineProperty"),r=require("react"),i=require("prop-types"),t=require("@material-ui/core"),o=require("@material-ui/icons");require("./DrillPipe/Browser.js");var s=require("./DrillPipe/Editor.js");require("./Agitator/Browser.js");var n=require("./Agitator/Editor.js");require("./Bit/Browser.js");var a=require("./Bit/Editor.js");require("./DrillCollar/Browser.js");var l=require("./DrillCollar/Editor.js");require("./Jar/Browser.js");var c=require("./Jar/Editor.js");require("./Lwd/Browser.js");var u=require("./Lwd/Editor.js");require("./Mwd/Browser.js");var d=require("./Mwd/Editor.js");require("./Pdm/Browser.js");var p=require("./Pdm/Editor.js");require("./Rss/Browser.js");var j=require("./Rss/Editor.js");require("./Stabilizer/Browser.js");var g=require("./Stabilizer/Editor.js");require("./Sub/Browser.js");var f=require("./Sub/Editor.js");require("./Ur/Browser.js");var b=require("./Ur/Editor.js"),x=require("../../../../constants/drillstring.js"),m=require("react/jsx-runtime");function h(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var q=h(e),v=h(i);function w(e,r){var i=Object.keys(e);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(e);r&&(t=t.filter((function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable}))),i.push.apply(i,t)}return i}function y(e){for(var r=1;r<arguments.length;r++){var i=null!=arguments[r]?arguments[r]:{};r%2?w(Object(i),!0).forEach((function(r){q.default(e,r,i[r])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(i)):w(Object(i)).forEach((function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(i,r))}))}return e}var C=t.makeStyles((function(e){return{paper:{background:e.isLightTheme?e.palette.primary.text1:e.palette.background.b5},dialogTitle:{padding:"12px 0",borderBottom:"1px solid ".concat(e.palette.background.b7)},titleWrapper:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"0 16px"},title:{fontSize:"20px",fontWeight:400},closeIcon:{color:e.palette.primary.text6,"&:hover":{color:e.palette.primary.text1}},dialogContent:{padding:"0px 0px 0px 16px",flexDirection:"column",height:"100%",width:"100%",position:"relative"},dialogActions:{padding:"8px 16px",justifyContent:"space-between"},contentView:{display:"flex",height:"100%"},componentListView:{height:"100%",flex:1,overflowY:"auto",paddingRight:"16px"},bottomGradient:{position:"absolute",height:"16px",left:0,right:0,bottom:0,background:"linear-gradient(180deg, rgba(33, 33, 33, 0) 0%, ".concat(e.palette.background.b5," 100%)")}}}));function B(e){var r=e.component,i=e.isDraft,h=e.error,q=e.onChange,v=e.onUseSuggestion,w=e.onCancel,B=e.onSave,O=e.onClose,D={component:r,isDraft:i,error:h,onChange:q,onUseSuggestion:v,onCancel:w,onSave:B},E=C(),S=r.family;return m.jsxs(t.Dialog,{open:!0,onBackdropClick:O,onEscapeKeyDown:O,maxWidth:"xs",fullWidth:!0,fullScreen:!0,classes:{paper:E.paper},children:[m.jsx(t.DialogTitle,{className:E.dialogTitle,children:m.jsxs("div",{className:E.titleWrapper,children:[m.jsx(t.Typography,{className:E.title,children:function(e){if(!e)return"—";var r=x.COMPONENT_FAMILIES.drilling.find((function(r){return r.type===e}));return(null==r?void 0:r.name)||e.toUpperCase()}(S)}),m.jsx(o.Close,{onClick:O,className:E.closeIcon})]})}),m.jsx(t.DialogContent,{className:E.dialogContent,children:m.jsxs("div",{className:E.contentView,children:[m.jsxs("div",{className:E.componentListView,children:[("dp"===S||"hwdp"===S)&&m.jsx(s,y(y({},D),{},{isMobile:!0})),"stabilizer"===S&&m.jsx(g,y(y({},D),{},{isMobile:!0})),"dc"===S&&m.jsx(l,y(y({},D),{},{isMobile:!0})),"jar"===S&&m.jsx(c,y(y({},D),{},{isMobile:!0})),"sub"===S&&m.jsx(f,y(y({},D),{},{isMobile:!0})),"mwd"===S&&m.jsx(d,y(y({},D),{},{isMobile:!0})),"agitator"===S&&m.jsx(n,y(y({},D),{},{isMobile:!0})),"rss"===S&&m.jsx(j,y(y({},D),{},{isMobile:!0})),"pdm"===S&&m.jsx(p,y(y({},D),{},{isMobile:!0})),"bit"===S&&m.jsx(a,y(y({},D),{},{isMobile:!0})),"lwd"===S&&m.jsx(u,y(y({},D),{},{isMobile:!0})),"ur"===S&&m.jsx(b,y(y({},D),{},{isMobile:!0}))]}),m.jsx("div",{className:E.bottomGradient})]})}),m.jsxs(t.DialogActions,{className:E.dialogActions,children:[m.jsx(t.Button,{startIcon:m.jsx(o.ArrowBackIos,{}),onClick:O}),m.jsxs("div",{children:[m.jsx(t.Button,{color:"primary",style:{marginRight:"12px"},onClick:O,children:"Cancel"}),m.jsx(t.Button,{variant:"contained",color:"primary",onClick:B,children:"Save"})]})]})]})}B.propTypes={component:v.default.shape({family:v.default.string}).isRequired,isDraft:v.default.bool.isRequired,error:v.default.shape({}).isRequired,onChange:v.default.func.isRequired,onUseSuggestion:v.default.func.isRequired,onCancel:v.default.func.isRequired,onSave:v.default.func.isRequired,onClose:v.default.func.isRequired};var O=r.memo(B);module.exports=O;
