Liferay.Loader.define("layout-admin-web@5.0.117/js/layout/look_and_feel/MasterLayoutConfiguration",["module","exports","require","@frontend-taglib-clay$clayui/button","@frontend-taglib-clay$clayui/link","frontend-js-web","liferay!frontend-js-react-web$react"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function MasterLayoutConfiguration({changeMasterLayoutURL:t,editMasterLayoutURL:a,masterLayoutName:u,masterLayoutPlid:o,portletNamespace:c}){const[d,s]=(0,i.useState)({name:u,plid:o||e}),handleChangeMasterButtonClick=()=>{(0,l.openSelectionModal)({iframeBodyCssClass:"",onSelect(e){if(e){const t=JSON.parse(e.value);s({name:t.name,plid:t.plid})}},selectEventName:"".concat(c,"selectMasterLayout"),title:Liferay.Language.get("select-master"),url:t})};return(0,i.useEffect)((()=>{const t=document.getElementById("".concat(c,"themeContainer"));t&&(d.plid===e?(t.classList.remove("hide"),t.removeAttribute("aria-hidden")):(t.classList.add("hide"),t.setAttribute("aria-hidden","true")))}),[d.plid,c]),i.default.createElement(i.default.Fragment,null,i.default.createElement("input",{name:"".concat(c,"masterLayoutPlid"),type:"hidden",value:d.plid}),i.default.createElement("h3",{className:"sheet-subtitle"},Liferay.Language.get("master")),i.default.createElement("p",null,i.default.createElement("strong",null,"".concat(Liferay.Language.get("master-name"),": ")),d.name),a&&d.plid&&d.plid!==e?i.default.createElement(r.default.Group,{spaced:!0},i.default.createElement(n.default,{className:"btn btn-secondary btn-sm",href:a},Liferay.Language.get("edit-master")),i.default.createElement(r.default,{displayType:"secondary",onClick:handleChangeMasterButtonClick,size:"sm"},Liferay.Language.get("change-master"))):i.default.createElement(r.default,{displayType:"secondary",onClick:handleChangeMasterButtonClick,size:"sm"},Liferay.Language.get("change-master")))};var r=_interopRequireDefault(a("@frontend-taglib-clay$clayui/button")),n=_interopRequireDefault(a("@frontend-taglib-clay$clayui/link")),l=a("frontend-js-web"),i=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 n in e)if(Object.prototype.hasOwnProperty.call(e,n)){var l=r?Object.getOwnPropertyDescriptor(e,n):null;l&&(l.get||l.set)?Object.defineProperty(a,n,l):a[n]=e[n]}a.default=e,t&&t.set(e,a);return a}(a("liferay!frontend-js-react-web$react"));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}}const e="0"}}));
//# sourceMappingURL=MasterLayoutConfiguration.js.map