Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.170/page_editor/common/components/ColorPalette",["module","exports","require","@frontend-taglib-clay$clayui/button","liferay!frontend-js-react-web$classnames","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../app/config/index","../hooks/useId"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function ColorPalette({label:e,onClear:t,onColorSelect:a,selectedColor:s}){const i=(0,c.useId)(),u=(0,n.useMemo)((()=>o.config.themeColorsCssClasses.map((e=>({color:e,cssClass:e,rgbValue:getRgbValue(e)})))),[]);return n.default.createElement("div",{className:"page-editor__color-palette"},e&&n.default.createElement("label",{htmlFor:i},e),n.default.createElement("div",{className:"palette-container",id:i},n.default.createElement("ul",{className:"list-unstyled palette-items-container"},u.map((e=>n.default.createElement("li",{className:(0,l.default)("palette-item",{"palette-item-selected":e.rgbValue===s||e.cssClass===s}),key:e.cssClass},n.default.createElement(r.default,{block:!0,className:(0,l.default)("bg-".concat(e.cssClass),"palette-item-inner","p-1","rounded-circle"),displayType:"unstyled",onClick:()=>a(e),size:"sm",title:e.cssClass})))))),t&&n.default.createElement(r.default,{disabled:!s,displayType:"secondary",onClick:t,size:"sm"},Liferay.Language.get("clear")))};var r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),l=_interopRequireDefault(a("liferay!frontend-js-react-web$classnames")),n=(_interopRequireDefault(a("liferay!frontend-js-react-web$prop-types")),function _interopRequireWildcard(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=_getRequireWildcardCache();if(t&&t.has(e))return t.get(e);var a={},r=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var n=r?Object.getOwnPropertyDescriptor(e,l):null;n&&(n.get||n.set)?Object.defineProperty(a,l,n):a[l]=e[l]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"))),o=a("../../app/config/index"),c=a("../hooks/useId");function _getRequireWildcardCache(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return _getRequireWildcardCache=function _getRequireWildcardCache(){return e},e}function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function getRgbValue(e){const t=document.createElement("div");t.classList.add("bg-".concat(e)),t.style.display="none",document.body.append(t);const a=getComputedStyle(t).backgroundColor;return document.body.removeChild(t),a}}}));
//# sourceMappingURL=ColorPalette.js.map