import{a as A}from"./chunk-WRWV66Q6.js";import{b as c}from"./chunk-JPJ4MDDS.js";import{b as z}from"./chunk-HAY4PBKI.js";import"./chunk-KHRLI7AH.js";import{a as j}from"./chunk-TERG3RFO.js";import"./chunk-7MB5OJWB.js";import"./chunk-SQLTBC3J.js";import"./chunk-4L2YKAMY.js";import{a as b}from"./chunk-TYGOBYEQ.js";import{a as V}from"./chunk-RKQVCQGG.js";import{$c as x,Bb as y,Ca as s,Cb as I,Da as a,Kb as C,Na as u,Va as v,ba as h,cb as l,cd as U,db as p,r as f,rb as g,sg as R,tc as S}from"./chunk-X3RCWQ3R.js";import{i}from"./chunk-SR6RTMQI.js";function _(o,r){if(o&1&&(l(0,"my-alert",2),y(1),p()),o&2){let L=g();s(),I(L.error);}}var F=(()=>{let r=class r{constructor(e,t,n){i(this,"route");i(this,"router");i(this,"search");i(this,"error","");this.route=e,this.router=t,this.search=n;}ngOnInit(){let e=this.route.snapshot.queryParams.uri;if(!e){this.error="Il parametro URL manca nei parametri URL";return;}this.loadUrl(e);}loadUrl(e){f([this.search.searchVideos({search:e}),this.search.searchVideoChannels({search:e})]).subscribe(([t,n])=>{let m;if(t.data.length!==0){let d=t.data[0];m=b.buildWatchUrl(d);}else if(n.data.length!==0)m="/c/"+new V(n.data[0]).nameWithHost;else{this.error="Impossibile accedere alla risorsa remota";return;}this.router.navigateByUrl(m);});}};i(r,"\u0275fac",function(t){return new(t||r)(a(x),a(U),a(c));}),i(r,"\u0275cmp",h({type:r,selectors:[["my-remote-interaction"]],standalone:!0,features:[C],decls:2,vars:1,consts:[[1,"root"],["type","danger",4,"ngIf"],["type","danger"]],template:function(t,n){t&1&&(l(0,"div",0),u(1,_,2,1,"my-alert",1),p()),t&2&&(s(),v("ngIf",n.error));},dependencies:[S,j],encapsulation:2}));let o=r;return o;})();var O=[{path:"",component:F,providers:[A,c,z],canActivate:[R],data:{meta:{title:"Interazione remota"}}}];export{O as default};/**i18n:3d16453f213eb5db982e7e7dd90631843ac5d3f860726a614777c3e9e3f9b57e*///# sourceMappingURL=chunk-BQVAGLRE.js.map