"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("@babel/runtime/helpers/slicedToArray"),s=require("react"),o=require("prop-types"),c=require("@material-ui/core"),r=require("./AutoCompleteAssetSearch.js"),n=require("./AdvancedSearch.module.css.js");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/Dashboard.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");var i=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("../../../../../icons/customIcons/icons/MoreApp.js");var t=require("react/jsx-runtime");function u(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a=u(e),l=u(o),d=function(e){var o=e.companyId,u=e.subjectWellId,l=e.onChange,d=e.selectedWellIds,m=e.onHideAdvancedSearch,j=s.useState(null),q=a.default(j,2),I=q[0],h=q[1],p=s.useState(""),f=a.default(p,2),v=f[0],C=f[1],b=s.useRef(),x=function(){C(""),h(null),m()};return t.jsxs(t.Fragment,{children:[t.jsx(c.TextField,{"data-testid":"ows_advanced_search",id:"well-section-search-textfield",placeholder:"Add Offset ...",InputProps:{startAdornment:t.jsx(c.InputAdornment,{position:"start",children:t.jsx(i.SearchIcon,{size:"small",className:n.searchIcon})}),className:n.searchInput},classes:{root:n.searchRoot},ref:b,value:v,onChange:function(e){C(e.target.value),e.target.value&&h(b.current)},onClick:function(e){h(e.currentTarget)}}),t.jsx(c.Popover,{open:Boolean(I),anchorEl:I,onClose:x,anchorOrigin:{vertical:"top",horizontal:"left"},transformOrigin:{vertical:"top",horizontal:"left"},children:t.jsx(r,{subjectWellId:u,value:v,company:o,selectedWellIds:d,onChange:l,onClose:x})})]})};d.propTypes={companyId:l.default.number.isRequired,subjectWellId:l.default.number.isRequired,onChange:l.default.func.isRequired,selectedWellIds:l.default.arrayOf(l.default.number).isRequired,onHideAdvancedSearch:l.default.func.isRequired},exports.AdvancedSearch=d;
