Liferay.Loader.define("layout-seo-web@2.0.49/js/seo/openGraph.es",["module","exports","require","frontend-js-web","./PreviewSeoEvents.es"],(function(e,t,a){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=function _default({namespace:e,uploadOpenGraphImageURL:t}){const a=document.getElementById("".concat(e,"openGraphImageButton")),l=document.getElementById("".concat(e,"openGraphImageFileEntryId")),c=document.getElementById("".concat(e,"openGraphImageTitle")),d=document.getElementById("".concat(e,"openGraphImageAlt")),i=document.getElementById("".concat(e,"openGraphImageAlt_").concat(Liferay.ThemeDisplay.getDefaultLanguageId())),g=document.querySelector('[for="'.concat(e,'openGraphImageAlt"'));a.addEventListener("click",(()=>{(0,n.openSelectionModal)({onSelect:t=>{if(t){const a=JSON.parse(t.value);l.value=a.fileEntryId,c.value=a.title,(0,o.previewSeoFireChange)(e,{type:"imgUrl",value:a.url}),(0,n.toggleDisabled)(d,!1),(0,n.toggleDisabled)(i,!1),(0,n.toggleDisabled)(g,!1)}},selectEventName:"".concat(e,"openGraphImageSelectedItem"),title:Liferay.Language.get("open-graph-image"),url:t})}));document.getElementById("".concat(e,"openGraphClearImageButton")).addEventListener("click",(()=>{l.value="",c.value="",(0,n.toggleDisabled)(d,!0),(0,n.toggleDisabled)(i,!0),(0,n.toggleDisabled)(g,!0),(0,o.previewSeoFireChange)(e,{type:"imgUrl",value:""})}));const r=document.getElementById("".concat(e,"openGraphTitleEnabled")),p=document.getElementById("".concat(e,"openGraphTitle")),m=document.getElementById("".concat(e,"openGraphTitle_").concat(Liferay.ThemeDisplay.getLanguageId()));r.addEventListener("click",(t=>{const a=!t.target.checked;(0,n.toggleDisabled)(p,a),(0,n.toggleDisabled)(m,a),(0,o.previewSeoFireChange)(e,{disabled:a,type:"title",value:p.value})}));const s=document.getElementById("".concat(e,"openGraphDescriptionEnabled")),u=document.getElementById("".concat(e,"openGraphDescription")),y=document.getElementById("".concat(e,"openGraphDescription_").concat(Liferay.ThemeDisplay.getLanguageId()));s.addEventListener("click",(t=>{const a=!t.target.checked;(0,n.toggleDisabled)(u,a),(0,n.toggleDisabled)(y,a),(0,o.previewSeoFireChange)(e,{disabled:a,type:"description",value:u.value})}))};var n=a("frontend-js-web"),o=a("./PreviewSeoEvents.es")}));
//# sourceMappingURL=openGraph.es.js.map