Liferay.Loader.define("layout-admin-web@5.0.131/js/LookAndFeelThemeEdit",["module","exports","require","frontend-js-web"],(function(e,t,n){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function _default({changeThemeButtonId:e,initialSelectedThemeId:t,lookAndFeelDetailURL:n,namespace:o,selectThemeURL:c,themeContainerId:d}){let l=t;const i=document.getElementById(d),onChangeThemeButtonClick=e=>{e.preventDefault();const t=new URL(c);t.searchParams.set("".concat(o,"themeId"),l),(0,a.openSelectionModal)({onSelect:e=>{const t=e.themeid;if(t&&l!==t){i.innerHTML="";const e=document.createElement("div");e.classList.add("loading-animation"),i.appendChild(e),(0,a.fetch)(n,{body:(0,a.objectToFormData)({["".concat(o,"themeId")]:t}),method:"POST"}).then((e=>e.text())).then((n=>{const a=document.createRange().createContextualFragment(n);i.removeChild(e),i.appendChild(a),l=t,function updateCheckboxNames(e,t){const n=Array.from(t.querySelectorAll("input[type=checkbox]")).map((t=>t.name.replace(e,""))).join(","),a=document.getElementById("".concat(e,"checkboxNames"));a&&(a.value=n)}(o,i)}))}},selectEventName:"".concat(o,"selectTheme"),title:Liferay.Language.get("available-themes"),url:t.href})},m=document.getElementById(e);return m.addEventListener("click",onChangeThemeButtonClick),{dispose(){m.removeEventListener("click",onChangeThemeButtonClick)}}};var a=n("frontend-js-web")}));
//# sourceMappingURL=LookAndFeelThemeEdit.js.map