Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/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","../../core/hooks/useId"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({label:e,onClear:t,onColorSelect:a,selectedColor:c}){const d=(0,s.useId)(),u=(0,n.useMemo)((()=>o.config.themeColorsCssClasses.map((e=>({color:e,cssClass:e,rgbValue:i(e)})))),[]);return n.default.createElement("div",{className:"page-editor__color-palette"},e&&n.default.createElement("label",{htmlFor:d},e),n.default.createElement("div",{className:"palette-container",id:d},n.default.createElement("ul",{className:"list-unstyled palette-items-container"},u.map((e=>n.default.createElement("li",{className:(0,r.default)("palette-item",{"palette-item-selected":e.rgbValue===c||e.cssClass===c}),key:e.cssClass},n.default.createElement(l.default,{block:!0,className:(0,r.default)("bg-".concat(e.cssClass),"palette-item-inner","p-1","rounded-circle"),displayType:"unstyled",onClick:()=>a(e),small:!0,title:e.cssClass})))))),t&&n.default.createElement(l.default,{disabled:!c,displayType:"secondary",onClick:t,small:!0},Liferay.Language.get("clear")))};var l=d(a("@frontend-taglib-clay$clayui/button")),r=d(a("liferay!frontend-js-react-web$classnames")),n=(d(a("liferay!frontend-js-react-web$prop-types")),function(e){if(e&&e.__esModule)return e;if(null===e||"object"!=typeof e&&"function"!=typeof e)return{default:e};var t=c();if(t&&t.has(e))return t.get(e);var a={},l=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var r in e)if(Object.prototype.hasOwnProperty.call(e,r)){var n=l?Object.getOwnPropertyDescriptor(e,r):null;n&&(n.get||n.set)?Object.defineProperty(a,r,n):a[r]=e[r]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"))),o=a("../../app/config/index"),s=a("../../core/hooks/useId");function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function d(e){return e&&e.__esModule?e:{default:e}}function i(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