Liferay.Loader.define("layout-admin-web@5.0.84/js/layout/look_and_feel/GlobalCSSCETsConfiguration",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/drop-down","@frontend-taglib-clay$clayui/table","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,t,a){var l;window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({globalCSSCETSelectorURL:e,globalCSSCETs:t,portletNamespace:a,selectGlobalCSSCETsEventName:l}){const[c,f]=(0,d.useState)(t),i=e=>[{label:Liferay.Language.get("delete"),onClick:()=>{return t=e,void f((e=>e.filter((e=>e.cetExternalReferenceCode!==t.cetExternalReferenceCode))));var t},symbolLeft:"trash"}];return d.default.createElement(d.default.Fragment,null,d.default.createElement("input",{name:"".concat(a,"globalCSSCETExternalReferenceCodes"),type:"hidden",value:c.map((e=>e.cetExternalReferenceCode)).join(",")}),d.default.createElement("h3",{className:"sheet-subtitle"},Liferay.Language.get("css-extensions")),d.default.createElement(n.default,{className:"mb-3",displayType:"secondary",onClick:()=>{(0,u.openSelectionModal)({multiple:!0,onSelect(e){if(!e.value)return;const t=e.value.map((e=>JSON.parse(e)));f((e=>{const a=[...e,...t];return a.filter(((e,t)=>a.findIndex((({cetExternalReferenceCode:t})=>e.cetExternalReferenceCode===t))===t))}))},selectEventName:l,title:Liferay.Language.get("select-css-extensions"),url:e})},small:!0,type:"button"},Liferay.Language.get("add-css-extensions")),c.length?d.default.createElement(o.default,null,d.default.createElement(o.default.Head,null,d.default.createElement(o.default.Row,null,d.default.createElement(o.default.Cell,{expanded:!0,headingCell:!0},Liferay.Language.get("name")),d.default.createElement(o.default.Cell,{headingCell:!0},d.default.createElement("span",{className:"sr-only"},Liferay.Language.get("options"))))),d.default.createElement(o.default.Body,null,c.map((e=>d.default.createElement(o.default.Row,{key:e.cetExternalReferenceCode},d.default.createElement(o.default.Cell,{expanded:!0,headingTitle:!0},e.name),d.default.createElement(o.default.Cell,null,d.default.createElement(r.ClayDropDownWithItems,{items:i(e),trigger:d.default.createElement(n.ClayButtonWithIcon,{displayType:"unstyled",small:!0,symbol:"ellipsis-v"})}))))))):d.default.createElement("p",{className:"text-secondary"},Liferay.Language.get("no-css-extensions-were-loaded")))};var n=f(a("@frontend-taglib-clay$clayui/button")),r=a("@frontend-taglib-clay$clayui/drop-down"),o=(l=a("@frontend-taglib-clay$clayui/table"))&&l.__esModule?l:{default:l},u=a("frontend-js-web"),d=f(a("liferay!frontend-js-react-web$react"));function c(){if("function"!=typeof WeakMap)return null;var e=new WeakMap;return c=function(){return e},e}function f(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 n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var r=l?Object.getOwnPropertyDescriptor(e,n):null;r&&(r.get||r.set)?Object.defineProperty(a,n,r):a[n]=e[n]}return a.default=e,t&&t.set(e,a),a}}}));
//# sourceMappingURL=GlobalCSSCETsConfiguration.js.map