import{a as z}from"./chunk-2X27RDBL.js";import{b as a}from"./chunk-W2WMIABB.js";import{b as j}from"./chunk-FEWUV3UJ.js";import"./chunk-NJ5QGAXC.js";import{a as b}from"./chunk-YXDC36MS.js";import"./chunk-DRC3434R.js";import"./chunk-V2URXGKR.js";import"./chunk-HQ2QSLRU.js";import{a as V}from"./chunk-R3OBDIDF.js";import{a as R}from"./chunk-MOA5OONJ.js";import{$a as v,Fa as s,Ga as n,Hb as y,Ib as I,La as h,Sa as u,bd as x,ed as S,ib as l,jb as p,pg as U,s as f,vc as C,xb as g}from"./chunk-4JM6MIZ5.js";import{i as m}from"./chunk-QJQRWPYR.js";function _(i,r){if(i&1&&(l(0,"my-alert",2),y(1),p()),i&2){let L=g();s(),I(L.error);}}var A=(()=>{let r=class r{route;router;search;error="";constructor(e,t,o){this.route=e,this.router=t,this.search=o;}ngOnInit(){let e=this.route.snapshot.queryParams.uri;if(!e){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(e);}loadUrl(e){f([this.search.searchVideos({search:e}),this.search.searchVideoChannels({search:e})]).subscribe(([t,o])=>{let c;if(t.data.length!==0){let d=t.data[0];c=V.buildWatchUrl(d);}else if(o.data.length!==0)c="/c/"+new R(o.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(r,"\u0275fac",function(t){return new(t||r)(n(x),n(S),n(a));}),m(r,"\u0275cmp",h({type:r,selectors:[["my-remote-interaction"]],decls:2,vars:1,consts:[[1,"root"],["type","danger",4,"ngIf"],["type","danger"]],template:function(t,o){t&1&&(l(0,"div",0),u(1,_,2,1,"my-alert",1),p()),t&2&&(s(),v("ngIf",o.error));},dependencies:[C,b],encapsulation:2}));let i=r;return i;})();var N=[{path:"",component:A,providers:[z,a,j],canActivate:[U],data:{meta:{title:"\u0627\u0644\u062A\u0641\u0627\u0639\u0644 \u0639\u0646 \u0628\u064F\u0639\u062F"}}}];export{N as default};/**i18n:68865f44f2a527c44cf5136a17c76a0ff8308c2bae5c7c8d50070a5fb9847c44*///# sourceMappingURL=chunk-LM2UJRIG.js.map