import{a as b}from"./chunk-5M66HCDP.js";import{b as a}from"./chunk-JNEEUPD6.js";import"./chunk-STKO4QAE.js";import"./chunk-5NI77QMM.js";import{a as V}from"./chunk-AEY4IYSS.js";import"./chunk-XYFON6WE.js";import"./chunk-LWCNLX24.js";import{a as I,b as R}from"./chunk-LYBUFCRR.js";import{$a as v,Aa as s,Bb as C,Bd as S,Ka as h,Qb as g,Rb as y,Uh as U,_a as u,aa as n,fb as l,gb as d,r as f,xd as x}from"./chunk-THW6YIIG.js";import{i as m}from"./chunk-PTJGHD3V.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="\u067E\u0627\u0631\u0627\u0645\u062A\u0631 URL \u062F\u0631 \u067E\u0627\u0631\u0627\u0645\u062A\u0631\u0647\u0627\u06CC URL \u06AF\u0645 \u0634\u062F\u0647 \u0627\u0633\u062A";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="\u0646\u0645\u06CC \u062A\u0648\u0627\u0646\u062F \u0628\u0647 \u0645\u0646\u0627\u0628\u0639 \u0627\u0632 \u0631\u0627\u0647 \u062F\u0648\u0631 \u062F\u0633\u062A\u0631\u0633\u06CC \u067E\u06CC\u062F\u0627 \u06A9\u0646\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:"\u062A\u0639\u0627\u0645\u0644 \u0627\u0632 \u0631\u0627\u0647 \u062F\u0648\u0631"}}}];export{J as default};/**i18n:90f1dd82a779b57eddc91ef20913c88eecaa9632bba8ac04ad50f47ae2b82df7*///# sourceMappingURL=chunk-ERX3IIG2.js.map