Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.179/page_editor/common/components/ColorPalette",["module","exports","require","@frontend-taglib-clay$clayui/button","liferay!frontend-js-react-web$classnames","frontend-js-components-web","liferay!frontend-js-react-web$prop-types","liferay!frontend-js-react-web$react","../../app/config/index"],(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,n.useId)(),d=(0,o.useMemo)((()=>c.config.themeColorsCssClasses.map((e=>({color:e,cssClass:e,rgbValue:getRgbValue(e)})))),[]);return o.default.createElement("div",{className:"page-editor__color-palette"},e&&o.default.createElement("label",{htmlFor:i},e),o.default.createElement("div",{className:"palette-container",id:i},o.default.createElement("ul",{className:"list-unstyled palette-items-container"},d.map((e=>o.default.createElement("li",{className:(0,l.default)("palette-item",{"palette-item-selected":e.rgbValue===s||e.cssClass===s}),key:e.cssClass},o.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&&o.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=a("frontend-js-components-web"),o=(_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"))),c=a("../../app/config/index");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