Liferay.Loader.define("layout-admin-web@5.0.105/js/ThemeCSSReplacementSelector",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/form","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({placeholder:e,portletNamespace:t,selectThemeCSSClientExtensionEventName:a,selectThemeCSSClientExtensionURL:c,themeCSSCETExternalReferenceCode:u,themeCSSExtensionName:i}){const[f,s]=(0,o.useState)(i),[d,y]=(0,o.useState)(u),m=()=>{(0,r.openSelectionModal)({onSelect:e=>{const t=JSON.parse(e.value);y(t.cetExternalReferenceCode),s(t.name)},selectEventName:a,title:Liferay.Language.get("select-theme-css-client-extension"),url:c})};return o.default.createElement(o.default.Fragment,null,o.default.createElement(l.ClayInput,{name:"".concat(t,"themeCSSCETExternalReferenceCode"),type:"hidden",value:d}),o.default.createElement(l.default.Group,null,o.default.createElement("label",{htmlFor:"".concat(t,"themeCSSReplacementExtension")},Liferay.Language.get("client-extension")),o.default.createElement(l.ClayInput.Group,{className:"w-50",small:!0},o.default.createElement(l.ClayInput.GroupItem,null,o.default.createElement(l.ClayInput,{id:"".concat(t,"themeCSSReplacementExtension"),onClick:m,placeholder:e,readOnly:!0,type:"text",value:f})),o.default.createElement(l.ClayInput.GroupItem,{shrink:!0},f?o.default.createElement(o.default.Fragment,null,o.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("replace"),className:"mr-2",displayType:"secondary",onClick:m,small:!0,symbol:"change"}),o.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("delete"),displayType:"secondary",onClick:()=>{s(""),y("")},small:!0,symbol:"trash"})):o.default.createElement(n.ClayButtonWithIcon,{"aria-label":Liferay.Language.get("select"),displayType:"secondary",onClick:m,small:!0,symbol:"plus"})))))};var n=a("@frontend-taglib-clay$clayui/button"),l=u(a("@frontend-taglib-clay$clayui/form")),r=a("frontend-js-web"),o=u(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 u(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={},n=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var l in e)if(Object.prototype.hasOwnProperty.call(e,l)){var r=n?Object.getOwnPropertyDescriptor(e,l):null;r&&(r.get||r.set)?Object.defineProperty(a,l,r):a[l]=e[l]}return a.default=e,t&&t.set(e,a),a}}}));
//# sourceMappingURL=ThemeCSSReplacementSelector.js.map