Liferay.Loader.define("frontend-js-spa-web@5.0.36/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 init(t){"loading"===document.readyState?document.addEventListener("DOMContentLoaded",(()=>{e(t)})):e(t)};var i=_interopRequireDefault(n("./app/LiferayApp")),o=_interopRequireDefault(n("./screen/ActionURLScreen")),r=_interopRequireDefault(n("./screen/RenderURLScreen")),a=n("./util/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const e=function initSPA(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),r=new URL(e.loginRedirect,window.location.origin).host||window.location.host;return t.isLinkSameOrigin_(r)&&(i="1"===o.searchParams.get("p_p_lifecycle")),i}},{handler:r.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,r=i.action;if(i.matches(o)&&t.canNavigate(r)&&"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,a.getUrlPath)(r))}else i.submit()}))},Liferay.initComponentCache(),Liferay.SPA={app:t},Liferay.fire("SPAReady"),t}}}));
//# sourceMappingURL=init.js.map