import{Db as v,Eg as w,Na as g,Ob as S,Pb as R,Sa as h,ba as r,ha as c,ia as p,if as a,ld as C,od as y,pb as d,qb as f,vb as m,wg as b}from"./chunk-OX24XL2F.js";import{i as u,j as l}from"./chunk-FQ4ILEWG.js";var k=["root"],Q=(()=>{let o=class o{metaService=r(w);route=r(C);router=r(y);pluginService=r(b);root=g("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 i=t.closest("a");if(!i)return;let n=i.getAttribute("href")||"";!i.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){a.error('Missing "parentRoute" URL data to load plugin route '+this.route.snapshot.url);return}let e="/"+this.route.snapshot.url.map(i=>i.path).join("/"),t=this.pluginService.getRegisteredClientRoute(e,this.route.snapshot.data.parentRoute);if(!t)return a.info(`Could not find registered route ${e}`,{routes:this.pluginService.getAllRegisteredClientRoutes()}),this.router.navigate(["/404"],{skipLocationChange:!0});t.title&&this.metaService.setTitle(t.title),t.onMount({rootEl:this.root().nativeElement})})}};u(o,"\u0275fac",function(t){return new(t||o)}),u(o,"\u0275cmp",h({type:o,selectors:[["ng-component"]],viewQuery:function(t,i){t&1&&S(i.root,k,5),t&2&&R()},decls:2,vars:0,consts:[["root",""],[3,"click"]],template:function(t,i){if(t&1){let n=m();d(0,"div",1,0),v("click",function(P){return c(n),p(i.onRootClick(P))}),f()}},encapsulation:2}));let s=o;return s})();export{Q as a};
/**i18n:93ef1b86561141301263c1f349fa8abb749523958c3a6dfaf46ed36d22b0a506*/
//# sourceMappingURL=chunk-WNW5ZMM2.js.map
