import{__assign as r}from'./../../ext-esm/tslib/tslib.es6.js';import{jsx as o}from"react/jsx-runtime";import{useRef as e}from"react";import{makeStyles as n,Popover as t}from"@material-ui/core";import a from"../ColorPicker/PaletteChromePicker/PaletteChromePicker.js";var i={rgba:function(r){return"rgba(".concat(r.rgb.r,", ").concat(r.rgb.g,", ").concat(r.rgb.b,", ").concat(r.rgb.a,")")},rgb:function(r){return"rgb(".concat(r.rgb.r,", ").concat(r.rgb.g,", ").concat(r.rgb.b,")")},hex:function(r){return r.hex},rgba_rgb:function(r){return 1===r.rgb.a?i.rgb(r):i.rgba(r)},rgba_hex:function(r){return 1===r.rgb.a?i.hex(r):i.rgba(r)}},c=n({root:{position:"relative",display:"flex"},popper:{zIndex:1500},topLabel:{marginBottom:"8px",fontSize:"15px",lineHeight:"17px",letterSpacing:"0.4px",color:"#BDBDBD",whiteSpace:"nowrap"},rightLabel:{marginLeft:"8px",fontSize:"16px"}}),l=function(n){var l=n.color,p=n.onChange,g=n.anchorEl,b=void 0===g?null:g,m=n.handleClose,f=n.converter,h=void 0===f?"rgba_hex":f,u=n.popoverAnchorOrigin,s=void 0===u?{vertical:"bottom",horizontal:"left"}:u,d=n.popoverTransformOrigin,v=void 0===d?{vertical:"top",horizontal:"left"}:d,x=n.pickerComponent,C=void 0===x?a:x,P=n.enableTransparencyPalette,z=void 0!==P&&P,B=c(),S=e();return o("div",r({className:B.root},{children:o(t,r({id:"colors-popper",action:S,open:Boolean(b),anchorEl:b,onClose:m,anchorOrigin:s,transformOrigin:v},{children:o(C,{color:l,onChange:function(r){var o=i[h](r);p(o)},onSizeChange:function(){S.current&&S.current.updatePosition()},enableTransparencyPalette:z})}))}))};export{l as default};
