import {g,er as pg,aO as Vr,b2 as mt,a$ as Fi,x as xpe,aE as L,j,b as Pa,ci as db,dt as ux,cj as fb,p as px,c as IV}from'./main-DEZ5cZzu.js';var R=["root"],A=(()=>{class r{metaService=g(pg);route=g(Vr);router=g(mt);pluginService=g(Fi);root=xpe("root");urlSub;ngAfterViewInit(){this.urlSub=this.route.url.subscribe(()=>{this.loadRoute();});}ngOnDestroy(){this.urlSub&&this.urlSub.unsubscribe();}onRootClick(e){let t=e.target;if(!t)return;let o=t.closest("a");if(!o)return;let n=o.getAttribute("href")||"";!o.target&&n.startsWith("/")&&(e.preventDefault(),e.stopPropagation(),this.router.navigateByUrl(n));}loadRoute(){return L(this,null,function*(){if(yield this.pluginService.ensurePluginsAreLoaded(this.route.snapshot.data.pluginScope||"common"),!this.route.snapshot.data.parentRoute){j.error('Missing "parentRoute" URL data to load plugin route '+this.route.snapshot.url);return}let e="/"+this.route.snapshot.url.map(o=>o.path).join("/"),t=this.pluginService.getRegisteredClientRoute(e,this.route.snapshot.data.parentRoute);if(!t)return j.info(`Could not find registered route ${e}`,{routes:this.pluginService.getAllRegisteredClientRoutes()}),this.router.navigate(["/404"],{skipLocationChange:true});t.title&&this.metaService.setTitle(t.title),t.onMount({rootEl:this.root().nativeElement});})}static \u0275fac=function(t){return new(t||r)};static \u0275cmp=Pa({type:r,selectors:[["ng-component"]],viewQuery:function(t,o){t&1&&px(o.root,R,5),t&2&&IV();},decls:2,vars:0,consts:[["root",""],[3,"click"]],template:function(t,o){t&1&&(db(0,"div",1,0),ux("click",function(C){return o.onRootClick(C)}),fb());},encapsulation:2,changeDetection:1})}return r})();/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/export{A};//# sourceMappingURL=chunk-CJ7flLBI.js.map
