import{a as b}from"./chunk-LIQYYSC5.js";import{b as a}from"./chunk-KXY7ZCGO.js";import"./chunk-UBU2CFVX.js";import"./chunk-QSSD454H.js";import{a as V}from"./chunk-4AW7XUEV.js";import"./chunk-OW5DLQI4.js";import"./chunk-NT6MJVBJ.js";import{a as I,b as R}from"./chunk-5FHECZHZ.js";import{Ah as U,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}from"./chunk-DZBHF6HI.js";import{i as m}from"./chunk-IQVXR75E.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="\u0645\u0639\u0644\u0645\u0629 URL \u0645\u0641\u0642\u0648\u062F\u0629 \u0641\u064A \u0645\u0639\u0644\u0645\u0627\u062A 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="\u0644\u0627 \u064A\u0645\u0643\u0646 \u0627\u0644\u0648\u0635\u0648\u0644 \u0625\u0644\u0649 \u0627\u0644\u0645\u0648\u0631\u062F \u0627\u0644\u0628\u0639\u064A\u062F";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:"\u0627\u0644\u062A\u0641\u0627\u0639\u0644 \u0639\u0646 \u0628\u064F\u0639\u062F"}}}];export{J as default};/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*///# sourceMappingURL=chunk-EJOFSYXA.js.map