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