Liferay.Loader.define("knowledge-base-web@5.0.60/admin/js/EditKBArticle",["module","exports","require"],(function(e,t,n){window;{function c(e,t,n){return null==e||e.addEventListener(t,n),{detach(){null==e||e.removeEventListener(t,n)}}}Object.defineProperty(t,"__esModule",{value:!0}),t.default=function({kbArticle:e,namespace:t,publishAction:n}){const l=document.getElementById("".concat(t,"contextualSidebarButton")),o=document.getElementById("".concat(t,"contextualSidebarContainer")),a=document.getElementById("".concat(t,"title")),i=document.getElementById("".concat(t,"urlTitle")),u=e=>{"false"===i.dataset.customUrl&&(i.value=Liferay.Util.normalizeFriendlyURL(e.target.value))},d=e=>{e.currentTarget.dataset.customUrl=""!==i.value},r=document.getElementById("".concat(t,"publishButton")),s=document.getElementById("".concat(t,"fm")),m=[c(r,"click",(()=>{const c=document.getElementById("".concat(t,"workflowAction"));if(c&&(c.value=n),!e){"false"===i.dataset.customUrl&&(i.value="")}})),c(l,"click",(()=>{null==o||o.classList.toggle("contextual-sidebar-visible")})),c(s,"submit",(()=>{document.getElementById("".concat(t,"content")).value=window["".concat(t,"contentEditor")].getHTML(),function(){const e=document.getElementById("".concat(t,"selectedFileNameContainer")),n=[],c=s.querySelectorAll("input[name=".concat(t,"selectUploadedFile]:checked"));for(let e=0;e<c.length;e++)n.push('<input id="'.concat(t,"selectedFileName").concat(e,'"\n\t\t\t\t\tname="').concat(t,'selectedFileName"\n\t\t\t\t\ttype="hidden"\n\t\t\t\t\tvalue="').concat(c[e].value,'"\n\t\t\t\t/>'));e.innerHTML=n.join("")}()}))];e||(m.push(c(a,"input",u)),m.push(c(i,"input",d)));return{dispose(){m.forEach((({detach:e})=>{e()}))}}}}}));
//# sourceMappingURL=EditKBArticle.js.map