Liferay.Loader.define("frontend-js-spa-web@5.0.24/init",["module","exports","require","./app/LiferayApp","./screen/ActionURLScreen","./screen/RenderURLScreen","./util/utils"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{e(t)})):e(t)};var i=c(n("./app/LiferayApp")),o=c(n("./screen/ActionURLScreen")),a=c(n("./screen/RenderURLScreen")),r=n("./util/utils");function c(e){return e&&e.__esModule?e:{default:e}}const e=function(e){const t=new i.default(e);return t.addRoutes([{handler:o.default,path(n){let i=!1;const o=new URL(n,window.location.origin),a=new URL(e.loginRedirect,window.location.origin).host||window.location.host;if(t.isLinkSameOrigin_(a)&&(i="1"===o.searchParams.get("p_p_lifecycle"),i)){const t=o.searchParams.get("p_p_id");t&&e.excludedTargetPortlets&&(i=!e.excludedTargetPortlets.includes(t))}return i}},{handler:a.default,path(t){let n=!1;if(0!==(t+"/").indexOf(themeDisplay.getPathMain()+"/")){if(!e.excludedPaths.some((e=>0===t.indexOf(e)))){const e=new URL(t,window.location.origin).searchParams.get("p_p_lifecycle");n="0"===e||!e}}return n}}]),Liferay.Util.submitForm=function(n){setTimeout((()=>{const i=Object.isPrototypeOf.call(HTMLFormElement.prototype,n)?n:n.getDOM(),o="form"+e.navigationExceptionSelectors,a=i.action;if(i.matches(o)&&t.canNavigate(a)&&"get"!==i.method&&!t.isInPortletBlacklist(i)){Liferay.Util._submitLocked=!1,Liferay.SPA.__capturedFormElement__=i;const e="button:not([type]),button[type=submit],input[type=submit]";document.activeElement.matches(e)?Liferay.SPA.__capturedFormButtonElement__=document.activeElement:Liferay.SPA.__capturedFormButtonElement__=i.querySelector(e),t.navigate((0,r.getUrlPath)(a))}else i.submit()}))},Liferay.initComponentCache(),Liferay.SPA={app:t},Liferay.fire("SPAReady"),t}}}));
//# sourceMappingURL=init.js.map