Liferay.Loader.define("frontend-js-spa-web@5.0.35/surface/Surface",["module","exports","require","frontend-js-web"],(function(t,e,i){window;{Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var s=i("frontend-js-web");class Surface extends s.Disposable{constructor(t){if(super(),!t)throw new Error("Surface element id not specified. A surface element requires a valid id.");this.activeChild=null,this.defaultChild=null,this.element=null,this.id=t,this.transitionFn=null,this.defaultChild=this.getChild(Surface.DEFAULT),this.maybeWrapContentAsDefault_(),this.activeChild=this.defaultChild}addContent(t,e){const i="string"==typeof e?(0,s.buildFragment)(e):e;Liferay.DOMTaskRunner.runTasks(i);let n=this.defaultChild;if(i){if(n=this.getChild(t),n)for(;n.firstChild;)n.removeChild(n.firstChild);else n=this.createChild(t),this.transition(n,null);n.appendChild(i)}const d=this.getElement();return d&&n&&d.appendChild(n),n}createChild(t){const e=document.createElement("div");return e.setAttribute("id",this.makeId_(t)),e}getChild(t){return document.getElementById(this.makeId_(t))}getElement(){return this.element||(this.element=document.getElementById(this.id)),this.element}getId(){return this.id}getTransitionFn(){return this.transitionFn}makeId_(t){return this.id+"-"+t}maybeWrapContentAsDefault_(){const t=this.getElement();if(t&&!this.defaultChild){const e=[];t.childNodes.forEach((t=>{t.classList&&(t.classList.contains("yui3-dd-proxy")||t.classList.contains("yui3-dd-shim"))||e.push(t)}));const i=document.createDocumentFragment();e.forEach((t=>{i.appendChild(t)})),this.defaultChild=this.addContent(Surface.DEFAULT,i),this.transition(null,this.defaultChild)}}setId(t){this.id=t}setTransitionFn(t){this.transitionFn=t}show(t){const e=this.activeChild;let i=this.getChild(t);return i||(i=this.defaultChild),this.activeChild=i,this.transition(e,i).finally((()=>{e&&e!==i&&e.remove()}))}remove(t){const e=this.getChild(t);e&&e.remove()}toString(){return this.id}transition(t,e){const i=this.transitionFn||Surface.defaultTransition;return Promise.resolve(i.call(this,t,e))}}Surface.DEFAULT="default",Surface.defaultTransition=function(t,e){t&&(t.style.display="none",t.classList.remove("flipped")),e&&(e.style.display="block",e.classList.add("flipped"))};var n=Surface;e.default=n}})); Liferay.Loader.define("frontend-js-spa-web@5.0.35/util/utils",["module","exports","require"],(function(t,e,r){window;{Object.defineProperty(e,"__esModule",{value:!0}),e.clearNodeAttributes=function clearNodeAttributes(t){Array.prototype.slice.call(t.attributes).forEach((e=>t.removeAttribute(e.name)))},e.copyNodeAttributes=function copyNodeAttributes(t,e){Array.prototype.slice.call(t.attributes).forEach((t=>e.setAttribute(t.name,t.value)))},e.getCurrentBrowserPath=function getCurrentBrowserPath(){return"".concat(window.location.pathname).concat(window.location.search).concat(window.location.hash)},e.getCurrentBrowserPathWithoutHash=getCurrentBrowserPathWithoutHash,e.getNodeOffset=function getNodeOffset(t){let[e,r]=[0,0];do{e+=t.offsetLeft,r+=t.offsetTop,t=t.offsetParent}while(t);return{offsetLeft:e,offsetTop:r}},e.getPortletBoundaryId=getPortletBoundaryId,e.getPortletBoundaryIds=getPortletBoundaryIds,e.getUid=function getUid(){return t++},e.getUrlPath=getUrlPath,e.getUrlPathWithoutHash=getUrlPathWithoutHash,e.getUrlPathWithoutHashAndSearch=function getUrlPathWithoutHashAndSearch(t){return(!t||t.startsWith("/")?new URL(t,window.location.origin):new URL(t)).pathname},e.isCurrentBrowserPath=function isCurrentBrowserPath(t){if(t){const e=getCurrentBrowserPathWithoutHash();return getUrlPathWithoutHash(t)===getUrlPath(e)}return!1},e.removePathTrailingSlash=function removePathTrailingSlash(t){const e=t?t.length:0;e>1&&"/"===t[e-1]&&(t=t.substr(0,e-1));return t},e.resetAllPortlets=function resetAllPortlets(){getPortletBoundaryIds(Liferay.Portlet.list).forEach((t=>{const e=document.querySelector("#"+t);e&&(Liferay.Portlet.destroy(e),e.portletProcessed=!1)})),Liferay.Portlet.readyCounter=0,Liferay.destroyComponents(((t,e)=>e.destroyOnNavigate))},e.runStyle=runStyle,e.runStylesInElement=function runStylesInElement(t,e,r){const n=t.querySelectorAll("style,link");if(!n.length&&e)return void setTimeout(e);let o=0;const a=function callback(){e&&++o===n.length&&setTimeout(e)};for(let t=0;tt})};let t=1;function getCurrentBrowserPathWithoutHash(){return"".concat(window.location.pathname).concat(window.location.search)}function getPortletBoundaryId(t){return"p_p_id_"+t+"_"}function getPortletBoundaryIds(t){return t.map((t=>getPortletBoundaryId(t)))}function getUrlPath(t){const e=!t||t.startsWith("/")?new URL(t,window.location.origin):new URL(t);return e.pathname+e.search+e.hash}function getUrlPathWithoutHash(t){const e=!t||t.startsWith("/")?new URL(t,window.location.origin):new URL(t);return e.pathname+e.search}function runStyle(t,e,r){const n=function callback(){e&&e()};if(!t.rel||"stylesheet"===t.rel||"canonical"===t.rel||"alternate"===t.rel)return"STYLE"===t.tagName||"canonical"===t.rel||"alternate"===t.rel?setTimeout(n):(t.addEventListener("load",n,{once:!0}),t.addEventListener("error",n,{once:!0})),r?r(t):document.head.appendChild(t),t;setTimeout(n)}}})); Liferay.Loader.define("frontend-js-spa-web@5.0.35/util/pathParser",["module","exports","require"],(function(e,t,n){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.parse=parse,t.toRegex=function toRegex(e){return convertTokensToRegex(parse(e))},t.extractData=function extractData(e,t){const n={},r=parse(e),o=t.match(convertTokensToRegex(r));if(!o)return null;let a=1;for(let e=0;e-1)}}var s=Route;e.default=s}})); Liferay.Loader.define("frontend-js-spa-web@5.0.35/cacheable/Cacheable",["module","exports","require","frontend-js-web"],(function(e,a,c){window;{Object.defineProperty(a,"__esModule",{value:!0}),a.default=void 0;var h=c("frontend-js-web");class Cacheable extends h.Disposable{constructor(){super(),this.cache=null,this.cacheable=!1}addCache(e){return this.cacheable&&(this.cache=e),this}clearCache(){return this.cache=null,this}disposeInternal(){this.clearCache()}getCache(){return this.cache}isCacheable(){return this.cacheable}setCacheable(e){e||this.clearCache(),this.cacheable=e}}var t=Cacheable;a.default=t}})); Liferay.Loader.define("frontend-js-spa-web@5.0.35/screen/Screen",["module","exports","require","frontend-js-web","../cacheable/Cacheable","../util/utils"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=r("frontend-js-web"),i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("../cacheable/Cacheable")),n=r("../util/utils");class Screen extends i.default{constructor(){super(),this.id=this.makeId_((0,n.getUid)()),this.metas=null,this.title=null}activate(){}beforeActivate(){}beforeDeactivate(){}beforeUpdateHistoryPath(e){return e}beforeUpdateHistoryState(e){return e}deactivate(){}disposeInternal(){super.disposeInternal()}evaluateScripts(e){return Object.keys(e).forEach((t=>{e[t].activeChild&&(0,s.runScriptsInElement)(e[t].activeChild)})),Promise.resolve()}evaluateStyles(){return Promise.resolve()}flip(e){const t=[];return Object.keys(e).forEach((r=>{const s=e[r].show(this.id);t.push(s)})),Promise.all(t)}getId(){return this.id}getMetas(){return this.metas}getSurfaceContent(){}getTitle(){return this.title}load(){return Promise.resolve()}makeId_(e){return"screen_"+e}setId(e){this.id=e}setMetas(e){this.metas=e}setTitle(e){this.title=e}toString(){return this.id}}Screen.isImplementedBy=function(e){return e instanceof Screen};var a=Screen;t.default=a}})); Liferay.Loader.define("frontend-js-spa-web@5.0.35/app/App",["module","exports","require","frontend-js-web","../route/Route","../screen/Screen","../surface/Surface","../util/utils"],(function(e,t,i){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r=i("frontend-js-web"),o=_interopRequireDefault(i("../route/Route")),a=_interopRequireDefault(i("../screen/Screen")),s=_interopRequireDefault(i("../surface/Surface")),n=i("../util/utils");function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}const e={IMMEDIATE:"immediate",SCHEDULE_LAST:"scheduleLast"};class App extends r.EventEmitter{constructor(t){super(),this.activeScreen=null,this.activePath=null,this.allowPreventNavigate=!0,this.basePath="",this.browserPathBeforeNavigate=(0,n.getCurrentBrowserPathWithoutHash)(),this.captureScrollPositionFromScrollEvent=!0,this.defaultTitle=document.title,this.formSelector=(null==t?void 0:t.navigationExceptionSelectors)?"form".concat(t.navigationExceptionSelectors):'form[enctype="multipart/form-data"]:not([data-senna-off])',this.ignoreQueryStringFromRoutePath=!1,this.linkSelector=(null==t?void 0:t.navigationExceptionSelectors)?"a".concat(t.navigationExceptionSelectors):'a:not([data-senna-off]):not([target="_blank"])',this.loadingCssClass="senna-loading",this.nativeScrollRestorationSupported="scrollRestoration"in window.history,this.navigationStrategy=e.IMMEDIATE,this.isNavigationPending=!1,this.pendingNavigate=null,this.popstateScrollLeft=0,this.popstateScrollTop=0,this.redirectPath=null,this.routes=[],this.scheduledNavigationQueue=[],this.screens={},this.skipLoadPopstate=!1,this.surfaces={},this.updateScrollPosition=!0,this.appEventHandlers_=new r.EventHandler,this.appEventHandlers_.add(this.addDOMEventListener(window,"scroll",(0,r.debounce)(this.onScroll_.bind(this),100)),this.addDOMEventListener(window,"load",this.onLoad_.bind(this)),this.addDOMEventListener(window,"popstate",this.onPopstate_.bind(this))),this.on("startNavigate",this.onStartNavigate_),this.on("beforeNavigate",this.onBeforeNavigate_),this.on("beforeNavigate",this.onBeforeNavigateDefault_,!0),this.on("beforeUnload",this.onBeforeUnloadDefault_),this.setLinkSelector(this.linkSelector),this.setFormSelector(this.formSelector),this.maybeOverloadBeforeUnload_()}addDOMEventListener(e,t,i){return e.addEventListener(t,i),{removeListener(){e.removeEventListener(t,i)}}}addRoutes(e){return Array.isArray(e)||(e=[e]),e.forEach((e=>{e instanceof o.default||(e=new o.default(e.path,e.handler)),this.routes.push(e)})),this}addSurfaces(e){return Array.isArray(e)||(e=[e]),e.forEach((e=>{"string"==typeof e&&(e=new s.default(e)),this.surfaces[e.getId()]=e})),this}canNavigate(e){try{const t=e.startsWith("/")?new URL(e,window.location.origin):new URL(e),i=(0,n.getUrlPath)(e);return!!this.isLinkSameOrigin_(t.host)&&(!!this.isSameBasePath_(i)&&((!t.hash&&!e.endsWith("#")||!(0,n.isCurrentBrowserPath)(i))&&!!this.findRoute(i)))}catch(e){return!1}}clearScreensCache(){Object.keys(this.screens).forEach((e=>{e===this.activePath?this.activeScreen.clearCache():this.isNavigationPending&&this.pendingNavigate.path===e||this.removeScreen(e)}))}createScreenInstance(e,t){if(!this.pendingNavigate&&e===this.activePath)return this.activeScreen;let i=this.screens[e];if(!i){const e=t.getHandler();i=e===a.default||a.default.isImplementedBy(e.prototype)?new e:e(t)||new a.default}return i}disposeInternal(){this.activeScreen&&this.removeScreen(this.activePath),this.clearScreensCache(),this.formEventHandler_.dispose(),this.linkEventHandler_.dispose(),this.appEventHandlers_.removeAllListeners(),super.disposeInternal()}dispatch(){return this.navigate((0,n.getCurrentBrowserPath)(),!0)}doNavigate_(t,i){const r=this.findRoute(t);if(!r)return Promise.reject(new Error("No route for "+t));this.stopPendingNavigate_(),this.isNavigationPending=!0;const o=this.createScreenInstance(t,r);return this.maybePreventDeactivate_().then((()=>this.maybePreventActivate_(o))).then((()=>o.load(t))).then((()=>{this.navigationStrategy=e.SCHEDULE_LAST,this.activeScreen&&this.activeScreen.deactivate(),this.prepareNavigateHistory_(t,o,i),this.prepareNavigateSurfaces_(o,this.surfaces,this.extractParams(r,t))})).then((()=>o.evaluateStyles(this.surfaces))).then((()=>o.flip(this.surfaces))).then((()=>o.evaluateScripts(this.surfaces))).then((()=>this.maybeUpdateScrollPositionState_())).then((()=>this.syncScrollPositionSyncThenAsync_())).then((()=>this.finalizeNavigate_(t,o))).then((()=>this.maybeOverloadBeforeUnload_())).catch((e=>{throw this.isNavigationPending=!1,this.handleNavigateError_(t,o,e),e})).finally((()=>{if(this.navigationStrategy=e.IMMEDIATE,this.scheduledNavigationQueue.length){const e=this.scheduledNavigationQueue.shift();this.maybeNavigate_(e.href,e)}}))}extractParams(e,t){return e.extractParams(this.getRoutePath(t))}finalizeNavigate_(e,t){t.activate(),this.activeScreen&&!this.activeScreen.isCacheable()&&this.activeScreen!==t&&this.removeScreen(this.activePath),this.activePath=e,this.activeScreen=t,this.browserPathBeforeNavigate=(0,n.getCurrentBrowserPathWithoutHash)(),this.screens[e]=t,this.isNavigationPending=!1,this.pendingNavigate=null,Liferay.SPA.__capturedFormElement__=null,Liferay.SPA.__capturedFormButtonElement__=null}findRoute(e){e=this.getRoutePath(e);for(let t=0;tthis.removeScreen(e)),this):this.removeScreen(e))}hasRoutes(){return!!this.routes.length}isLinkSameOrigin_(e){return e===window.location.host}isSameBasePath_(e){return 0===e.indexOf(this.basePath)}lockHistoryScrollPosition_(){const e=window.history.state;if(!e)return;let t=!1;const i=function switchScrollPositionRace(){document.removeEventListener("scroll",switchScrollPositionRace,!1),t||(window.scrollTo(e.scrollLeft,e.scrollTop),t=!0)};setTimeout(i),document.addEventListener("scroll",i,!1)}maybeDisableNativeScrollRestoration(){this.nativeScrollRestorationSupported&&(this.nativeScrollRestoration_=window.history.scrollRestoration,window.history.scrollRestoration="manual")}maybeScheduleNavigation_(t,i){return!(!this.isNavigationPending||this.navigationStrategy!==e.SCHEDULE_LAST)&&(this.scheduledNavigationQueue=[{href:t,isScheduledNavigation:!0},...i],!0)}maybeNavigate_(e,t){if(!this.canNavigate(e))return;if(this.maybeScheduleNavigation_(e,t))return void t.preventDefault();let i=!1;try{this.navigate((0,n.getUrlPath)(e),!1,t)}catch(e){i=!0}i||t.isScheduledNavigation||t.preventDefault()}maybeOverloadBeforeUnload_(){"function"==typeof window.onbeforeunload&&(window._onbeforeunload=window.onbeforeunload,window.onbeforeunload=e=>{if(this.emit("beforeUnload",e),e&&e.defaultPrevented)return!0},window.onbeforeunload._overloaded=!0)}maybePreventActivate_(e){return Promise.resolve().then((()=>e.beforeActivate())).then((e=>{if(e)return Promise.reject(new Error("Cancelled by next screen"))}))}maybePreventDeactivate_(){return Promise.resolve().then((()=>{if(this.activeScreen)return this.activeScreen.beforeDeactivate()})).then((e=>{if(e)return Promise.reject(new Error("Cancelled by active screen"))}))}maybeRepositionScrollToHashedAnchor(){const e=window.location.hash;if(e){const t=document.getElementById(e.substring(1));if(t){const{offsetLeft:e,offsetTop:i}=(0,n.getNodeOffset)(t);window.scrollTo(e,i)}}}maybeRestoreNativeScrollRestoration(){this.nativeScrollRestorationSupported&&this.nativeScrollRestoration_&&(window.history.scrollRestoration=this.nativeScrollRestoration_)}maybeRestoreRedirectPathHash_(e,t,i){return t===(0,n.getUrlPathWithoutHash)(e)?t+i:t}maybeUpdateScrollPositionState_(){const e=window.location.hash,t=document.getElementById(e.substring(1));if(t){const{offsetLeft:e,offsetTop:i}=(0,n.getNodeOffset)(t);this.saveHistoryCurrentPageScrollPosition_(i,e)}}navigate(e,t,i){return i&&(Liferay.SPA.__capturedFormElement__=i.capturedFormElement,Liferay.SPA.__capturedFormButtonElement__=i.capturedFormButtonElement),e===this.activePath&&(t=!0),this.emit("beforeNavigate",{event:i,path:e,replaceHistory:!!t}),this.pendingNavigate}onBeforeNavigate_(e){Liferay.SPA.__capturedFormElement__&&(e.form=Liferay.SPA.__capturedFormElement__)}onBeforeNavigateDefault_(t){(!this.pendingNavigate||this.pendingNavigate.path!==t.path&&this.navigationStrategy!==e.SCHEDULE_LAST)&&(this.emit("beforeUnload",t),this.emit("startNavigate",{form:t.form,path:t.path,replaceHistory:t.replaceHistory}))}onBeforeUnloadDefault_(e){const t=window._onbeforeunload;t&&!t._overloaded&&t()&&e.preventDefault()}onDocClickDelegate_(e){e.altKey||e.ctrlKey||e.metaKey||e.shiftKey||e.button||this.maybeNavigate_(e.delegateTarget.href,e)}onDocSubmitDelegate_(e){const t=e.delegateTarget;if("get"===t.method)return;e.capturedFormElement=t;const i="button:not([type]),button[type=submit],input[type=submit]";document.activeElement.matches(i)?e.capturedFormButtonElement=document.activeElement:e.capturedFormButtonElement=t.querySelector(i),this.maybeNavigate_(t.action,e)}onLoad_(){this.skipLoadPopstate=!0,setTimeout((()=>{this.skipLoadPopstate=!1})),this.maybeRepositionScrollToHashedAnchor()}onPopstate_(e){if(this.skipLoadPopstate)return;if((0,n.isCurrentBrowserPath)(this.browserPathBeforeNavigate))return void this.maybeRepositionScrollToHashedAnchor();const t=e.state;if(t){if(t.senna){this.popstateScrollTop=t.scrollTop,this.popstateScrollLeft=t.scrollLeft,this.nativeScrollRestorationSupported||this.lockHistoryScrollPosition_(),this.once("endNavigate",(()=>{t.referrer&&(0,n.setReferrer)(t.referrer)}));const e=t.path.startsWith("/")?new URL(t.path,window.location.origin):new URL(t.path);e.hostname=window.location.hostname,e.port=window.location.port;if(this.maybeScheduleNavigation_(e.toString(),new Map))return;this.navigate(t.path,!0)}}else window.location.hash?(this.redirectPath&&!(0,n.isCurrentBrowserPath)(this.redirectPath)&&this.reloadPage(),this.maybeRepositionScrollToHashedAnchor()):this.reloadPage()}onScroll_(){this.captureScrollPositionFromScrollEvent&&this.saveHistoryCurrentPageScrollPosition_(window.pageYOffset,window.pageXOffset)}onStartNavigate_(e){this.maybeDisableNativeScrollRestoration(),this.captureScrollPositionFromScrollEvent=!1,document.documentElement.classList.add(this.loadingCssClass);const t={form:e.form,path:e.path};this.pendingNavigate=this.doNavigate_(e.path,e.replaceHistory).catch((e=>{throw t.error=e,e})).finally((()=>{this.pendingNavigate||this.scheduledNavigationQueue.length||(document.documentElement.classList.remove(this.loadingCssClass),this.maybeRestoreNativeScrollRestoration(),this.captureScrollPositionFromScrollEvent=!0),this.emit("endNavigate",t)})),this.pendingNavigate.path=e.path}prefetch(e){const t=this.findRoute(e);if(!t)return Promise.reject(new Error("No route for "+e));const i=this.createScreenInstance(e,t);return i.load(e).then((()=>{this.screens[e]=i})).catch((t=>{throw this.handleNavigateError_(e,i,t),t}))}prepareNavigateHistory_(e,t,i){let r=t.getTitle();"string"!=typeof r&&(r=this.getDefaultTitle());let o=t.beforeUpdateHistoryPath(e);const a=e.startsWith("/")?new URL(e,window.location.origin).hash:new URL(e).hash;o=this.maybeRestoreRedirectPathHash_(e,o,a);const s={form:!!Liferay.SPA.__capturedFormElement__,path:e,redirectPath:o,scrollLeft:0,scrollTop:0,senna:!0};i&&(s.scrollTop=this.popstateScrollTop,s.scrollLeft=this.popstateScrollLeft),this.updateHistory_(r,o,t.beforeUpdateHistoryState(s),i),this.redirectPath=o}prepareNavigateSurfaces_(e,t,i){Object.keys(t).forEach((r=>{const o=e.getSurfaceContent(r,i);t[r].addContent(e.getId(),o)}))}reloadPage(){window.location.reload()}removeRoute(e){const t=this.routes.indexOf(e);return t>=0&&this.routes.splice(t,1),t>=0}removeScreen(e){const t=this.screens[e];t&&(Object.keys(this.surfaces).forEach((e=>this.surfaces[e].remove(t.getId()))),t.dispose(),delete this.screens[e])}saveHistoryCurrentPageScrollPosition_(e,t){const i=window.history.state;i&&i.senna&&([i.scrollTop,i.scrollLeft]=[e,t],window.history.replaceState(i,null,null))}setAllowPreventNavigate(e){this.allowPreventNavigate=e}setBasePath(e){this.basePath=(0,n.removePathTrailingSlash)(e)}setDefaultTitle(e){this.defaultTitle=e}setFormSelector(e){this.formSelector=e,this.formEventHandler_&&this.formEventHandler_.dispose(),this.formEventHandler_=(0,r.delegate)(document,"submit",this.formSelector,this.onDocSubmitDelegate_.bind(this),this.allowPreventNavigate)}setIgnoreQueryStringFromRoutePath(e){this.ignoreQueryStringFromRoutePath=e}setLinkSelector(e){this.linkSelector=e,this.linkEventHandler_&&this.linkEventHandler_.dispose(),this.linkEventHandler_=(0,r.delegate)(document,"click",this.linkSelector,this.onDocClickDelegate_.bind(this),this.allowPreventNavigate)}setLoadingCssClass(e){this.loadingCssClass=e}setUpdateScrollPosition(e){this.updateScrollPosition=e}stopPendingNavigate_(){this.pendingNavigate,this.pendingNavigate=null}syncScrollPositionSyncThenAsync_(){const e=window.history.state;if(!e)return;const t=e.scrollTop,i=e.scrollLeft,sync=()=>{this.updateScrollPosition&&window.scrollTo(i,t)};return new Promise((e=>{sync(),setTimeout((()=>{sync(),e()}))}))}updateHistory_(e,t,i,r){const o=window.location.href;i&&(i.referrer=o),r?window.history.replaceState(i,e,t):window.history.pushState(i,e,t),(0,n.setReferrer)(o);const a=document.querySelector("title");a?a.innerHTML=e:document.title=e}}var l=App;t.default=l}})); Liferay.Loader.define("frontend-js-spa-web@5.0.35/app/LiferayApp",["module","exports","require","frontend-js-web","../surface/Surface","../util/utils","./App"],(function(e,t,a){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var i=a("frontend-js-web"),r=_interopRequireDefault(a("../surface/Surface")),n=a("../util/utils"),o=_interopRequireDefault(a("./App"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}function ownKeys(e,t){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(e);t&&(i=i.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),a.push.apply(a,i)}return a}function _defineProperty(e,t,a){return t in e?Object.defineProperty(e,t,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[t]=a,e}const e=Math.pow(2,31)-1,c=["bodyCssClass"],l="\n@keyframes shift-rightwards {\n\t0% {\n\t\ttransform: translateX(-100%);\n\t}\n\t40% {\n\t\ttransform: translateX(0%);\n\t}\n\t60% {\n\t\ttransform: translateX(0%);\n\t}\n\t100% {\n\t\ttransform: translateX(100%);\n\t}\n}\n\n.lfr-spa-loading-bar {\n\tbackground: var(--primary);\n\tdisplay: none;\n\theight: 2px;\n\tleft: 0;\n\tposition: fixed;\n\tright: 0;\n\ttop: 0;\n\ttransform: translateX(100%);\n\tz-index: 2000;\n}\n\n.lfr-spa-loading .lfr-spa-loading-bar {\n\tanimation: shift-rightwards 1s ease-in-out infinite;\n\tanimation-delay: 0.4s;\n\tdisplay: block;\n}";class LiferayApp extends o.default{constructor({cacheExpirationTime:t,clearScreensCache:a,debugEnabled:o,navigationExceptionSelectors:s,portletsBlacklist:c,requestTimeout:u,userNotification:h,validStatusCodes:d}){super({navigationExceptionSelectors:s}),this._cacheExpirationTime=t,this._clearScreensCache=a,this._debugEnabled=o,this.portletsBlacklist=c,this.userNotification=h,this.validStatusCodes=d,this.setShouldUseFacade(!0),this.timeout=Math.max(u,0)||e,this.timeoutAlert=null,this.setLoadingCssClass("lfr-spa-loading"),this.on("beforeNavigate",this.onBeforeNavigate),this.on("endNavigate",this.onEndNavigate),this.on("navigationError",this.onNavigationError),this.on("startNavigate",this.onStartNavigate),Liferay.on("beforeScreenFlip",n.resetAllPortlets),Liferay.on("beforeScreenFlip",Liferay.destroyUnfulfilledPromises),Liferay.on("io:complete",this.onLiferayIOComplete,this);const f=document.body;f.id||(f.id="senna_surface"+(0,n.getUid)()),this.addSurfaces(new r.default(f.id)),document.head.appendChild((0,i.buildFragment)('"))),f.appendChild((0,i.buildFragment)('
'))}createScreenInstance(e,t){if(e===this.activePath){"1"===new URL(e,window.location.origin).searchParams.get("p_p_lifecycle")&&(this.activePath=this.activePath+"__".concat((0,n.getUid)()),this.screens[this.activePath]=this.screens[e],delete this.screens[e])}return super.createScreenInstance(e,t)}getCacheExpirationTime(){return this._cacheExpirationTime}getValidStatusCodes(){return this.validStatusCodes}isCacheEnabled(){return this.getCacheExpirationTime()>-1}isInPortletBlacklist(e){const t=this.portletsBlacklist.map((e=>'[id^="'.concat((0,n.getPortletBoundaryId)(e),'"]'))).join();return!!e.closest(t)}isScreenCacheExpired(e){let t=!1;if(0!==this.getCacheExpirationTime()){t=(new Date).getTime()-e.getCacheLastModified()>this.getCacheExpirationTime()}return t}onBeforeNavigate(e,t){(this._clearScreensCache||e.form)&&this.clearScreensCache(),this._clearLayoutData(),e.path=this._propagateParams(e),Liferay.fire("beforeNavigate",{app:this,originalEvent:t,path:e.path})}onDataLayoutConfigReady_(){Liferay.Layout&&Liferay.Data.layoutConfig?Liferay.Layout.init(Liferay.Data.layoutConfig):this.dataLayoutConfigReadyHandle_=Liferay.once("dataLayoutConfigReady",this.onDataLayoutConfigReady_)}onDocClickDelegate_(e){this.isInPortletBlacklist(e.target.closest(this.getLinkSelector()))||e.detail>1||super.onDocClickDelegate_(e)}onDocSubmitDelegate_(e){this.isInPortletBlacklist(e.target.closest(this.getFormSelector()))||super.onDocSubmitDelegate_(e)}onEndNavigate(e){Liferay.fire("endNavigate",{app:this,error:e.error,path:e.path}),this.pendingNavigate||(this._clearRequestTimer(),this._hideTimeoutAlert()),e.error||this.onDataLayoutConfigReady_(),AUI().Get._insertCache={},Liferay.DOMTaskRunner.reset()}onLiferayIOComplete(){this.clearScreensCache()}onNavigationError(e){if(e.error.requestPrematureTermination)window.location.href=e.path;else if(e.error.invalidStatus||e.error.requestError||e.error.timeout){let t='Il\x20y\x20a\x20eu\x20une\x20erreur\x20inattendue\x2e\x20Veuillez\x20rafraîchir\x20la\x20page\x20actuelle\x2e';this._debugEnabled&&(console.error(e.error),e.error.invalidStatus&&(t='La\x20requête\x20de\x20navigation\x20SPA\x20a\x20reçu\x20un\x20code\x20de\x20statut\x20HTTP\x20non\x20valide\x2e'),e.error.requestError&&(t='Une\x20erreur\x20inattendue\x20est\x20survenue\x20au\x20niveau\x20de\x20la\x20requête\x20SPA\x2e'),e.error.timeout&&(t='La\x20requête\x20SPA\x20a\x20expiré\x2e')),Liferay.Data.layoutConfig=this.dataLayoutConfig_,this._createNotification({message:t,title:'Erreur',type:"danger"})}}onStartNavigate(e){Liferay.fire("startNavigate",{app:this,path:e.path}),this._startRequestTimer(e.path)}setPortletsBlacklist(e){this.portletsBlacklist=e}setValidStatusCodes(e){this.validStatusCodes=e}_clearLayoutData(){this.dataLayoutConfig_=Liferay.Data.layoutConfig,Liferay.Data.layoutConfig=null,this.dataLayoutConfigReadyHandle_&&(this.dataLayoutConfigReadyHandle_.detach(),this.dataLayoutConfigReadyHandle_=null)}_clearRequestTimer(){this.requestTimer&&clearTimeout(this.requestTimer)}_createNotification(e){return new Promise((t=>{t((0,i.openToast)(function _objectSpread(e){for(var t=1;t{const a="_".concat(r,"_").concat(e),n=t.searchParams.get(a);n&&i.searchParams.set(a,n)})),i.toString()}_startRequestTimer(e){this._clearRequestTimer(),this.userNotification.timeout>0&&(this.requestTimer=setTimeout((()=>{Liferay.fire("spaRequestTimeout",{path:e}),this._hideTimeoutAlert(),this._createNotification({message:this.userNotification.message,title:this.userNotification.title,type:"warning"}).then((e=>{this.timeoutAlert=e}))}),this.userNotification.timeout))}updateHistory_(e,t,a,i){a&&a.redirectPath&&(a.path=a.redirectPath),super.updateHistory_(e,t,a,i)}}var s=LiferayApp;t.default=s}})); Liferay.Loader.define("frontend-js-spa-web@5.0.35/screen/RequestScreen",["module","exports","require","frontend-js-web","../util/utils","./Screen"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=r("frontend-js-web"),o=r("../util/utils"),n=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("./Screen"));function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);t&&(s=s.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,s)}return r}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}const e="Invalid status code",u="Failed to fetch",a="NetworkError when attempting to fetch resource.",c="Preflight response is not successful",h="Request error",d="Request timeout",l="Request terminated prematurely";class RequestScreen extends n.default{constructor(){super(),this.cacheable=!0,this.httpHeaders={"X-PJAX":"true","X-Requested-With":"XMLHttpRequest"},this.httpMethod=RequestScreen.GET,this.request=null,this.timeout=3e4}assertValidResponseStatusCode(t){if(!this.isValidResponseStatusCode(t)){const r=new Error(e);throw r.invalidStatus=!0,r.statusCode=t,r}}beforeUpdateHistoryPath(e){const t=this.getRequestPath();return t&&t!==e?t:e}beforeUpdateHistoryState(e){return e.senna&&e.form&&e.redirectPath===e.path?null:e}formatLoadPath(e){const t=new URL(e,window.location.origin);return t.hostname=window.location.hostname,t.protocol=window.location.protocol,window.location.port&&(t.port=window.location.port),t.toString()}getHttpHeaders(){return this.httpHeaders}getHttpMethod(){return this.httpMethod}getRequestPath(){const e=this.getRequest();if(e){let t=e.url;const r=this.getResponse();if(r){const e=r.url;e&&(t=e)}return(0,o.getUrlPath)(t)}return null}getResponse(){return this.response}getRequest(){return this.request}getTimeout(){return this.timeout}isValidResponseStatusCode(e){return e>=200&&e<=399}getFormData(e,t){const r=new FormData(e);return this.maybeAppendSubmitButtonValue_(r,t),r}load(e){const t=this.getCache();if(t)return Promise.resolve(t);let r=null,o=this.httpMethod;const n=function _objectSpread(e){for(var t=1;t(this.assertValidResponseStatusCode(e.status),this.setResponse(e),e.clone().text()))).then((e=>(o===RequestScreen.GET&&this.isCacheable()&&this.addCache(e),e))),new Promise(((e,t)=>{setTimeout((()=>t(new Error(d))),this.timeout)}))]).catch((e=>{switch(e.message){case d:e.timeout=!0;break;case l:case u:case a:case c:e.requestError=!0,e.requestPrematureTermination=!0;break;case h:default:e.requestError=!0}throw e}))}maybeAppendSubmitButtonValue_(e,t){t&&t.name&&e.append(t.name,t.value)}setHttpHeaders(e){this.httpHeaders=e}setHttpMethod(e){this.httpMethod=e.toLowerCase()}setRequest(e){this.request=e}setResponse(e){this.response=e}setTimeout(e){this.timeout=e}}RequestScreen.GET="get",RequestScreen.POST="post";var i=RequestScreen;t.default=i}})); Liferay.Loader.define("frontend-js-spa-web@5.0.35/screen/HtmlScreen",["module","exports","require","frontend-js-web","../surface/Surface","../util/utils","./RequestScreen"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r("frontend-js-web"),s=_interopRequireDefault(r("../surface/Surface")),o=r("../util/utils"),l=_interopRequireDefault(r("./RequestScreen"));function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}class HtmlScreen extends l.default{constructor(){super(),this.metaTagsSelector="meta",this.titleSelector="title"}activate(){super.activate(),this.releaseVirtualDocument(),this.pendingStyles=null}allocateVirtualDocumentForContent(e){this.virtualDocument||(this.virtualDocument=document.createElement("html")),this.copyNodeAttributesFromContent_(e,this.virtualDocument),this.virtualDocument.innerHTML=e}appendStyleIntoDocument_(e){if(e.matches(HtmlScreen.selectors.stylesTemporary)&&this.pendingStyles.push(e),e.id){const t=document.getElementById(e.id);if(t)return void t.parentNode.insertBefore(e,t.nextSibling)}document.head.appendChild(e)}assertSameBodyIdInVirtualDocument(){const e=this.virtualDocument.querySelector("body");document.body.id||(document.body.id="senna_surface_"+(0,o.getUid)()),e&&(e.id=document.body.id)}copyNodeAttributesFromContent_(e,t){e=(e=e.replace(/[<]\s*html/gi,"/gi,"/senna>"),t.innerHTML=e;const r=t.querySelector("senna");r&&((0,o.clearNodeAttributes)(t),(0,o.copyNodeAttributes)(r,t))}disposeInternal(){this.disposePendingStyles(),super.disposeInternal()}disposePendingStyles(){this.pendingStyles&&this.pendingStyles.forEach((e=>e.remove()))}evaluateScripts(e){return this.evaluateTrackedResources_(n.runScriptsInElement,HtmlScreen.selectors.scripts,HtmlScreen.selectors.scriptsTemporary,HtmlScreen.selectors.scriptsPermanent).then((()=>super.evaluateScripts(e)))}evaluateStyles(e){this.pendingStyles=[];return this.evaluateTrackedResources_(o.runStylesInElement,HtmlScreen.selectors.styles,HtmlScreen.selectors.stylesTemporary,HtmlScreen.selectors.stylesPermanent,this.appendStyleIntoDocument_.bind(this)).then((()=>super.evaluateStyles(e)))}evaluateFavicon_(){const e=this.virtualQuerySelectorAll_(HtmlScreen.selectors.favicon),t=this.querySelectorAll_(HtmlScreen.selectors.favicon);return new Promise((r=>{t.forEach((e=>e.remove())),this.runFaviconInElement_(e).then((()=>r()))}))}evaluateTrackedResources_(e,t,r,s,o){const l=this.virtualQuerySelectorAll_(t),c=this.querySelectorAll_(r);this.querySelectorAll_(s).forEach((e=>{const t=this.getResourceKey_(e);t&&(HtmlScreen.permanentResourcesInDoc[t]=!0)}));const a=(0,n.buildFragment)();return l.forEach((e=>{const t=this.getResourceKey_(e);HtmlScreen.permanentResourcesInDoc[t]||a.appendChild(e),t&&e.matches(s)&&(HtmlScreen.permanentResourcesInDoc[t]=!0)})),new Promise((t=>{e(a,(()=>{c.forEach((e=>e.remove())),t()}),o)}))}flip(e){return super.flip(e).then((()=>{(0,o.clearNodeAttributes)(document.documentElement),(0,o.copyNodeAttributes)(this.virtualDocument,document.documentElement),this.evaluateFavicon_(),this.updateMetaTags_()}))}updateMetaTags_(){const e=this.querySelectorAll_("meta"),t=this.metas;e&&(e.forEach((e=>e.remove())),t&&t.forEach((e=>document.head.appendChild(e))))}getResourceKey_(e){return e.id||e.href||e.src||""}getSurfaceContent(e){const t=this.virtualDocument.querySelector("#"+e);if(t){const r=t.querySelector("#"+e+"-"+s.default.DEFAULT);return r?r.innerHTML:t.innerHTML}}getTitleSelector(){return this.titleSelector}load(e){return super.load(e).then((e=>(this.allocateVirtualDocumentForContent(e),this.resolveTitleFromVirtualDocument(),this.resolveMetaTagsFromVirtualDocument(),this.assertSameBodyIdInVirtualDocument(),e)))}runFaviconInElement_(e){return new Promise((t=>{e.forEach((e=>{e.href=e.href+"?q="+Math.random(),document.head.appendChild(e)})),t()}))}virtualQuerySelectorAll_(e){return Array.prototype.slice.call(this.virtualDocument.querySelectorAll(e))}querySelectorAll_(e){return Array.prototype.slice.call(document.querySelectorAll(e))}releaseVirtualDocument(){this.virtualDocument=null}resolveTitleFromVirtualDocument(){const e=this.virtualDocument.querySelector(this.titleSelector);e&&this.setTitle(e.textContent.trim())}resolveMetaTagsFromVirtualDocument(){const e=this.virtualQuerySelectorAll_(this.metaTagsSelector);e&&this.setMetas(e)}setTitleSelector(e){this.titleSelector=e}}const e=':not([rel="Shortcut Icon"]):not([rel="shortcut icon"]):not([rel="icon"]):not([href$="favicon.icon"])';HtmlScreen.selectors={favicon:'link[rel="Shortcut Icon"],link[rel="shortcut icon"],link[rel="icon"],link[href$="favicon.icon"]',scripts:"script[data-senna-track]",scriptsPermanent:'script[data-senna-track="permanent"]',scriptsTemporary:'script[data-senna-track="temporary"]',styles:"style[data-senna-track],link[data-senna-track]".concat(e),stylesPermanent:'style[data-senna-track="permanent"],link[data-senna-track="permanent"]'.concat(e),stylesTemporary:'style[data-senna-track="temporary"],link[data-senna-track="temporary"]'.concat(e)},HtmlScreen.permanentResourcesInDoc={};var c=HtmlScreen;t.default=c}})); Liferay.Loader.define("frontend-js-spa-web@5.0.35/screen/EventScreen",["module","exports","require","./HtmlScreen"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var s=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("./HtmlScreen"));class EventScreen extends s.default{constructor(){super(),this.cacheable=!1,this.timeout=Liferay.SPA.app.timeout}dispose(){super.dispose(),Liferay.fire("screenDispose",{app:Liferay.SPA.app,screen:this})}activate(){super.activate(),Liferay.fire("screenActivate",{app:Liferay.SPA.app,screen:this})}addCache(e){super.addCache(e),this.cacheLastModified=(new Date).getTime()}checkRedirectPath(e){const t=Liferay.SPA.app;Liferay.SPA.__capturedFormElement__||t.findRoute(e)||(window.location.href=e)}deactivate(){super.deactivate(),Liferay.fire("screenDeactivate",{app:Liferay.SPA.app,screen:this})}beforeScreenFlip(){Liferay.fire("beforeScreenFlip",{app:Liferay.SPA.app,screen:this})}copyBodyAttributes(){const e=this.virtualDocument.querySelector("body");document.body.className=e.className,document.body.onload=e.onload}evaluateStyles(e){const t=document.querySelector("html").lang.replace("-","_"),r=this.virtualDocument.lang.replace("-","_");return t!==r&&(this.stylesPermanentSelector_=s.default.selectors.stylesPermanent,this.stylesTemporarySelector_=s.default.selectors.stylesTemporary,this.makePermanentSelectorsTemporary_(t,r)),super.evaluateStyles(e).then(this.restoreSelectors_.bind(this))}flip(e){return this.copyBodyAttributes(),Promise.resolve(this.beforeScreenFlip()).then(super.flip(e)).then((()=>{this.runBodyOnLoad(),Liferay.fire("screenFlip",{app:Liferay.SPA.app,screen:this})}))}getCache(){let e=null;const t=Liferay.SPA.app;return t.isCacheEnabled()&&!t.isScreenCacheExpired(this)&&(e=super.getCache()),e}getCacheLastModified(){return this.cacheLastModified}isValidResponseStatusCode(e){const t=Liferay.SPA.app.getValidStatusCodes();return e>=200&&e<=500||t.indexOf(e)>-1}load(e){return super.load(e).then((t=>{const r=this.beforeUpdateHistoryPath(e);return this.checkRedirectPath(r),Liferay.fire("screenLoad",{app:Liferay.SPA.app,content:t,screen:this}),t}))}makePermanentSelectorsTemporary_(e,t){s.default.selectors.stylesTemporary=s.default.selectors.stylesTemporary.split(",").concat(s.default.selectors.stylesPermanent.split(",").map((t=>"".concat(t,'[href*="').concat(e,'"]')))).join(),s.default.selectors.stylesPermanent=s.default.selectors.stylesPermanent.split(",").map((e=>"".concat(e,'[href*="').concat(t,'"]'))).join()}restoreSelectors_(){s.default.selectors.stylesPermanent=this.stylesPermanentSelector_||s.default.selectors.stylesPermanent,s.default.selectors.stylesTemporary=this.stylesTemporarySelector_||s.default.selectors.stylesTemporary}runBodyOnLoad(){const e=document.body.onload;e&&e()}runFaviconInElement_(e){return super.runFaviconInElement_(e).then((()=>{e.forEach((e=>{e.type||-1===e.href.indexOf(".ico")||(e.type="image/x-icon")}))}))}}var a=EventScreen;t.default=a}})); Liferay.Loader.define("frontend-js-spa-web@5.0.35/screen/ActionURLScreen",["module","exports","require","../util/utils","./EventScreen"],(function(e,t,r){window;{Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r("../util/utils"),i=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(r("./EventScreen"));class ActionURLScreen extends i.default{constructor(){super(),this.httpMethod="POST"}getRequestPath(){let e=null;if(this.getRequest()){const t=new URL(super.getRequestPath(),window.location.origin);"1"===t.searchParams.get("p_p_lifecycle")&&t.searchParams.set("p_p_lifecycle","0"),e=(0,n.getUrlPath)(t.toString())}return e}}var u=ActionURLScreen;t.default=u}})); Liferay.Loader.define("frontend-js-spa-web@5.0.35/screen/RenderURLScreen",["module","exports","require","./EventScreen"],(function(e,r,n){window;{Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var t=function _interopRequireDefault(e){return e&&e.__esModule?e:{default:e}}(n("./EventScreen"));class RenderURLScreen extends t.default{constructor(){super(),this.cacheable=!0}}var d=RenderURLScreen;r.default=d}})); Liferay.Loader.define("frontend-js-spa-web@5.0.35/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}}}));