import{C}from'./chunk-Jd_jCtjO.js';import{d7 as ck,g,aO as Vr,b2 as mt,aM as N1,dy as K,eZ as E,b as Pa,bW as v,s as sp,k as w2,d as lb,W as WB,o as x2,a6 as ZV,S as SV,ak as xx}from'./main-C0Sl1OBd.js';import{j}from'./chunk-DQ5VcJyq.js';import'./chunk-qdb8laCV.js';import'./chunk-Cmog0EIA.js';function V(t,_){if(t&1&&(sp(0,"my-alert",1),ZV(1),lb()),t&2){let e=SV();WB(),xx(e.error);}}var D=(()=>{class t{route=g(Vr);router=g(mt);search=g(j);error="";ngOnInit(){let e=this.route.snapshot.queryParams.uri;if(!e){this.error="\u041F\u0430\u0440\u0430\u043C\u0435\u0442\u0440 URL \u0432\u0456\u0434\u0441\u0443\u0442\u043D\u0456\u0439 \u0443 \u043F\u0430\u0440\u0430\u043C\u0435\u0442\u0440\u0430\u0445 URL";return;}this.loadUrl(e);}loadUrl(e){N1([this.search.searchVideos({search:e}),this.search.searchVideoChannels({search:e})]).subscribe(([o,r])=>{let a;if(o.data.length!==0){let l=o.data[0];a=K.buildWatchUrl(l);}else if(r.data.length!==0)a="/c/"+new E(r.data[0]).nameWithHost;else{this.error="\u041D\u0435 \u0432\u0434\u0430\u0454\u0442\u044C\u0441\u044F \u043E\u0442\u0440\u0438\u043C\u0430\u0442\u0438 \u0434\u043E\u0441\u0442\u0443\u043F \u0434\u043E \u0432\u0456\u0434\u0434\u0430\u043B\u0435\u043D\u043E\u0433\u043E \u0440\u0435\u0441\u0443\u0440\u0441\u0443";return;}this.router.navigateByUrl(a);});}static ɵfac=function(o){return new(o||t)();};static ɵcmp=Pa({type:t,selectors:[["my-remote-interaction"]],decls:2,vars:1,consts:[[1,"root"],["type","danger"]],template:function(o,r){o&1&&(sp(0,"div",0),w2(1,V,2,1,"my-alert",1),lb()),o&2&&(WB(),x2(r.error?1:-1));},dependencies:[v],encapsulation:2,changeDetection:1});}return t;})();var G=[{path:"",component:D,providers:[C,j],canActivate:[ck],data:{meta:{title:"\u0412\u0456\u0434\u0434\u0430\u043B\u0435\u043D\u0430 \u0432\u0437\u0430\u0454\u043C\u043E\u0434\u0456\u044F"}}}];/**i18n:c8855ca17fb20171aa9dd43d012e42547cb1f0cfd9c21d4dc05679bbbdf5ccb8*/export{G as default};//# sourceMappingURL=chunk-CLTl6ySS.js.map