Liferay.Loader.define("journal-web@5.0.108/js/DataEngineLayoutRendererLanguageProxy.es",["module","exports","require"],(function(e,a,n){window;{function switchLanguage({dataEngineReactComponentRef:e,languageId:a,namespace:n,preserveValue:t=!1}){if(null==e?void 0:e.current){const u=document.getElementById("".concat(n,"defaultLanguageId"));e.current.updateEditingLanguageId({defaultLanguageId:u.value,editingLanguageId:a,preserveValue:t})}}Object.defineProperty(a,"__esModule",{value:!0}),a.default=function _default({currentLanguageId:e,namespace:a}){let n=null,t=null;return Liferay.componentReady("".concat(a,"dataEngineLayoutRenderer")).then((u=>{const d=null==u?void 0:u.reactComponentRef;n=Liferay.after("inputLocalized:localeChanged",(e=>{const n=e.item.getAttribute("data-value");switchLanguage({dataEngineReactComponentRef:d,languageId:n,namespace:a})})),t=Liferay.after("inputLocalized:defaultLocaleChanged",(e=>{const n=e.item.getAttribute("data-value");document.getElementById("".concat(a,"defaultLanguageId")).value=n})),switchLanguage({dataEngineReactComponentRef:d,languageId:e,namespace:a,preserveValue:!0})})),{dispose(){n&&n.detach(),t&&t.detach()}}}}}));
//# sourceMappingURL=DataEngineLayoutRendererLanguageProxy.es.js.map