import{__assign as o}from'./../../ext-esm/tslib/tslib.es6.js';import{jsxs as i,jsx as s}from"react/jsx-runtime";import{useState as t}from"react";import n from"prop-types";import e from"classnames";import{makeStyles as c,Typography as r,Tooltip as l}from"@material-ui/core";import{Info as a}from"@material-ui/icons";import m from"../IconButton/index.js";import{WriteIcon as p,UpIcon as d,DownIcon as u}from"../../icons/iconParkIcons.js";import"../../icons/customIcons/icons/AddMessage.js";import"../../icons/customIcons/icons/Attention.js";import"../../icons/customIcons/icons/Collapse.js";import"../../icons/customIcons/icons/Dashboard.js";import"../../icons/customIcons/icons/Expand.js";import"../../icons/customIcons/icons/FolderClosed.js";import"../../icons/customIcons/icons/FolderClosedFilled.js";import"../../icons/customIcons/icons/FolderOpened.js";import"../../icons/customIcons/icons/GreaterOrEqual.js";import"../../icons/customIcons/icons/LessOrEqual.js";import"../../icons/customIcons/icons/Search.js";import"../../icons/customIcons/icons/Wellhub.js";import"../../icons/customIcons/icons/MultiRuler.js";import"../../icons/customIcons/icons/Checkbox.js";import"../../icons/customIcons/icons/CheckboxChecked.js";import"../../icons/customIcons/icons/CheckboxIndeterminate.js";import"../../icons/customIcons/icons/Radio.js";import"../../icons/customIcons/icons/RadioChecked.js";import"../../icons/customIcons/icons/SimulFrac.js";import"../../icons/customIcons/icons/ZipperFrac.js";import"../../icons/customIcons/icons/CautionFilled.js";import"../../icons/customIcons/icons/MoreApp.js";var f=c((function(o){var i=o.palette;return{disabled:{opacity:.4,pointerEvents:"none"},offsetContainer:{cursor:"pointer",display:"flex",whiteSpace:"nowrap",flexWrap:"nowrap",alignItems:"center",width:"fit-content"},hoveredContainer:{backgroundColor:"rgba(255, 255, 255, 0.16)",color:i.primary.light},offsetText:{color:i.primary.text6,fontSize:12,paddingRight:4,"&:hover":{color:i.primary.contrastText}},buttons:{display:"flex",alignItems:"center"},isActive:{color:i.primary.contrastText},primaryIcon:{"&:hover":{backgroundColor:"rgba(255, 255, 255, 0.16)"}},infoIcon:{marginRight:"8px",fontSize:"20px",color:i.info.light},infoTooltip:{maxWidth:"264px"}}})),b=function(n){var c=n.onClick,b=n.wells,I=n.label,h=n.disabled,x=n.expanded,j=n.onExpand,C=n.offsetWellsLimited,g=n.isTooltipDisabled,v=n.iconElement,y=t(!1),k=y[0],E=y[1],T=f(),W=b.length,w=!(!W||!j),A=i("div",o({"data-testid":"offsetWellsButton",className:e(T.offsetContainer,h&&T.disabled),onClick:c,onMouseMove:function(o){var i=o.target,s=i.parentNode;i.getAttribute("data-icon")||s.getAttribute("data-icon")?E(!1):E(!0)},onMouseLeave:function(){E(!1)}},{children:[i(r,o({className:e(T.offsetText,k&&T.isActive)},{children:[I," (",W,")"]})),s(m,o({className:e(T.primaryIcon,k&&T.hoveredContainer),color:"primary",size:"medium"},{children:v||s(p,{size:24})}))]}));return i("div",o({className:T.buttons},{children:[C&&s(l,o({title:"".concat(I," list wasn't populated completely due to technical limitations of the app."),classes:{tooltip:T.infoTooltip}},{children:s(a,{className:T.infoIcon})})),s(l,o({title:"Edit ".concat(I),placement:"bottom"},{children:A})),w&&s(m,o({"data-testid":"expandOffsetWellChipsTabButton",tooltipProps:!g&&{title:x?"Collapse ".concat(I):"Expand ".concat(I)},onClick:function(o){o.stopPropagation(),j()},color:"default",size:"medium","data-icon":"expandIcon"},{children:s(x?d:u,{"data-icon":"expandIcon"})}))]}))},I={onClick:n.func.isRequired,wells:n.arrayOf(n.shape({id:n.number,title:n.string})),label:n.string,disabled:n.bool,onExpand:n.func,expanded:n.bool,offsetWellsLimited:n.bool,isTooltipDisabled:n.bool,iconElement:n.node};b.propTypes=I,b.defaultProps={onExpand:null,expanded:!1,wells:[],disabled:!1,offsetWellsLimited:!1,isTooltipDisabled:!1,label:"Offset Wells",iconElement:null};export{b as default};
