import{Cb as v,Lh as b,Na as g,Nb as S,Ob as R,Sa as h,Yh as w,aa as r,ha as c,ia as p,ob as d,pb as f,pd as C,td as y,ub as m,ug as a}from"./chunk-GKQGDBUU.js";import{i as u,l}from"./chunk-QVFSZZWQ.js";var k=["root"],Q=(()=>{let o=class o{metaService=r(b);route=r(C);router=r(y);pluginService=r(w);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:42345378061bf3c93df67acfa161b751a7b03cc91f3ede7c1f1cdf2bba62fe26*/
//# sourceMappingURL=chunk-UC7CXAHR.js.map
