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