import{Ab as f,Cd as b,Jb as v,Ka as g,Kb as S,Xh as y,aa as r,fa as c,ga as p,ib as d,ii as w,jb as m,pf as a,rb as h,yd as C,zc as R}from"./chunk-AVPM423Z.js";import{i as u,l}from"./chunk-W5TMGCPH.js";var k=["root"],Q=(()=>{let i=class i{metaService=r(y);route=r(C);router=r(b);pluginService=r(w);root=R("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){a.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 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(i,"\u0275fac",function(t){return new(t||i)}),u(i,"\u0275cmp",g({type:i,selectors:[["ng-component"]],viewQuery:function(t,o){t&1&&v(o.root,k,5),t&2&&S()},decls:2,vars:0,consts:[["root",""],[3,"click"]],template:function(t,o){if(t&1){let n=h();d(0,"div",1,0),f("click",function(P){return c(n),p(o.onRootClick(P))}),m()}},encapsulation:2}));let s=i;return s})();export{Q as a};
/**i18n:ceac57349051bcddcb40dd2878e0abcb86556d5ceb9d6109d22ac3f1ae3cc7b1*/
//# sourceMappingURL=chunk-XS7HJLVU.js.map
