"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require('./../../../ext-esm/tslib/tslib.es6.js'),s=require("react/jsx-runtime"),o=require("react"),i=require("@material-ui/core"),r=require("../../Modal/Modal.js"),n=require("../../Button/components/Button/index.js");require("moment-timezone"),require("classnames"),require("../../../icons/WithCustomSize.js"),require("../../../icons/IconParkProvider.js"),require("../../../icons/customIcons/icons/AddMessage.js"),require("../../../icons/customIcons/icons/Attention.js"),require("../../../icons/customIcons/icons/Collapse.js"),require("../../../icons/customIcons/icons/Expand.js"),require("../../../icons/customIcons/icons/FolderClosed.js"),require("../../../icons/customIcons/icons/FolderClosedFilled.js"),require("../../../icons/customIcons/icons/FolderOpened.js"),require("../../../icons/customIcons/icons/GreaterOrEqual.js"),require("../../../icons/customIcons/icons/LessOrEqual.js"),require("../../../icons/customIcons/icons/Search.js"),require("../../../icons/customIcons/icons/Wellhub.js"),require("../../../icons/customIcons/icons/MultiRuler.js"),require("../../../icons/customIcons/icons/Checkbox.js"),require("../../../icons/customIcons/icons/CheckboxChecked.js"),require("../../../icons/customIcons/icons/CheckboxIndeterminate.js"),require("../../../icons/customIcons/icons/Radio.js"),require("../../../icons/customIcons/icons/RadioChecked.js"),require("../../../icons/customIcons/icons/SimulFrac.js"),require("../../../icons/customIcons/icons/ZipperFrac.js"),require("../../../icons/customIcons/icons/CautionFilled.js"),require("../../Button/components/LiveButton/components/LiveButtonStateIndicator/index.js"),require("../../Button/components/LiveButton/styles.js");var t=require("../../Select/index.js"),c=require("../../Search/utils/truncate.js"),u=i.makeStyles((function(e){return{container:{width:472,color:e.palette.primary.text6,display:"flex",flexDirection:"column",gap:16},helpText:{fontSize:16,lineHeight:"22px"},clearAllButton:{margin:"0 16px 0 auto"},textField:{"& .MuiInput-formControl":{marginTop:8}},popover:{marginTop:8,maxHeight:500,width:"100%"}}}));exports.ReportIssueModal=function(a){var l,m=a.assets,d=a.onSave,j=a.onClose,p=u(),q=o.useState(""),h=q[0],x=q[1],I=o.useState(null===(l=m[0])||void 0===l?void 0:l.id),v=I[0],g=I[1],C=m.length>1;return s.jsx(r,e.__assign({open:!0,onClose:j,title:"Report Data Quality Issue",actions:s.jsxs(s.Fragment,{children:[s.jsx(n,e.__assign({color:"primary",className:p.clearAllButton,onClick:j},{children:"Cancel"})),s.jsx(n,e.__assign({disabled:!h||C&&!v,onClick:function(){d(h,v),x(""),g(""),C||j()},variation:"primary"},{children:"report data issue"}))]})},{children:s.jsxs("div",e.__assign({className:p.container},{children:[s.jsx("div",e.__assign({className:p.helpText},{children:"All issues are submitted to the Corva’s 24/7 Fusion data quality team for immediate review and remediation."})),C&&s.jsx(t,e.__assign({MenuProps:{anchorOrigin:{vertical:"bottom",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},PopoverClasses:{root:p.popover}},label:"Select Asset",onChange:function(e){return g(e.target.value)},value:v},{children:m.map((function(o){return s.jsx(i.MenuItem,e.__assign({value:o.id},{children:c.truncateString(o.name,{maxChars:50,charsNumFromStart:26,charsNumFromEnd:24})}),o.id)}))})),s.jsx(i.TextField,{className:p.textField,multiline:!0,rows:1,rowsMax:4,label:"Error Description",onChange:function(e){return x(e.target.value)},value:h})]}))}))};
