import{D as CF,Do as kg,Eo as kb,Fa as eo,Gr as Va,Ia as f$,Q as EV,Qi as bV,Wa as g,as as oA,ho as j$,it as FB,nt as Et,vc as wp}from"./chunk-B_pj7Jpm.js";import{r as g$1,t as K}from"./chunk-qQMrTuzm.js";import"./chunk-CagJEiiY.js";import{t as c}from"./chunk-D7eF6KoS2.js";import"./chunk-CQiHXmZG2.js";import"./chunk-TcpfKQW12.js";import"./chunk-KfmDNYov.js";import{t as A}from"./chunk-FhARnEsq.js";import{t as p}from"./chunk-DjbsLBsJ.js";function D(o,t){if(o&1&&(wp(0,`my-alert`,1),j$(1),kb()),o&2){let e=f$();FB(),oA(e.error)}}var j=[{path:``,component:class o{route=g(eo);router=g(Et);search=g(A);error=``;ngOnInit(){let t=this.route.snapshot.queryParams.uri;if(!t){this.error="Falta el paràmetre d'URL als paràmetres d'URL";return}this.loadUrl(t)}loadUrl(t){CF([this.search.searchVideos({search:t}),this.search.searchVideoChannels({search:t})]).subscribe(([e,n])=>{let m;if(e.data.length!==0){let l=e.data[0];m=K.buildWatchUrl(l)}else if(n.data.length!==0)m=`/c/`+new g$1(n.data[0]).nameWithHost;else{this.error="No es pot accedir al recurs remot";return}this.router.navigateByUrl(m)})}static ɵfac=function(e){return new(e||o)};static ɵcmp=Va({type:o,selectors:[[`my-remote-interaction`]],decls:2,vars:1,consts:[[1,`root`],[`type`,`danger`]],template:function(e,n){e&1&&(wp(0,`div`,0),EV(1,D,2,1,`my-alert`,1),kb()),e&2&&(FB(),bV(n.error?1:-1))},dependencies:[c],encapsulation:2,changeDetection:1})},providers:[p,A],canActivate:[kg],data:{meta:{title:"Interacció remota"}}}];export{j as default};
//# debugId=dcc851b4-1b05-5efd-8201-d58f781a8c4b
//# sourceMappingURL=chunk-BnZBdrT52.js.map