import{a as b}from"./chunk-3POX2CFO.js";import{b as a}from"./chunk-IMQSKM6F.js";import"./chunk-ECYL644H.js";import"./chunk-7UKHNYRH.js";import{a as V}from"./chunk-T5L6J2ZM.js";import"./chunk-6VGVSUFA.js";import"./chunk-2NXPS2XG.js";import{a as I,b as R}from"./chunk-EENIHTMQ.js";import{Da as s,Gd as x,Jb as C,Kd as S,Na as h,Yb as g,Zb as y,ba as n,gb as u,hb as v,nb as l,ob as d,s as f,zh as U}from"./chunk-L6W7X4TF.js";import{i as m}from"./chunk-WH5WJFMZ.js";function L(o,e){if(o&1&&(l(0,"my-alert",1),g(1),d()),o&2){let A=C();s(),y(A.error);}}var z=(()=>{let e=class e{route=n(x);router=n(S);search=n(a);error="";ngOnInit(){let t=this.route.snapshot.queryParams.uri;if(!t){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(t);}loadUrl(t){f([this.search.searchVideos({search:t}),this.search.searchVideoChannels({search:t})]).subscribe(([r,i])=>{let c;if(r.data.length!==0){let p=r.data[0];c=I.buildWatchUrl(p);}else if(i.data.length!==0)c="/c/"+new R(i.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(c);});}};m(e,"\u0275fac",function(r){return new(r||e)();}),m(e,"\u0275cmp",h({type:e,selectors:[["my-remote-interaction"]],decls:2,vars:1,consts:[[1,"root"],["type","danger"]],template:function(r,i){r&1&&(l(0,"div",0),u(1,L,2,1,"my-alert",1),d()),r&2&&(s(),v(i.error?1:-1));},dependencies:[V],encapsulation:2}));let o=e;return o;})();var J=[{path:"",component:z,providers:[b,a],canActivate:[U],data:{meta:{title:"\u0412\u0456\u0434\u0434\u0430\u043B\u0435\u043D\u0430 \u0432\u0437\u0430\u0454\u043C\u043E\u0434\u0456\u044F"}}}];export{J as default};/**i18n:ae7e6707fc51a9e1f6f015929aece8afe43a92a094f09f07f0463afe6c89573f*///# sourceMappingURL=chunk-S5JPIDST.js.map