"use strict";var e=require("@babel/runtime/helpers/defineProperty"),o=require("@babel/runtime/helpers/slicedToArray"),s=require("react"),i=require("react-color"),c=require("classnames"),n=require("@material-ui/core"),r=require("./Palette/Palette.js"),t=require("../../IconButton/index.js"),a=require("../../../icons/iconParkIcons.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"),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 u=require("react/jsx-runtime");function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var d=l(e),p=l(o),m=l(c),x="PALETTE",b="CHROME_PICKER",h={default:{picker:{width:"100%",boxShadow:"none"},body:{backgroundColor:"#3b3b3b",padding:"16px 16px 0"},color:{width:"32px",height:"32px",marginRight:"16px",borderRadius:"2px"},swatch:{marginTop:0,width:"100%",height:"100%",borderRadius:0,position:"relative",overflow:"hidden"},toggles:{display:"flex",flexDirection:"column",justifyContent:"space-between"},Alpha:{checkboard:{display:"none"},gradient:{borderRadius:"5px"}}}},j=n.makeStyles({container:{backgroundColor:"#3b3b3b",boxShadow:"0px 3px 10px rgba(0, 0, 0, 0.4)",width:"250px",paddingBottom:"8px",borderRadius:"4px","& input":{border:"1px solid #616161 !important",backgroundColor:"#3b3b3b",color:"#fff !important",boxShadow:"none !important",outline:"none"}},chromePickerPalette:{margin:"0 8px",paddingTop:"8px"},buttonsContainer:{display:"flex",justifyContent:"center",marginTop:"8px"},iconActive:{color:"#fff"},tooltip:{background:"#414141",color:"#fff",boxShadow:"0px 4px 4px rgba(0, 0, 0, 0.12)",borderRadius:"4px",opacity:1,fontSize:"11px"}}),f=s.forwardRef((function(e,o){var c=e.color,l=e.onChange,f=e.onSizeChange,q=e.enableTransparencyPalette,I=j(),C=s.useState(x),g=p.default(C,2),k=g[0],P=g[1];return s.useLayoutEffect(f,[k]),u.jsxs("div",{className:I.container,ref:o,children:[k===x&&u.jsx(r,{className:I.chromePickerPalette,color:c,onChange:l,enableTransparencyPalette:q}),k===b&&u.jsx(i.ChromePicker,{styles:h,color:c,onChange:l}),u.jsxs("div",{className:I.buttonsContainer,children:[u.jsx(n.Tooltip,{title:"Palette",classes:{tooltip:I.tooltip},children:u.jsx(t,{"data-testid":"".concat("PaletteChromePicker","_palette"),className:I.iconButton,onClick:function(){return P(x)},children:u.jsx(a.PaletteIcon,{className:m.default(I.icon,d.default({},I.iconActive,k===x)),size:24})})}),u.jsx(n.Tooltip,{title:"Pick your own",classes:{tooltip:I.tooltip},children:u.jsx(t,{"data-testid":"".concat("PaletteChromePicker","_pickOwn"),className:I.iconButton,onClick:function(){return P(b)},children:u.jsx(a.PickerIcon,{className:m.default(I.icon,d.default({},I.iconActive,k===b)),size:24})})})]})]})}));module.exports=f;
