import{Ab as f,Bd as b,Dg as a,Jb as v,Ka as g,Kb as S,Uh as y,aa as r,fa as c,fi as w,ga as p,ib as d,jb as m,rb as h,xd as C,zc as R}from"./chunk-CUA2BO3S.js";import{i as u,l}from"./chunk-75J4RO44.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:42440f0a8726af1836b15b193adfd3f46a3ecd983a1ed2a1e05982c4f600c8a1*/
//# sourceMappingURL=chunk-NLVZDYVB.js.map
