"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var o=require("react/jsx-runtime"),s=require("react"),e=require("react-color"),c=require("@material-ui/core"),r=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 n=require("./style.css.js"),i=function(i){var u=i.onChange,t=i.currentValue,l=i.defaultValue,a=void 0===l?"#FF0000":l,d=i.condensed,j=i.colors,m=void 0===j?["#FF0000","#00FF00","#0000FF"]:j,q=i.lensColor,I=void 0===q?"#fff":q,h=s.useState(!1),C=h[0],x=h[1],F=s.useState(t||a),k=F[0],f=F[1],p=function(){return u(k)};return o.jsxs("div",{className:n.colorEditor,children:[o.jsx(c.Button,{variant:"contained",color:"primary",onClick:function(){return x(!0)},className:n.button,style:{backgroundColor:k,color:I},size:"small",children:o.jsx(r.PaletteIcon,{size:16})}),C&&o.jsx(c.ClickAwayListener,{mouseEvent:"onMouseDown",touchEvent:"onTouchStart",onClickAway:function(){x(!1),p()},children:o.jsx("div",{className:n.colorEditorPickerContainer,children:d?o.jsx(e.GithubPicker,{color:k,onChange:function(o){f(o.hex),x(!1),p()},colors:m,triangle:"hide"}):o.jsx(e.ChromePicker,{color:k,onChange:function(o){f(o.hex),p()}})})})]})};exports.ColorEditor=i,exports.default=i;
