Liferay.Loader.define("@liferay/layout-content-page-editor-web@3.0.132/page_editor/app/processors/ImageProcessor",["module","exports","require","../../core/openImageSelector","../utils/getEditableLinkValue","../utils/getEditableLocalizedValue"],(function(e,t,l){window;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=l("../../core/openImageSelector"),r=l("../utils/getEditableLinkValue"),i=l("../utils/getEditableLocalizedValue");var n={createEditor:function(e,t,l){(0,a.openImageSelector)((e=>{const l=e&&e.url?e.url:"";t({fileEntryId:e?e.fileEntryId:void 0,url:l},{imageTitle:e&&e.title?e.title:""})}),l)},destroyEditor:function(){},render:function(e,t,l={},a){let n=null;if(n=e instanceof HTMLImageElement?e:e.querySelector("img"),n){n.alt=(0,i.getEditableLocalizedValue)(l.alt,a)||(null==t?void 0:t.alt);const e=(0,r.getEditableLinkValue)(l,a);if(e.href)if(n.parentElement instanceof HTMLAnchorElement)n.parentElement.href=e.href,n.parentElement.target=e.target;else{const t=document.createElement("a");t.href=e.href,t.target=e.target,n.parentElement.replaceChild(t,n),t.appendChild(n)}const o=t&&"string"!=typeof t?t.url:t;o&&(n.src=o),l.lazyLoading&&(n.loading="lazy")}}};t.default=n}));
//# sourceMappingURL=ImageProcessor.js.map