import o from"@babel/runtime/helpers/defineProperty";import i from"@babel/runtime/helpers/slicedToArray";import{forwardRef as s,useState as n,useLayoutEffect as c}from"react";import{ChromePicker as t}from"react-color";import e from"classnames";import{makeStyles as r,Tooltip as a}from"@material-ui/core";import p from"./Palette/Palette.js";import m from"../../IconButton/index.js";import{PaletteIcon as l,PickerIcon as d}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";import{jsxs as u,jsx as b}from"react/jsx-runtime";var h="PALETTE",x="CHROME_PICKER",f={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=r({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"}}),C=s((function(s,r){var C=s.color,I=s.onChange,g=s.onSizeChange,k=s.enableTransparencyPalette,P=j(),w=n(h),y=i(w,2),R=y[0],v=y[1];return c(g,[R]),u("div",{className:P.container,ref:r,children:[R===h&&b(p,{className:P.chromePickerPalette,color:C,onChange:I,enableTransparencyPalette:k}),R===x&&b(t,{styles:f,color:C,onChange:I}),u("div",{className:P.buttonsContainer,children:[b(a,{title:"Palette",classes:{tooltip:P.tooltip},children:b(m,{"data-testid":"".concat("PaletteChromePicker","_palette"),className:P.iconButton,onClick:function(){return v(h)},children:b(l,{className:e(P.icon,o({},P.iconActive,R===h)),size:24})})}),b(a,{title:"Pick your own",classes:{tooltip:P.tooltip},children:b(m,{"data-testid":"".concat("PaletteChromePicker","_pickOwn"),className:P.iconButton,onClick:function(){return v(x)},children:b(d,{className:e(P.icon,o({},P.iconActive,R===x)),size:24})})})]})]})}));export{C as default};
