-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path823.df8871b95367d51b.js
1 lines (1 loc) · 81 KB
/
823.df8871b95367d51b.js
1
"use strict";(self.webpackChunklivestream_recorder=self.webpackChunklivestream_recorder||[]).push([[823],{6823:(Qn,K,h)=>{h.r(K),h.d(K,{PageModule:()=>$n});var g=h(6895),t=h(4650);let j=(()=>{class n{static isString(e){return"string"==typeof e||e instanceof String}static caseInsensitiveSort(e,o){return n.isString(e)&&n.isString(o)?e.localeCompare(o):n.defaultCompare(e,o)}static defaultCompare(e,o){return e&&e instanceof Date&&(e=e.getTime()),o&&o instanceof Date&&(o=o.getTime()),e===o?0:null==e?1:null==o?-1:e>o?1:-1}static parseExpression(e){return(e=(e=e.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"")).split(".")}static getValue(e,o){for(let r=0,a=o.length;r<a;++r){if(!e)return;const s=o[r];if(!(s in e))return;e="function"==typeof e[s]?e[s]():e[s]}return e}static setValue(e,o,r){let a;for(a=0;a<r.length-1;a++)e=e[r[a]];e[r[a]]=o}transform(e,o,r,a=!1,s){return e&&(Array.isArray(o)?this.multiExpressionTransform(e,o.slice(),r,a,s):Array.isArray(e)?this.sortArray(e.slice(),o,r,a,s):"object"==typeof e?this.transformObject(Object.assign({},e),o,r,a,s):e)}sortArray(e,o,r,a,s){const l=o&&-1!==o.indexOf(".");let c;l&&(o=n.parseExpression(o)),c=s&&"function"==typeof s?s:a?n.caseInsensitiveSort:n.defaultCompare;const u=e.sort((p,v)=>o?l?c(n.getValue(p,o),n.getValue(v,o)):p&&v?c(p[o],v[o]):c(p,v):c(p,v));return r?u.reverse():u}transformObject(e,o,r,a,s){const l=n.parseExpression(o);let c=l.pop(),u=n.getValue(e,l);return Array.isArray(u)||(l.push(c),c=null,u=n.getValue(e,l)),u&&n.setValue(e,this.transform(u,c,r,a),l),e}multiExpressionTransform(e,o,r,a=!1,s){return o.reverse().reduce((l,c)=>this.transform(l,c,r,a,s),e)}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275pipe=t.Yjl({name:"orderBy",type:n,pure:!1}),n})(),Te=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[j]}),n})();var m=h(4006),Se=h(8929);let Xe=(()=>{class n{constructor(e){this.document=e,this.width=this.getWidth()}getWidth(){const e=this.document.createElement("div");e.style.visibility="hidden",e.style.width="100px",e.style.msOverflowStyle="scrollbar",this.document.body.appendChild(e);const o=e.offsetWidth;e.style.overflow="scroll";const r=this.document.createElement("div");r.style.width="100%",e.appendChild(r);const a=r.offsetWidth;return e.parentNode.removeChild(e),o-a}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(g.K0))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac}),n})(),Ke=(()=>{class n{getDimensions(e){return e.getBoundingClientRect()}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac}),n})(),je=(()=>{class n{constructor(){this.columnInputChanges=new Se.xQ}get columnInputChanges$(){return this.columnInputChanges.asObservable()}onInputChange(){this.columnInputChanges.next()}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac}),n})();const z={},ne=typeof document<"u"?document.createElement("div").style:void 0,Q=function(){const n=typeof window<"u"?window.getComputedStyle(document.documentElement,""):void 0,i=typeof n<"u"?Array.prototype.slice.call(n).join("").match(/-(moz|webkit|ms)-/):null,e=null!==i?i[1]:void 0,o=typeof e<"u"?"WebKit|Moz|MS|O".match(new RegExp("("+e+")","i"))[1]:void 0;return o?{dom:o,lowercase:e,css:`-${e}-`,js:e[0].toUpperCase()+e.substr(1)}:void 0}();function U(n){const i=function G(n){return(n=(n=(n=n.replace(/[^a-zA-Z0-9 ]/g," ")).replace(/([a-z](?=[A-Z]))/g,"$1 ")).replace(/([^a-zA-Z0-9 ])|^[0-9]+/g,"").trim().toLowerCase()).replace(/([ 0-9]+)([a-zA-Z])/g,function(i,e,o){return e.trim()+o.toUpperCase()})}(n);return z[i]||(void 0!==Q&&void 0!==ne[Q.css+n]?z[i]=Q.css+n:void 0!==ne[n]&&(z[i]=n)),z[i]}typeof window<"u"&&U("transform"),typeof window<"u"&&U("backfaceVisibility"),typeof window<"u"&&U("transform"),typeof window<"u"&&U("perspective");const oe=typeof window<"u"?window.navigator.userAgent:"Chrome";/Safari\//.test(oe)&&/Chrome\//.test(oe);let bt=(()=>{class n{static forRoot(e){return{ngModule:n,providers:[{provide:"configuration",useValue:e}]}}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({providers:[Xe,Ke,je],imports:[[g.ez]]}),n})();typeof document<"u"&&!document.elementsFromPoint&&(document.elementsFromPoint=function vt(n,i){const e=[],o=[];let r,a,s;for(;(r=document.elementFromPoint(n,i))&&-1===e.indexOf(r)&&null!=r;)e.push(r),o.push({value:r.style.getPropertyValue("pointer-events"),priority:r.style.getPropertyPriority("pointer-events")}),r.style.setProperty("pointer-events","none","important");for(a=o.length;s=o[--a];)e[a].style.setProperty("pointer-events",s.value?s.value:"",s.priority);return e});var _t=h(671),_=h(5861),T=h(9914),re=h(2986),C=h(7595),A=h(9340),E=h(2959),S=h(8423),V=h(8613),y=h(272),I=h(7480),w=h(8723);let ae=(()=>{class n{constructor(){this.VideoStatus=C.K}ngOnInit(){}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-status-badge"]],inputs:{videoStatus:"videoStatus"},decls:3,vars:11,consts:[[1,"tags"],[1,"badge"]],template:function(e,o){1&e&&(t.TgZ(0,"span",0)(1,"span",1),t._uU(2),t.qZA()()),2&e&&(t.xp6(1),t.ekj("bg-primary",o.videoStatus<=o.VideoStatus.Scheduled)("bg-secondary",o.videoStatus==o.VideoStatus.Pending||o.videoStatus==o.VideoStatus.Expired||o.videoStatus==o.VideoStatus.Missing||o.videoStatus==o.VideoStatus.Skipped||o.videoStatus==o.VideoStatus.Edited)("bg-success",o.videoStatus>=o.VideoStatus.Archived&&o.videoStatus<50||o.videoStatus==o.VideoStatus.Exist)("bg-warning",o.videoStatus>o.VideoStatus.WaitingToRecord&&o.videoStatus<40)("bg-danger",o.videoStatus==o.VideoStatus.Reject||o.videoStatus==o.VideoStatus.Error||o.videoStatus==o.VideoStatus.Deleted),t.xp6(1),t.Oqu(o.VideoStatus[o.videoStatus]))}}),n})();const wt=function(n,i,e){return[n,i,e]},se=function(n,i){return["/channels",n,"videos",i]},Ct=function(n){return["/channels",n]};let le=(()=>{class n{constructor(e){this.configService=e,this.VideoStatus=C.K}ngOnInit(){this.blobstorage_public=I.E.environment.blobstorage_public,this.thumbnail=this.video?.Thumbnail?this.blobstorage_public+"/thumbnails/"+this.video.Thumbnail:this.video?.Channel?.Banner?this.blobstorage_public+"/banner/"+this.video.Channel.Banner:"/assets/img/preview.png",this.thumbnailAvif=this.thumbnail.substring(0,this.thumbnail.lastIndexOf("."))+".avif"}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(I.E))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-video-card"]],inputs:{video:"video"},decls:20,vars:27,consts:[[1,"card"],[1,"card-content","text-center"],[3,"routerLink"],["type","image/avif",3,"srcset"],["alt","Video Thumbnail",1,"img-fluid",3,"src"],[1,"card-header"],[1,"card-title","text-truncate"],[1,"text-break"],[1,"card-footer","text-muted","pt-0"],[1,"float-left"],[1,"float-right",3,"videoStatus"]],template:function(e,o){if(1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"a",2)(3,"picture"),t._UZ(4,"source",3)(5,"img",4),t.qZA()(),t.TgZ(6,"div",5)(7,"a",2)(8,"h4",6),t._uU(9),t.qZA()(),t.TgZ(10,"a",2)(11,"p"),t._uU(12),t.TgZ(13,"span",7),t._uU(14),t.qZA()()()()(),t.TgZ(15,"div",8)(16,"span",9),t._uU(17),t.ALo(18,"date"),t.qZA(),t._UZ(19,"app-status-badge",10),t.qZA()()),2&e){let r,a;t.ekj("border-danger",t.kEZ(15,wt,o.VideoStatus.Edited,o.VideoStatus.Deleted,o.VideoStatus.Reject).includes(o.video.SourceStatus)),t.xp6(2),t.Q6J("routerLink",t.WLB(19,se,o.video.ChannelId,o.video.id)),t.xp6(2),t.Q6J("srcset",o.thumbnailAvif,t.LSH),t.xp6(1),t.Q6J("src",o.thumbnail,t.LSH),t.xp6(2),t.Q6J("routerLink",t.WLB(22,se,o.video.ChannelId,o.video.id)),t.xp6(2),t.Oqu(o.video.Title?o.video.Title:"(No Title)"),t.xp6(1),t.Q6J("routerLink",t.VKq(25,Ct,o.video.ChannelId)),t.xp6(2),t.hij(" ",null!==(r=null==o.video.Channel?null:o.video.Channel.ChannelName)&&void 0!==r?r:o.video.ChannelId," "),t.xp6(2),t.hij("@",o.video.Source,""),t.xp6(3),t.Oqu(t.xi3(18,12,null!==(a=null==o.video.Timestamps?null:o.video.Timestamps.ActualStartTime)&&void 0!==a?a:null==o.video.Timestamps?null:o.video.Timestamps.PublishedAt,"yyyy/MM/dd HH:mm:ss")),t.xp6(2),t.Q6J("videoStatus",o.video.Status)}},dependencies:[w.yS,ae,g.uU],styles:[".card.border-danger[_ngcontent-%COMP%]{border:3px solid transparent!important;background-clip:padding-box,border-box!important;background-origin:padding-box,border-box!important;background-image:linear-gradient(to right,#2E333B,#2E333B),linear-gradient(90deg,#F55252,#F77E17)!important}"]}),n})();var xt=h(9915);function yt(n,i){if(1&n&&(t.TgZ(0,"div",6),t._UZ(1,"app-video-card",7),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("video",e)}}function Tt(n,i){if(1&n&&(t.TgZ(0,"section")(1,"div",1)(2,"div",2)(3,"div",3),t._uU(4,"New Archived Videos"),t.qZA()()(),t.TgZ(5,"div",4),t.YNc(6,yt,2,1,"div",5),t.qZA()()),2&n){const e=t.oxw();t.xp6(6),t.Q6J("ngForOf",e.newVideos)}}function St(n,i){if(1&n&&(t.TgZ(0,"div",6),t._UZ(1,"app-video-card",7),t.qZA()),2&n){const e=i.$implicit;t.xp6(1),t.Q6J("video",e)}}function Dt(n,i){if(1&n&&(t.TgZ(0,"section")(1,"div",1)(2,"div",2)(3,"div",3),t._uU(4,"Source Deleted / Edited / Reject Videos"),t.qZA()()(),t.TgZ(5,"div",4),t.YNc(6,St,2,1,"div",5),t.qZA()()),2&n){const e=t.oxw();t.xp6(6),t.Q6J("ngForOf",e.deletedVideos)}}let It=(()=>{class n{constructor(e,o,r,a,s){this.dbService=e,this.metaService=r,this.spinner=a,this.userService=s,this.VideoStatus=C.K,this.newVideos=[],this.deletedVideos=[],this.channels=[],o.showNavigationArrows=!0,o.showNavigationIndicators=!1,o.interval=5e3,o.wrap=!0,o.keyboard=!1,o.pauseOnHover=!0,o.animation=!1}ngOnInit(){var e=this;return(0,_.Z)(function*(){e.spinner.show(void 0,{type:"ball-triangle-path",size:"medium",bdColor:"rgba(0, 0, 0, 0.8)",color:"#fff",fullScreen:!0}),e.metaService.resetToDefault(),e.channels=(yield e.dbService.getAllChannels()).filter(o=>o.Monitoring),yield e.initNewVideos(),yield e.initDeletedVideos(),e.userService.userLogin$.pipe((0,re.q)(1)).subscribe((0,_.Z)(function*(){yield e.initNewVideos(),yield e.initDeletedVideos()})),e.spinner.hide()})()}initNewVideos(){var e=this;return(0,_.Z)(function*(){const o=yield e.dbService.getArchivedVideos(20);e.newVideos=yield e.getVideoPages(o),console.debug("New Videos",e.newVideos)})()}initDeletedVideos(){var e=this;return(0,_.Z)(function*(){const o=yield e.dbService.getSourceDeletedOrEditedVideos(4);e.deletedVideos=yield e.getVideoPages(o),console.debug("Deleted Videos",e.deletedVideos)})()}getVideoPages(e){var o=this;return(0,_.Z)(function*(){e.forEach(s=>{s.Channel=o.channels.find(l=>l.id===s.ChannelId&&l.Source===s.Source)});const r=o.getBootstrapBreakpoint(),a="xs"===r?1:"sm"===r||"md"===r?3:4;return e.filter(s=>!0!==s.Channel?.Hide||o.userService.isUserLoggedIn()).slice(0,a)})()}getBootstrapBreakpoint(){var e=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;return e<768?"xs":e<992?"sm":e<1200?"md":"lg"}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(A.K),t.Y36(T.Lu),t.Y36(E.R),t.Y36(S.t2),t.Y36(V.K))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ng-component"]],features:[t._Bn([T.Lu])],decls:4,vars:2,consts:[[4,"ngIf"],[1,"row"],[1,"col-12"],["translate","",1,"content-header"],[1,"row","row-cols-1","row-cols-md-3","row-cols-lg-4"],["class","col",4,"ngFor","ngForOf"],[1,"col"],[3,"video"]],template:function(e,o){1&e&&(t._UZ(0,"ngx-spinner")(1,"app-logo-header"),t.YNc(2,Tt,7,1,"section",0),t.YNc(3,Dt,7,1,"section",0)),2&e&&(t.xp6(2),t.Q6J("ngIf",o.newVideos&&0!==o.newVideos.length),t.xp6(1),t.Q6J("ngIf",o.deletedVideos&&0!==o.deletedVideos.length))},dependencies:[g.sg,g.O5,y.Pi,le,xt.J,S.Ro],styles:[".dash2-user[_ngcontent-%COMP%]{margin-top:58%}.dash2-user[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{padding:30px}.avatar[_ngcontent-%COMP%]{width:60%;border:2px solid #975aff;padding:.4rem;position:absolute;right:0;left:0;margin:auto;display:inline-block;overflow:hidden;z-index:1;line-height:40px;transition:.3s;vertical-align:middle;font-size:1rem;box-shadow:0 2px 2px #00000024,0 1px 5px #0000001f,0 3px 1px -2px #0003}"]}),n})();var B=h(7545),k=h(4850),kt=h(5226),P=h.n(kt);function Pt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",6),t.NdJ("click",function(){const a=t.CHM(e).$implicit,s=t.oxw();return t.KtG(s.filterStatus=s.VideoStatus[a])}),t._uU(1),t.qZA()}if(2&n){const e=i.$implicit;t.xp6(1),t.Oqu(e)}}function Ht(n,i){if(1&n&&(t.TgZ(0,"div",15),t._UZ(1,"app-video-card",16),t.qZA()),2&n){const e=t.oxw().$implicit;t.xp6(1),t.Q6J("video",e)}}function Mt(n,i){if(1&n&&(t.ynx(0),t.YNc(1,Ht,2,1,"div",14),t.BQk()),2&n){const e=i.$implicit,o=t.oxw();t.xp6(1),t.Q6J("ngIf",(void 0===o.filterStatus||e.Status===o.filterStatus)&&(void 0===o.filterSourceStatus||e.SourceStatus===o.filterSourceStatus)&&(!0!==(null==e.Channel?null:e.Channel.Hide)||o.userService.isUserLoggedIn()))}}function Vt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",17)(1,"div",15)(2,"button",18),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.load())}),t._uU(3," Load more... "),t.qZA()()()}}const Rt=function(n,i){return[n,"Timestamps",!0,!1,i]};let J=(()=>{class n{constructor(e,o,r){this.dbService=e,this.userService=o,this.spinner=r,this.videos=[],this.VideoStatus=C.K,this.filterStatus=void 0,this.filterSourceStatus=void 0,this.VideoStatusKeys=[...new Set(["Archived"].concat(Object.keys(C.K).filter(a=>"number"==typeof C.K[a])))],this.channels=[],this.filterPurchased=!1,this.bookmark=void 0}ngOnInit(){var e=this;return(0,_.Z)(function*(){yield e.spinner.show(void 0,{type:"ball-triangle-path",size:"medium",bdColor:"rgba(0, 0, 0, 0.8)",color:"#fff",fullScreen:!0}),e.channels=yield e.dbService.getAllChannels(),yield e.loadDefault(),e.spinner.hide()})()}loadDefault(e){var o=this;return(0,_.Z)(function*(){o.videos=[],o.bookmark=void 0,e?o.channel=e:e=o.channel,yield o.load(),o.userService.isUserLoggedIn()||(o.videos=o.videos.filter(r=>!0!==r.Channel?.Hide))})()}load(){var e=this;return(0,_.Z)(function*(){let o,r;({data:o,bookmark:r}=e.channel?yield e.dbService.getVideosByChannelId(e.channel.id,50,e.bookmark):yield e.dbService.getVideos(300,e.bookmark)),e.bookmark=r,o.forEach(s=>{e.fillChannel(s),e.videos.push(s)})})()}fillChannel(e){e.Channel=this.channel?this.channel:this.channels.find(o=>o.id===e.ChannelId&&o.Source===e.Source)}videoTimeComparator(e,o){return(e.ActualStartTime??e.PublishedAt)>(o.ActualStartTime??o.PublishedAt)?1:-1}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(A.K),t.Y36(V.K),t.Y36(S.t2))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-video-list"]],inputs:{channel:"channel"},decls:34,vars:14,consts:[[1,"card"],[1,"card-body","d-flex","flex-wrap","align-items-center","justify-content-end","filterCard","p-2"],[1,"flex-grow-1"],["display","dynamic","ngbDropdown","",1,"mr-2"],["id","videoStatus","ngbDropdownToggle","",1,"btn-sm","btn-outline-primary"],["ngbDropdownMenu","","aria-labelledby","videoStatus","role","menu"],[1,"dropdown-item",3,"click"],[1,"dropdown-divider"],["class","dropdown-item",3,"click",4,"ngFor","ngForOf"],["id","videoSourceStatus","ngbDropdownToggle","",1,"btn-sm","btn-outline-primary"],["ngbDropdownMenu","","aria-labelledby","videoSourceStatus","role","menu"],[1,"row","row-cols-1","row-cols-md-3","row-cols-lg-3","row-cols-xl-4"],[4,"ngFor","ngForOf"],["class","row",4,"ngIf"],["class","col",4,"ngIf"],[1,"col"],[3,"video"],[1,"row"],["type","button","translate","",1,"btn","btn-outline-primary","btn-block",3,"click"]],template:function(e,o){1&e&&(t._UZ(0,"ngx-spinner"),t.TgZ(1,"section")(2,"div",0)(3,"div",1),t._UZ(4,"div",2),t.TgZ(5,"div",3)(6,"button",4),t._uU(7),t.qZA(),t.TgZ(8,"div",5)(9,"a",6),t.NdJ("click",function(){return o.filterStatus=void 0}),t._uU(10,"Unset"),t.qZA(),t._UZ(11,"div",7),t.YNc(12,Pt,2,1,"a",8),t.qZA()(),t.TgZ(13,"div",3)(14,"button",9),t._uU(15),t.qZA(),t.TgZ(16,"div",10)(17,"a",6),t.NdJ("click",function(){return o.filterSourceStatus=void 0}),t._uU(18,"Unset"),t.qZA(),t._UZ(19,"div",7),t.TgZ(20,"a",6),t.NdJ("click",function(){return o.filterSourceStatus=o.VideoStatus.Unknown}),t._uU(21,"Unknown"),t.qZA(),t.TgZ(22,"a",6),t.NdJ("click",function(){return o.filterSourceStatus=o.VideoStatus.Exist}),t._uU(23,"Exist"),t.qZA(),t.TgZ(24,"a",6),t.NdJ("click",function(){return o.filterSourceStatus=o.VideoStatus.Edited}),t._uU(25,"Edited"),t.qZA(),t.TgZ(26,"a",6),t.NdJ("click",function(){return o.filterSourceStatus=o.VideoStatus.Reject}),t._uU(27,"Reject"),t.qZA(),t.TgZ(28,"a",6),t.NdJ("click",function(){return o.filterSourceStatus=o.VideoStatus.Deleted}),t._uU(29,"Deleted"),t.qZA()()()()(),t.TgZ(30,"div",11),t.YNc(31,Mt,2,1,"ng-container",12),t.ALo(32,"orderBy"),t.qZA(),t.YNc(33,Vt,4,0,"div",13),t.qZA()),2&e&&(t.xp6(7),t.hij(" ",void 0!==o.filterStatus?o.VideoStatus[o.filterStatus]:"Video Status"," "),t.xp6(5),t.Q6J("ngForOf",o.VideoStatusKeys),t.xp6(3),t.hij(" ",void 0!==o.filterSourceStatus?o.VideoStatus[o.filterSourceStatus]:"Video Source Status"," "),t.xp6(16),t.Q6J("ngForOf",t.G7q(32,5,t.WLB(11,Rt,o.videos,o.videoTimeComparator))),t.xp6(2),t.Q6J("ngIf",o.bookmark))},dependencies:[g.sg,g.O5,T.jt,T.iD,T.Vi,y.Pi,le,S.Ro,j],styles:[".filterCard[_ngcontent-%COMP%] > div[_ngcontent-%COMP%]{padding:.5rem}"]}),n})();var H;!function(n){let i;var o;let e;(o=i=n.ChannelId||(n.ChannelId={})).PlatformType=function r(s,l){switch(l){case"Youtube":return s;case"Twitch":case"Twitcasting":case"FC2":return s.substring(2);default:throw new Error("NotImplementedException")}},o.DatabaseType=function a(s,l){switch(l){case"Youtube":return s;case"Twitch":return"TW"+s;case"Twitcasting":return"TC"+s;case"FC2":return"FC"+s;default:throw new Error("NotImplementedException")}},function(o){o.PlatformType=function r(s,l){switch(l){case"Youtube":return s.substring(1);case"Twitch":case"Twitcasting":case"FC2":return s.substring(2);default:throw new Error("NotImplementedException")}},o.DatabaseType=function a(s,l){switch(l){case"Youtube":return"Y"+s;case"Twitch":return"TW"+s;case"Twitcasting":return"TC"+s;case"FC2":return"FC"+s;default:throw new Error("NotImplementedException")}}}(e=n.VideoId||(n.VideoId={}))}(H||(H={}));var ce=h(3831),de=h(7185),ue=h(529);let pe=(()=>{class n{constructor(e){this.httpClient=e,this.apiUrl=I.E.environment.apiUrl}AddChannel(e){return this.httpClient.post(`${this.apiUrl}/api/Channel`,{Url:e},{responseType:"text"})}EnableChannel$(e){return this.httpClient.post(`${this.apiUrl}/api/Channel/EnableChannel`,{id:e.id,Source:e.Source,Monitoring:e.Monitoring})}HideChannel$(e){return this.httpClient.post(`${this.apiUrl}/api/Channel/HideChannel`,{id:e.id,Source:e.Source,Hide:e.Hide})}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(ue.eN))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})();function At(n,i){if(1&n&&(t.TgZ(0,"div",20),t._UZ(1,"div",21),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("innerHtml",e.channel.Note,t.oJD)}}function Et(n,i){if(1&n&&(t.TgZ(0,"picture"),t._UZ(1,"source",22)(2,"img",23),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("srcset",e.blobstorage_public+"/banner/"+e.bannerAvif,t.LSH),t.xp6(1),t.Q6J("src",e.blobstorage_public+"/banner/"+e.channel.Banner,t.LSH)}}function Bt(n,i){1&n&&t._UZ(0,"div",24)}function Ft(n,i){if(1&n&&(t.TgZ(0,"picture",25),t._UZ(1,"source",22)(2,"img",26),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("srcset",e.blobstorage_public+"/avatar/"+e.avatarAvif,t.LSH),t.xp6(1),t.Q6J("src",e.blobstorage_public+"/avatar/"+e.channel.Avatar,t.LSH)}}function Ot(n,i){if(1&n&&(t.TgZ(0,"a",27),t._UZ(1,"img",28),t.qZA()),2&n){const e=t.oxw(2);t.MGl("ngbTooltip","Go to ",e.channel.Source,""),t.Q6J("href",e.sourceUrl,t.LSH),t.xp6(1),t.Q6J("src",e.sourceIcon,t.LSH)}}function Zt(n,i){1&n&&(t.ynx(0),t._UZ(1,"i",33),t.BQk())}function zt(n,i){1&n&&t._UZ(0,"i",34)}function Ut(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",29)(1,"a",30),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.hideChannel(!r.channel.Hide))}),t.YNc(2,Zt,2,0,"ng-container",8),t.YNc(3,zt,1,0,"ng-template",null,31,t.W1O),t._UZ(5,"label",32),t.qZA()()}if(2&n){const e=t.MAs(4),o=t.oxw(2);t.xp6(2),t.Q6J("ngIf",o.channel.Hide)("ngIfElse",e)}}function Wt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",35)(1,"input",36),t.NdJ("change",function(){t.CHM(e);const r=t.oxw(2);return t.KtG(r.enableChannel(!r.channel.Monitoring))}),t.qZA(),t._UZ(2,"label",37),t.qZA()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("checked",e.channel.Monitoring)}}function Nt(n,i){if(1&n&&(t.TgZ(0,"section",2)(1,"div",3),t.YNc(2,At,2,1,"div",4),t.TgZ(3,"div",5)(4,"div",6)(5,"div",7),t.YNc(6,Et,3,2,"picture",8),t.YNc(7,Bt,1,0,"ng-template",null,9,t.W1O),t.YNc(9,Ft,3,2,"picture",10),t.qZA(),t.TgZ(10,"div",11)(11,"div",12)(12,"div",13)(13,"div",14),t.YNc(14,Ot,2,3,"a",15),t.TgZ(15,"div",16)(16,"h4",17),t._uU(17),t.qZA(),t.TgZ(18,"small"),t._uU(19),t.qZA()()(),t.YNc(20,Ut,6,2,"div",18),t.YNc(21,Wt,3,1,"div",19),t.qZA()()()()()()()),2&n){const e=t.MAs(8),o=t.oxw();t.xp6(2),t.Q6J("ngIf",o.channel.Note),t.xp6(4),t.Q6J("ngIf",o.channel.Banner)("ngIfElse",e),t.xp6(3),t.Q6J("ngIf",o.channel.Avatar),t.xp6(5),t.Q6J("ngIf",o.channel.Source&&o.sourceUrl&&o.sourceIcon),t.xp6(3),t.Oqu(o.channel.ChannelName),t.xp6(2),t.hij("@",o.channel.Source,""),t.xp6(1),t.Q6J("ngIf",o.userService.User&&o.userService.User.IsAdmin),t.xp6(1),t.Q6J("ngIf",o.userService.User&&o.userService.User.IsAdmin)}}function Lt(n,i){if(1&n&&t._UZ(0,"app-video-list",38),2&n){const e=t.oxw();t.Q6J("channel",e.channel)}}let Yt=(()=>{class n{constructor(e,o,r,a,s,l,c,u,p){this.route=e,this.router=o,this.ngDynamicBreadcrumbService=r,this.dbService=a,this.userService=s,this.metaService=l,this.toastr=c,this.channelService=u,this.translateService=p}ngOnInit(){this.blobstorage_public=I.E.environment.blobstorage_public,this.route.paramMap.pipe((0,B.w)(e=>this.dbService.getChannelById(e.get("channelId"))),(0,k.U)(e=>{if(!e||e.Hide&&!this.userService.isUserLoggedIn())return this.toastr.error("Channel not found"),void this.router.navigate(["/channels"]);switch(this.ngDynamicBreadcrumbService.updateBreadcrumbLabels({ChannelName:e.ChannelName}),this.channel=e,this.channel.Banner&&(this.bannerAvif=this.channel.Banner.substring(0,this.channel.Banner.lastIndexOf("."))+".avif"),this.channel.Avatar&&(this.avatarAvif=this.channel.Avatar.substring(0,this.channel.Avatar.lastIndexOf("."))+".avif"),this.videoListComponent&&this.videoListComponent.loadDefault(e),this.metaService.setByChannel(e),e.Source){case"Youtube":this.sourceIcon="/assets/img/icons/youtube.svg",this.sourceUrl="https://www.youtube.com/channel/"+H.ChannelId.PlatformType(e.id,e.Source);break;case"Twitcasting":this.sourceIcon="/assets/img/icons/twitcasting.svg",this.sourceUrl="https://twitcasting.tv/"+H.ChannelId.PlatformType(e.id,e.Source);break;case"Twitch":this.sourceIcon="/assets/img/icons/twitch.svg",this.sourceUrl="https://www.twitch.tv/"+H.ChannelId.PlatformType(e.id,e.Source);break;case"FC2":this.sourceIcon="/assets/img/icons/fc2.svg",this.sourceUrl="https://live.fc2.com/"+H.ChannelId.PlatformType(e.id,e.Source)}return e})).subscribe()}enableChannel(e){var o=this;this.channel.Monitoring=e,this.channelService.EnableChannel$(this.channel).subscribe((0,_.Z)(function*(){var r=P().mixin({showCancelButton:!1,customClass:{confirmButton:"btn btn-primary",cancelButton:"btn btn-danger ml-1"},buttonsStyling:!1,backdrop:!0,title:o.translateService.instant("Success!"),icon:"success",confirmButtonText:o.translateService.instant('<i class="ft-heart-on"></i> Great!')});e?yield r.fire({html:o.translateService.instant("You have <b>Enabled</b> channel monitoring for <b>{{channelName}}</b>.",{channelName:o.channel.ChannelName})}):yield r.fire({html:o.translateService.instant("You have <b>Disabled</b> channel monitoring for <b>{{channelName}}</b>.",{channelName:o.channel.ChannelName})})}))}hideChannel(e){var o=this;this.channel.Hide=e,this.channelService.HideChannel$(this.channel).subscribe((0,_.Z)(function*(){var r=P().mixin({showCancelButton:!1,customClass:{confirmButton:"btn btn-primary",cancelButton:"btn btn-danger ml-1"},buttonsStyling:!1,backdrop:!0,title:o.translateService.instant("Success!"),icon:"success",confirmButtonText:o.translateService.instant('<i class="ft-heart-on"></i> Great!')});e?yield r.fire({html:o.translateService.instant("You have <b>Hide</b> the channel <b>{{channelName}}</b>.",{channelName:o.channel.ChannelName})}):yield r.fire({html:o.translateService.instant("You have <b>Unhide</b> the channel <b>{{channelName}}</b>.",{channelName:o.channel.ChannelName})})}))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(w.gz),t.Y36(w.F0),t.Y36(ce.Kz),t.Y36(A.K),t.Y36(V.K),t.Y36(E.R),t.Y36(de._W),t.Y36(pe),t.Y36(y.sK))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ng-component"]],viewQuery:function(e,o){if(1&e&&t.Gf(J,5),2&e){let r;t.iGM(r=t.CRH())&&(o.videoListComponent=r.first)}},decls:2,vars:2,consts:[["class","page-user-profile",4,"ngIf"],[3,"channel",4,"ngIf"],[1,"page-user-profile"],[1,"row","row-cols-12","row-cols-md-12"],["class","col-12 mt-2",4,"ngIf"],[1,"col-12"],[1,"card"],[1,"user-profile-images"],[4,"ngIf","ngIfElse"],["hideBanner",""],["class","user-profile-image rounded",4,"ngIf"],[1,"card-content"],[1,"card-body"],[1,"user-profile-buttons","d-flex","justify-content-md-between","justify-content-center","flex-wrap"],[1,"d-flex","flex-grow-1"],["id","sourceIcon","role","button","class","mr-2","placement","bottom","target","_blank","referrerpolicy","no-referrer",3,"href","ngbTooltip",4,"ngIf"],[1,"d-flex","justify-content-center","flex-column"],[1,"mb-0"],["class","custom-control d-inline-flex mt-2 mt-sm-0 align-self-center","placement","bottom","ngbTooltip","Hide this channel from the public",4,"ngIf"],["class","custom-control custom-switch d-inline-flex mt-2 mt-sm-0 align-self-center","placement","bottom","ngbTooltip","Monitor this channel",4,"ngIf"],[1,"col-12","mt-2"],["role","alert",1,"alert","text-center","alert-warning","mb-0",3,"innerHtml"],["type","image/avif",3,"srcset"],[1,"img-fluid","rounded-top","user-timeline-image",3,"src"],[1,"user-timeline-image","hideBanner"],[1,"user-profile-image","rounded"],["height","140","width","140",3,"src"],["id","sourceIcon","role","button","placement","bottom","target","_blank","referrerpolicy","no-referrer",1,"mr-2",3,"href","ngbTooltip"],["alt","Source Icon",3,"src"],["placement","bottom","ngbTooltip","Hide this channel from the public",1,"custom-control","d-inline-flex","mt-2","mt-sm-0","align-self-center"],[3,"click"],["elseHide",""],["for","hideSwitch",1,"ml-0","mx-2","py-0","font-large-1"],["id","hideSwitch",1,"ft-eye-off"],["id","hideSwitch",1,"ft-eye"],["placement","bottom","ngbTooltip","Monitor this channel",1,"custom-control","custom-switch","d-inline-flex","mt-2","mt-sm-0","align-self-center"],["type","checkbox","id","enableSwitch",1,"custom-control-input",3,"checked","change"],["for","enableSwitch",1,"custom-control-label","ml-0","mx-2","py-0","font-large-1"],[3,"channel"]],template:function(e,o){1&e&&(t.YNc(0,Nt,22,9,"section",0),t.YNc(1,Lt,1,1,"app-video-list",1)),2&e&&(t.Q6J("ngIf",o.channel),t.xp6(1),t.Q6J("ngIf",o.channel))},dependencies:[g.O5,T._L,J],styles:[".user-timeline-image[_ngcontent-%COMP%]{width:100%;aspect-ratio:2120/350}.user-timeline-image.hideBanner[_ngcontent-%COMP%]{min-height:90px;height:90px}@media (max-width: 767.98px){.user-profile-buttons[_ngcontent-%COMP%]{padding-top:3rem;text-align:center}}#heart[_ngcontent-%COMP%]{width:3rem;height:3rem;animation:1.5s ease 0s infinite beat}@keyframes beat{0%,50%,to{transform:scale(1)}30%,80%{transform:scale(.92,.95)}}a#sourceIcon[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:3rem;height:3rem}h4[_ngcontent-%COMP%]{line-height:1}.user-profile-image[_ngcontent-%COMP%]{aspect-ratio:1/1;overflow:hidden;display:flex;justify-content:center;align-items:center;width:140px;height:140px}.user-profile-image[_ngcontent-%COMP%] > img[_ngcontent-%COMP%]{-o-object-fit:cover;object-fit:cover;width:100%;height:100%}#hideSwitch[_ngcontent-%COMP%]{font-size:xx-large}"]}),n})();function W(n){function i(e){if(Object(e)!==e)return Promise.reject(new TypeError(e+" is not an object."));var o=e.done;return Promise.resolve(e.value).then(function(r){return{value:r,done:o}})}return(W=function(o){this.s=o,this.n=o.next}).prototype={s:null,n:null,next:function(){return i(this.n.apply(this.s,arguments))},return:function(o){var r=this.s.return;return void 0===r?Promise.resolve({value:o,done:!0}):i(r.apply(this.s,arguments))},throw:function(o){var r=this.s.return;return void 0===r?Promise.reject(o):i(r.apply(this.s,arguments))}},new W(n)}var he=h(943),N=h(7221),X=h(1086),L=h(1327);function Gt(n,i){if(1&n&&(t.TgZ(0,"picture",7),t._UZ(1,"source",8)(2,"img",9),t.qZA()),2&n){const e=t.oxw();t.xp6(1),t.Q6J("srcset",e.blobstorage_public+"/avatar/"+e.avatarAvif,t.LSH),t.xp6(1),t.Q6J("src",e.blobstorage_public+"/avatar/"+e.channel.Avatar,t.LSH)}}function Qt(n,i){if(1&n&&(t.TgZ(0,"span",10),t._uU(1),t.qZA()),2&n){const e=t.oxw();t.Q6J("ngClass","ribbon-"+e.ribbonColor),t.xp6(1),t.hij("",e.ribbon," ")}}const qt=function(n){return["/channels",n]};let Jt=(()=>{class n{constructor(){}ngOnInit(){this.blobstorage_public=I.E.environment.blobstorage_public,this.channel.Avatar&&(this.avatarAvif=this.channel.Avatar.substring(0,this.channel.Avatar.lastIndexOf("."))+".avif")}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-channel-card"]],inputs:{channel:"channel",ribbon:"ribbon",ribbonColor:"ribbonColor"},decls:9,vars:7,consts:[[1,"channel-card",3,"routerLink"],["class","avatar",4,"ngIf"],[1,"card","text-center"],[1,"card-body"],[1,"mb-0"],[1,"grey","mb-0"],["class","ribbon",3,"ngClass",4,"ngIf"],[1,"avatar"],["type","image/avif",3,"srcset"],["alt","Channel Avatar",3,"src"],[1,"ribbon",3,"ngClass"]],template:function(e,o){1&e&&(t.TgZ(0,"a",0),t.YNc(1,Gt,3,2,"picture",1),t.TgZ(2,"div",2)(3,"div",3)(4,"h4",4),t._uU(5),t.qZA(),t.TgZ(6,"p",5),t._uU(7),t.qZA()(),t.YNc(8,Qt,2,2,"span",6),t.qZA()()),2&e&&(t.Q6J("routerLink",t.VKq(5,qt,o.channel.id)),t.xp6(1),t.Q6J("ngIf",o.channel.Avatar),t.xp6(4),t.Oqu(o.channel.ChannelName),t.xp6(2),t.hij("@",o.channel.Source,""),t.xp6(1),t.Q6J("ngIf",o.ribbon))},dependencies:[w.yS,g.mk,g.O5],styles:['.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%]{margin-top:58%}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .card-body[_ngcontent-%COMP%]{padding:30px}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon[_ngcontent-%COMP%]{color:#fff;display:block;width:calc(100% + 20px);height:50px;line-height:50px;text-align:center;margin-left:-10px;margin-right:-10px;background:#B583FF;position:relative;top:-15px}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon[_ngcontent-%COMP%]:before, .channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon[_ngcontent-%COMP%]:after{content:"";position:absolute}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon[_ngcontent-%COMP%]:before{height:0;width:0;bottom:-10px;left:0;border-top:10px solid #3B1C93;border-left:10px solid transparent}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon[_ngcontent-%COMP%]:after{height:0;width:0;right:0;bottom:-10px;border-top:10px solid #3B1C93;border-right:10px solid transparent}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-primary[_ngcontent-%COMP%]{background:#B583FF}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-primary[_ngcontent-%COMP%]:before, .channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-primary[_ngcontent-%COMP%]:after{border-top:10px solid #3B1C93}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-secondary[_ngcontent-%COMP%]{background:#8F9DB8}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-secondary[_ngcontent-%COMP%]:before, .channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-secondary[_ngcontent-%COMP%]:after{border-top:10px solid #1E294F}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-success[_ngcontent-%COMP%]{background:#6CD975}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-success[_ngcontent-%COMP%]:before, .channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-success[_ngcontent-%COMP%]:after{border-top:10px solid #146F3E}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-danger[_ngcontent-%COMP%]{background:#F9877C}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-danger[_ngcontent-%COMP%]:before, .channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-danger[_ngcontent-%COMP%]:after{border-top:10px solid #8E1A38}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-warning[_ngcontent-%COMP%]{background:#FAA750}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-warning[_ngcontent-%COMP%]:before, .channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-warning[_ngcontent-%COMP%]:after{border-top:10px solid #8F2F07}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-info[_ngcontent-%COMP%]{background:#60AFF0}.channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-info[_ngcontent-%COMP%]:before, .channel-card[_ngcontent-%COMP%] .card[_ngcontent-%COMP%] .ribbon-info[_ngcontent-%COMP%]:after{border-top:10px solid #0E3885}.channel-card[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%]{width:60%;border:3px solid transparent;background-clip:padding-box,border-box;background-origin:padding-box,border-box;background-image:linear-gradient(to right,#2E333B,#2E333B),linear-gradient(90deg,#975AFF,#2F8BE6);padding:.4rem;position:absolute;right:0;left:0;margin:auto;z-index:1;line-height:40px;transition:.3s;vertical-align:middle;font-size:1rem;box-shadow:0 2px 2px #00000024,0 1px 5px #0000001f,0 3px 1px -2px #0003;aspect-ratio:1/1;overflow:hidden;display:flex;justify-content:center;align-items:center}.channel-card[_ngcontent-%COMP%] .avatar[_ngcontent-%COMP%] > img[_ngcontent-%COMP%]{-o-object-fit:cover;object-fit:cover;width:100%;height:100%}.channel-card[_ngcontent-%COMP%] > .card[_ngcontent-%COMP%]{border:3px solid transparent!important}.channel-card[_ngcontent-%COMP%] > .border-danger[_ngcontent-%COMP%]{background-clip:padding-box,border-box!important;background-origin:padding-box,border-box!important;background-image:linear-gradient(to right,#2E333B,#2E333B),linear-gradient(90deg,#F55252,#F77E17)!important}.nowarp[_ngcontent-%COMP%]{white-space:nowrap}']}),n})();function Xt(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"button",7),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.promptAddChannel())}),t._uU(1," Add Channel "),t.qZA()}}function Kt(n,i){if(1&n&&(t.TgZ(0,"div",8),t._UZ(1,"app-channel-card",9),t.qZA()),2&n){const e=i.$implicit,o=t.oxw();t.ekj("d-none",!e.Monitoring||e.Hide&&!o.userService.isUserLoggedIn()),t.xp6(1),t.Q6J("channel",e)}}function jt(n,i){if(1&n&&(t.TgZ(0,"div",10),t._UZ(1,"app-channel-card",9),t.qZA()),2&n){const e=i.$implicit,o=t.oxw();t.ekj("d-none",e.Monitoring||e.Hide&&!o.userService.isUserLoggedIn()),t.xp6(1),t.Q6J("channel",e)}}let en=(()=>{class n{constructor(e,o,r,a,s,l,c,u,p){this.route=e,this.router=o,this.userService=r,this.dbService=a,this.metaService=s,this.authService=l,this.translateService=c,this.spinner=u,this.channelService=p,this.channels=[]}ngOnInit(){var e=this;return(0,_.Z)(function*(){yield e.spinner.show(void 0,{type:"ball-triangle-path",size:"medium",bdColor:"rgba(0, 0, 0, 0.8)",color:"#fff",fullScreen:!0}),e.metaService.resetToDefault();let o=yield e.dbService.getAllChannelsFromDB(),r=o.filter(d=>d.LatestVideoId).map(d=>({id:d.LatestVideoId,partitionKey:d.id})),a=yield e.dbService.getVideosByIdList(r);var c,s=!1,l=!1;try{for(var p,u=function $t(n){var i,e,o,r=2;for(typeof Symbol<"u"&&(e=Symbol.asyncIterator,o=Symbol.iterator);r--;){if(e&&null!=(i=n[e]))return i.call(n);if(o&&null!=(i=n[o]))return new W(i.call(n));e="@@asyncIterator",o="@@iterator"}throw new TypeError("Object is not async iterable")}(o);s=!(p=yield u.next()).done;s=!1){const d=p.value;if(d.LatestVideoId){var v=a.find(f=>f.id===d.LatestVideoId);d.LatestVideo=v,d.LatestArchivedTime=new Date(d.LatestVideo?.ArchivedTime)?.getTime()??new Date(d.LatestVideo?.Timestamps.PublishedAt)?.getTime()??0}else d.LatestVideo=void 0,d.LatestArchivedTime=0}}catch(d){l=!0,c=d}finally{try{s&&null!=u.return&&(yield u.return())}finally{if(l)throw c}}e.channels=o.sort((d,f)=>f.LatestArchivedTime-d.LatestArchivedTime),e.spinner.hide(),e.route.queryParamMap.pipe((0,he.g)(2e3)).subscribe(d=>{"true"===d.get("promptAddChannel")&&e.userService.isUserLoggedIn()&&e.promptAddChannel()})})()}promptAddChannel(){var e=this;return(0,_.Z)(function*(){if(!e.authService.redirectToLoginPageIfNotLoggedIn(void 0,"?promptAddChannel=true"))return;const o=P().mixin({showCancelButton:!0,progressSteps:["?",'<i class="ft-edit"></i>','<i class="ft-heart-on"></i>'],customClass:{confirmButton:"btn btn-primary",cancelButton:"btn btn-danger ml-1"},cancelButtonText:e.translateService.instant("Cancel"),buttonsStyling:!1,backdrop:!0}),r=yield o.fire({currentProgressStep:0,title:e.translateService.instant("Please choose the channel platform"),input:"radio",inputOptions:{Youtube:"Youtube",Twitcasting:"Twitcasting",Twitch:"Twitch",FC2:"FC2"},inputValidator:l=>!l&&"You need to select something!"});if(!r.isConfirmed)return;let a="";switch(r.value){case"Youtube":a="https://www.youtube.com/@....";break;case"Twitcasting":a="https://twitcasting.tv/....";break;case"Twitch":a="https://www.twitch.tv/....";break;case"FC2":a="https://live.fc2.com/...."}const s=yield o.fire({currentProgressStep:1,title:e.translateService.instant("Please input the channel url"),input:"url",inputPlaceholder:a,confirmButtonText:e.translateService.instant("Submit"),showLoaderOnConfirm:!0,preConfirm:l=>e.AddChannel$(l).toPromise()});!s.isConfirmed||(s.value?s.value.toString().length>3&&(yield o.fire({currentProgressStep:2,title:e.translateService.instant("Success!"),html:e.translateService.instant("Channel has been added! It'll take a while for the videos to be processed."),icon:"success",confirmButtonText:e.translateService.instant('<i class="ft-heart-on"></i> Great!'),showCancelButton:!1})):yield o.fire({currentProgressStep:2,progressSteps:["?",'<i class="ft-edit"></i>','<i class="ft-x"></i>'],title:e.translateService.instant("Error!"),html:e.translateService.instant("Something went wrong. Please refresh the page and try again."),icon:"error",showConfirmButton:!1,showCancelButton:!1,showCloseButton:!0}),window.location.reload())})()}AddChannel$(e){return this.channelService.AddChannel(e).pipe((0,k.U)(o=>"Failed"!==o),(0,N.K)(o=>(console.error(o),(0,X.of)(!1))))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(w.gz),t.Y36(w.F0),t.Y36(V.K),t.Y36(A.K),t.Y36(E.R),t.Y36(L.e),t.Y36(y.sK),t.Y36(S.t2),t.Y36(pe))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ng-component"]],decls:10,vars:3,consts:[[1,"row"],[1,"col-12"],["translate","",1,"content-header","mr-1"],["type","button","class","btn btn-primary gradient-ibiza-sunset shadow-z-1-hover float-right","translate","",3,"click",4,"ngIf"],[1,"row","row-cols-1","row-cols-md-3","row-cols-lg-3","row-cols-xl-4"],["class","col p-2",3,"d-none",4,"ngFor","ngForOf"],["class","col p-2 grayscale",3,"d-none",4,"ngFor","ngForOf"],["type","button","translate","",1,"btn","btn-primary","gradient-ibiza-sunset","shadow-z-1-hover","float-right",3,"click"],[1,"col","p-2"],[3,"channel"],[1,"col","p-2","grayscale"]],template:function(e,o){1&e&&(t._UZ(0,"ngx-spinner"),t.TgZ(1,"section")(2,"div",0)(3,"div",1)(4,"span",2),t._uU(5,"Channels"),t.qZA(),t.YNc(6,Xt,2,0,"button",3),t.qZA()(),t.TgZ(7,"div",4),t.YNc(8,Kt,2,3,"div",5),t.YNc(9,jt,2,3,"div",6),t.qZA()()),2&e&&(t.xp6(6),t.Q6J("ngIf",o.userService.User&&o.userService.User.IsAdmin),t.xp6(2),t.Q6J("ngForOf",o.channels),t.xp6(1),t.Q6J("ngForOf",o.channels))},dependencies:[g.sg,g.O5,y.Pi,Jt,S.Ro],styles:[".grayscale[_ngcontent-%COMP%]{filter:grayscale(70%)}"]}),n})();var tn=h(2994);let me={};const ge=new WeakMap,fe={metric:[{from:0,to:1e3,unit:"B",long:"bytes"},{from:1e3,to:1e6,unit:"kB",long:"kilobytes"},{from:1e6,to:1e9,unit:"MB",long:"megabytes"},{from:1e9,to:1e12,unit:"GB",long:"gigabytes"},{from:1e12,to:1e15,unit:"TB",long:"terabytes"},{from:1e15,to:1e18,unit:"PB",long:"petabytes"},{from:1e18,to:1e21,unit:"EB",long:"exabytes"},{from:1e21,to:1e24,unit:"ZB",long:"zettabytes"},{from:1e24,to:1e27,unit:"YB",long:"yottabytes"}],metric_octet:[{from:0,to:1e3,unit:"o",long:"octets"},{from:1e3,to:1e6,unit:"ko",long:"kilooctets"},{from:1e6,to:1e9,unit:"Mo",long:"megaoctets"},{from:1e9,to:1e12,unit:"Go",long:"gigaoctets"},{from:1e12,to:1e15,unit:"To",long:"teraoctets"},{from:1e15,to:1e18,unit:"Po",long:"petaoctets"},{from:1e18,to:1e21,unit:"Eo",long:"exaoctets"},{from:1e21,to:1e24,unit:"Zo",long:"zettaoctets"},{from:1e24,to:1e27,unit:"Yo",long:"yottaoctets"}],iec:[{from:0,to:Math.pow(1024,1),unit:"B",long:"bytes"},{from:Math.pow(1024,1),to:Math.pow(1024,2),unit:"KiB",long:"kibibytes"},{from:Math.pow(1024,2),to:Math.pow(1024,3),unit:"MiB",long:"mebibytes"},{from:Math.pow(1024,3),to:Math.pow(1024,4),unit:"GiB",long:"gibibytes"},{from:Math.pow(1024,4),to:Math.pow(1024,5),unit:"TiB",long:"tebibytes"},{from:Math.pow(1024,5),to:Math.pow(1024,6),unit:"PiB",long:"pebibytes"},{from:Math.pow(1024,6),to:Math.pow(1024,7),unit:"EiB",long:"exbibytes"},{from:Math.pow(1024,7),to:Math.pow(1024,8),unit:"ZiB",long:"zebibytes"},{from:Math.pow(1024,8),to:Math.pow(1024,9),unit:"YiB",long:"yobibytes"}],iec_octet:[{from:0,to:Math.pow(1024,1),unit:"o",long:"octets"},{from:Math.pow(1024,1),to:Math.pow(1024,2),unit:"Kio",long:"kibioctets"},{from:Math.pow(1024,2),to:Math.pow(1024,3),unit:"Mio",long:"mebioctets"},{from:Math.pow(1024,3),to:Math.pow(1024,4),unit:"Gio",long:"gibioctets"},{from:Math.pow(1024,4),to:Math.pow(1024,5),unit:"Tio",long:"tebioctets"},{from:Math.pow(1024,5),to:Math.pow(1024,6),unit:"Pio",long:"pebioctets"},{from:Math.pow(1024,6),to:Math.pow(1024,7),unit:"Eio",long:"exbioctets"},{from:Math.pow(1024,7),to:Math.pow(1024,8),unit:"Zio",long:"zebioctets"},{from:Math.pow(1024,8),to:Math.pow(1024,9),unit:"Yio",long:"yobioctets"}]};class nn{constructor(i,e){e=Object.assign({units:"metric",precision:1,locale:void 0},me,e),ge.set(this,e),Object.assign(fe,e.customUnits);const o=i<0?"-":"";i=Math.abs(i);const r=fe[e.units];if(!r)throw new Error(`Invalid units specified: ${e.units}`);{const a=r.find(s=>i>=s.from&&i<s.to);if(a){const s=new Intl.NumberFormat(e.locale,{style:"decimal",minimumFractionDigits:e.precision,maximumFractionDigits:e.precision}),l=0===a.from?o+i:o+s.format(i/a.from);this.value=l,this.unit=a.unit,this.long=a.long}else this.value=o+i,this.unit="",this.long=""}}toString(){const i=ge.get(this);return i.toStringFn?i.toStringFn.bind(this)():`${this.value} ${this.unit}`}}function be(n,i){return new nn(n,i)}be.defaultOptions=function(n){me=n};const ve=be;let _e=(()=>{class n{constructor(e){this.httpClient=e,this.apiUrl=I.E.environment.apiUrl}AddVideo$(e){return this.httpClient.post(`${this.apiUrl}/api/Video`,{Url:e})}RemoveVideo$(e,o){return this.httpClient.delete(`${this.apiUrl}/api/Video`,{params:{videoId:e,channelId:o}})}UpdateVideo$(e){return this.httpClient.patch(`${this.apiUrl}/api/Video`,e)}GetToken$(e,o){return this.httpClient.get(`${this.apiUrl}/api/Video/Token`,{params:{videoId:e,channelId:o},responseType:"text"})}}return n.\u0275fac=function(e){return new(e||n)(t.LFG(ue.eN))},n.\u0275prov=t.Yz7({token:n,factory:n.\u0275fac,providedIn:"root"}),n})(),on=(()=>{class n{constructor(e){this.el=e}ngAfterViewInit(){setTimeout(()=>{this.matchHeights(this.el.nativeElement,this.matchHeight)},300)}matchHeights(e,o){if(!e)return;const r=e.getElementsByClassName(o);if(!r)return;Array.from(r).forEach(l=>{l.style.height="initial"});const s=Array.from(r).map(l=>l.getBoundingClientRect().height).reduce((l,c)=>c>l?c:l,0);Array.from(r).forEach(l=>l.style.height=`${s}px`)}onResize(){this.matchHeights(this.el.nativeElement,this.matchHeight)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(t.SBq))},n.\u0275dir=t.lG2({type:n,selectors:[["","matchHeight",""]],hostBindings:function(e,o){1&e&&t.NdJ("resize",function(){return o.onResize()},!1,t.Jf7)},inputs:{matchHeight:"matchHeight"}}),n})();var rn=h(6831),F=h(7625),we=h(3121);let an=(()=>{class n{constructor(){this.startTime=0,this.timeChange=new t.vpe,this.destroyed$=new rn.t(1)}ngOnInit(){}onPlayerReady(e){this.api=e;const o=this.api.getDefaultMedia();o.subscriptions.loadedMetadata.pipe((0,F.R)(this.destroyed$)).subscribe(()=>{o.currentTime=this.startTime}),o.subscriptions.playing.pipe((0,F.R)(this.destroyed$)).subscribe(()=>{this.playing=!0}),o.subscriptions.pause.pipe((0,F.R)(this.destroyed$)).subscribe(()=>{this.playing=!1}),o.subscriptions.canPlay.pipe((0,F.R)(this.destroyed$)).subscribe(()=>{this.playing&&this.api.play()}),o.subscriptions.timeUpdate.pipe((0,F.R)(this.destroyed$)).subscribe(()=>{this.timeChange.emit(o.currentTime)})}ngOnDestroy(){this.destroyed$.next(!0),this.destroyed$.complete()}}return n.\u0275fac=function(e){return new(e||n)},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-player"]],inputs:{source:"source",poster:"poster",startTime:"startTime"},outputs:{timeChange:"timeChange"},decls:3,vars:4,consts:[[3,"onPlayerReady"],["id","singleVideo","preload","auto","controls","",3,"vgMedia","src","poster","volume"],["media",""]],template:function(e,o){if(1&e&&(t.TgZ(0,"vg-player",0),t.NdJ("onPlayerReady",function(a){return o.onPlayerReady(a)}),t._UZ(1,"video",1,2),t.qZA()),2&e){const r=t.MAs(2);t.xp6(1),t.Q6J("vgMedia",r)("src",o.source,t.LSH)("poster",o.poster,t.LSH)("volume",.7)}},dependencies:[we.xo,we.xJ],styles:["video[_ngcontent-%COMP%]{max-height:60vh}"]}),n})();function sn(n,i){if(1&n&&(t.TgZ(0,"div",13),t._uU(1),t.qZA()),2&n){const e=t.oxw(2);t.ekj("alert-secondary",e.video.Status==e.VideoStatus.Pending||e.video.Status==e.VideoStatus.Expired||e.video.Status==e.VideoStatus.Missing||e.video.Status==e.VideoStatus.Skipped||e.video.Status==e.VideoStatus.Edited)("alert-danger",e.video.Status==e.VideoStatus.Reject||e.video.Status==e.VideoStatus.Error||e.video.Status==e.VideoStatus.Deleted),t.xp6(1),t.hij(" ",e.video.Note," ")}}function ln(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"figure",14)(1,"app-player",15),t.NdJ("timeChange",function(r){t.CHM(e);const a=t.oxw(2);return t.KtG(a.OnTimeUpdated(r))}),t.qZA()()}if(2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("source",e.video.DownloadUrl+e.token)("poster",e.thumbnail)("startTime",e.startTime)}}const cn=function(n){return{state:n}};function dn(n,i){if(1&n&&(t.TgZ(0,"figure",16)(1,"picture"),t._UZ(2,"source",17)(3,"img",18),t.qZA(),t.TgZ(4,"figcaption"),t._UZ(5,"h2"),t.TgZ(6,"p",19),t._uU(7," This video is videoState "),t.qZA()()()),2&n){const e=t.oxw(2);t.xp6(2),t.Q6J("srcset",e.thumbnailAvif,t.LSH),t.xp6(1),t.Q6J("src",e.thumbnail,t.LSH),t.xp6(3),t.Q6J("translateParams",t.VKq(3,cn,e.VideoStatus[e.video.Status]))}}const un=function(n){return["/channels",n]};function pn(n,i){if(1&n&&(t.TgZ(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23)(4,"div",24)(5,"picture",25),t._UZ(6,"source",17)(7,"img",26),t.qZA()(),t.TgZ(8,"div",27)(9,"a",28)(10,"h4",29),t._uU(11),t.qZA(),t.TgZ(12,"p",30),t._uU(13),t._UZ(14,"br"),t._uU(15),t.qZA()()()()()()()),2&n){const e=t.oxw(2);t.xp6(6),t.Q6J("srcset",e.blobstorage_public+"/avatar/"+e.avatarAvif,t.LSH),t.xp6(1),t.Q6J("src",e.blobstorage_public+"/avatar/"+e.channel.Avatar,t.LSH),t.xp6(2),t.Q6J("routerLink",t.VKq(6,un,e.video.ChannelId)),t.xp6(2),t.Oqu(e.channel.ChannelName),t.xp6(2),t.Oqu(e.channel.id),t.xp6(2),t.hij("@",e.channel.Source,"")}}function hn(n,i){if(1&n&&(t.TgZ(0,"div",20)(1,"div",21)(2,"div",22)(3,"div",23)(4,"div",24),t._UZ(5,"i",31),t.qZA(),t.TgZ(6,"div",27)(7,"h4",32),t._uU(8,"Unknown Channel"),t.qZA(),t.TgZ(9,"p",30),t._uU(10),t._UZ(11,"br"),t._uU(12),t.qZA()()()()()()),2&n){const e=t.oxw(2);t.xp6(10),t.Oqu(e.video.ChannelId),t.xp6(2),t.hij("@",e.video.Source,"")}}function mn(n,i){if(1&n&&(t.TgZ(0,"div",34)(1,"div",21)(2,"div",35),t._UZ(3,"i",36),t.TgZ(4,"a",37),t._uU(5,' Right click and "Save As..." '),t.qZA()()()()),2&n){const e=t.oxw(3);t.xp6(4),t.Q6J("href",e.video.DownloadUrl+e.token,t.LSH)}}function gn(n,i){if(1&n&&(t.TgZ(0,"div",7),t.YNc(1,mn,6,1,"div",33),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(null==e.video?null:e.video.Status)===e.VideoStatus.Archived||(null==e.video?null:e.video.Status)===e.VideoStatus.PermanentArchived)}}function fn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",34)(1,"div",21)(2,"div",35),t._UZ(3,"i",36),t.TgZ(4,"a",38),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(3);return t.KtG(r.authService.redirectToLoginPageIfNotLoggedIn())}),t._uU(5," Login to download! "),t.qZA()()()()}}function bn(n,i){if(1&n&&(t.TgZ(0,"div",7),t.YNc(1,fn,6,0,"div",33),t.qZA()),2&n){const e=t.oxw(2);t.xp6(1),t.Q6J("ngIf",(null==e.video?null:e.video.Status)===e.VideoStatus.Archived||(null==e.video?null:e.video.Status)===e.VideoStatus.PermanentArchived)}}function vn(n,i){if(1&n&&(t.ynx(0),t.TgZ(1,"a",50),t._UZ(2,"app-status-badge",46),t.qZA(),t.BQk()),2&n){const e=t.oxw(3);t.xp6(1),t.Q6J("href",e.video.SourceUrl,t.LSH),t.xp6(1),t.Q6J("videoStatus",e.video.SourceStatus)}}function _n(n,i){if(1&n&&t._UZ(0,"app-status-badge",46),2&n){const e=t.oxw(3);t.Q6J("videoStatus",e.video.SourceStatus)}}function wn(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"th",45),t._uU(2,"Size"),t.qZA(),t.TgZ(3,"td")(4,"span",51),t._uU(5),t.qZA()()()),2&n){const e=t.oxw(3);t.xp6(4),t.Q6J("ngbTooltip",e.video.Size+" bytes"),t.xp6(1),t.hij(" ",e.video.Size_fixed," ")}}function Cn(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"th",45),t._uU(2,"Scheduled StartTime"),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.ALo(5,"date"),t.qZA()()),2&n){const e=t.oxw(3);t.xp6(4),t.hij(" ",t.xi3(5,1,e.video.Timestamps.ScheduledStartTime,"yyyy/MM/dd HH:mm:ss")," ")}}function xn(n,i){if(1&n&&(t.TgZ(0,"tr")(1,"th",45),t._uU(2,"Actual StartTime"),t.qZA(),t.TgZ(3,"td"),t._uU(4),t.ALo(5,"date"),t.qZA()()),2&n){const e=t.oxw(3);t.xp6(4),t.hij(" ",t.xi3(5,1,e.video.Timestamps.ActualStartTime,"yyyy/MM/dd HH:mm:ss")," ")}}function yn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"a",59),t.NdJ("click",function(){const a=t.CHM(e).$implicit,s=t.oxw(4);return t.KtG(s.updateVideoStatus(s.VideoStatus[a]))}),t._uU(1),t.qZA()}if(2&n){const e=i.$implicit;t.xp6(1),t.hij(" ",e,"")}}function Tn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"button",61),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(4);return t.KtG(r.removeVideo())}),t._uU(1," Remove Video "),t.qZA()}}function Sn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",40)(1,"div",21)(2,"div",41)(3,"h4",32),t._uU(4,"Manage"),t.qZA(),t.TgZ(5,"div",52)(6,"button",53)(7,"span",54),t._uU(8,"Archived Status"),t.qZA(),t._uU(9),t.qZA(),t.TgZ(10,"div",55),t.YNc(11,yn,2,1,"a",56),t.qZA()(),t.TgZ(12,"div",52)(13,"button",57)(14,"span",54),t._uU(15,"Source Status"),t.qZA(),t._uU(16),t.qZA(),t.TgZ(17,"div",58)(18,"a",59),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(3);return t.KtG(r.updateVideoSourceStatus(r.VideoStatus.Unknown))}),t._uU(19,"Unknown"),t.qZA(),t.TgZ(20,"a",59),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(3);return t.KtG(r.updateVideoSourceStatus(r.VideoStatus.Exist))}),t._uU(21,"Exist"),t.qZA(),t.TgZ(22,"a",59),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(3);return t.KtG(r.updateVideoSourceStatus(r.VideoStatus.Edited))}),t._uU(23,"Edited"),t.qZA(),t.TgZ(24,"a",59),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(3);return t.KtG(r.updateVideoSourceStatus(r.VideoStatus.Reject))}),t._uU(25,"Reject"),t.qZA(),t.TgZ(26,"a",59),t.NdJ("click",function(){t.CHM(e);const r=t.oxw(3);return t.KtG(r.updateVideoSourceStatus(r.VideoStatus.Deleted))}),t._uU(27,"Deleted"),t.qZA()()(),t.YNc(28,Tn,2,0,"button",60),t.qZA()()()}if(2&n){const e=t.oxw(3);t.xp6(9),t.hij(" ",void 0!==e.video.Status?e.VideoStatus[e.video.Status]:"Unknown"," "),t.xp6(2),t.Q6J("ngForOf",e.VideoStatusKeys),t.xp6(5),t.hij(" ",void 0!==e.video.Status?e.VideoStatus[e.video.SourceStatus]:"Unknown"," "),t.xp6(12),t.Q6J("ngIf",(null==e.video?null:e.video.Status)===e.VideoStatus.Archived||(null==e.video?null:e.video.Status)===e.VideoStatus.PermanentArchived)}}function Dn(n,i){if(1&n&&(t.TgZ(0,"div",39)(1,"div",40)(2,"div",21)(3,"div",41)(4,"h4",29),t._uU(5),t.qZA(),t.TgZ(6,"div",42)(7,"table",43)(8,"tbody")(9,"tr")(10,"th",44),t._uU(11,"ID"),t.qZA(),t.TgZ(12,"td"),t._uU(13),t.qZA()(),t.TgZ(14,"tr")(15,"th",45),t._uU(16,"Archived Status"),t.qZA(),t.TgZ(17,"td"),t._UZ(18,"app-status-badge",46),t.qZA()(),t.TgZ(19,"tr")(20,"th",45),t._uU(21,"Source Status"),t.qZA(),t.TgZ(22,"td"),t.YNc(23,vn,3,2,"ng-container",47),t.YNc(24,_n,1,1,"ng-template",null,48,t.W1O),t.qZA()(),t.TgZ(26,"tr")(27,"th",45),t._uU(28,"Is live stream"),t.qZA(),t.TgZ(29,"td"),t._uU(30),t.qZA()(),t.YNc(31,wn,6,2,"tr",0),t.TgZ(32,"tr")(33,"th",45),t._uU(34,"Published At"),t.qZA(),t.TgZ(35,"td"),t._uU(36),t.ALo(37,"date"),t.qZA()(),t.YNc(38,Cn,6,4,"tr",0),t.YNc(39,xn,6,4,"tr",0),t.qZA()()()()()(),t.YNc(40,Sn,29,4,"div",49),t.qZA()),2&n){const e=t.MAs(25),o=t.oxw(2);let r;t.xp6(5),t.Oqu(o.video.Title_fixed),t.xp6(8),t.Oqu("Youtube"===o.video.Source?o.video.id.substring(1):o.video.id),t.xp6(5),t.Q6J("videoStatus",o.video.Status),t.xp6(5),t.Q6J("ngIf",o.video.SourceStatus!==o.VideoStatus.Deleted&&o.video.SourceUrl)("ngIfElse",e),t.xp6(7),t.hij(" ",null!==(r=o.video.IsLiveStream)&&void 0!==r?r:"Unknown"," "),t.xp6(1),t.Q6J("ngIf",o.video.Size),t.xp6(5),t.hij(" ",t.xi3(37,11,o.video.Timestamps.PublishedAt,"yyyy/MM/dd HH:mm:ss")," "),t.xp6(2),t.Q6J("ngIf",o.video.Timestamps.ScheduledStartTime),t.xp6(1),t.Q6J("ngIf",o.video.Timestamps.ActualStartTime),t.xp6(1),t.Q6J("ngIf",o.user&&o.user.IsAdmin&&o.video)}}function In(n,i){if(1&n&&(t.TgZ(0,"section")(1,"div",1),t.YNc(2,sn,2,5,"div",2),t.TgZ(3,"div",3),t.YNc(4,ln,2,3,"figure",4),t.YNc(5,dn,8,5,"ng-template",null,5,t.W1O),t.TgZ(7,"div",6)(8,"div",7),t.YNc(9,pn,16,8,"div",8),t.YNc(10,hn,13,2,"ng-template",null,9,t.W1O),t.qZA(),t.YNc(12,gn,2,1,"div",10),t.YNc(13,bn,2,1,"ng-template",null,11,t.W1O),t.qZA()(),t.YNc(15,Dn,41,14,"div",12),t.qZA()()),2&n){const e=t.MAs(6),o=t.MAs(11),r=t.MAs(14),a=t.oxw();t.xp6(2),t.Q6J("ngIf",a.video&&(null==a.video?null:a.video.Note)&&a.video.Status>=a.VideoStatus.Expired),t.xp6(2),t.Q6J("ngIf",a.canPlay&&a.video&&a.video.Status>=40&&a.video.Status<50&&!!a.video.Filename&&!!a.token)("ngIfElse",e),t.xp6(5),t.Q6J("ngIf",a.channel)("ngIfElse",o),t.xp6(3),t.Q6J("ngIf",a.canPlay)("ngIfElse",r),t.xp6(3),t.Q6J("ngIf",a.video)}}let kn=(()=>{class n{constructor(e,o,r,a,s,l,c,u,p,v){var d=this;this.route=e,this.router=o,this.ngDynamicBreadcrumbService=r,this.dbService=a,this.videoService=s,this.userService=l,this.metaService=c,this.translateService=u,this.spinner=p,this.authService=v,this.VideoStatus=C.K,this.VideoStatusKeys=[...new Set(Object.keys(C.K).filter(f=>"number"==typeof C.K[f]))],this.byteSize=ve,this.canPlay=!1,this.time=0,this.startTime=0,this.processVideo=f=>f.pipe((0,k.U)(b=>{var x,M;this.token=void 0,this.video=b,this.video.Title_fixed=b.Title?this.video.Title?.replace(/\d{4}-\d{2}-\d{2}\s\d{2}:\d{2}$/,""):"(No Title)",this.video.Size_fixed=ve(this.video.Size??0,{units:"iec",precision:3}).toString(),this.video.DownloadUrl=`${this.blobstorage}/videos/${b.Filename}`,(x=this.video).Status??(x.Status=C.K.Unknown),(M=this.video).SourceStatus??(M.SourceStatus=C.K.Unknown);const Y=H.VideoId.PlatformType(this.video.id,this.video.Source),Gn=H.ChannelId.PlatformType(this.video.ChannelId,this.video.Source);switch(this.video.Source){case"Youtube":this.video.SourceUrl=`https://www.youtube.com/watch?v=${Y}`;break;case"Twitcasting":this.video.SourceUrl=`https://twitcasting.tv/${Gn}/movie/${Y}`;break;case"Twitch":b.IsLiveStream||(this.video.SourceUrl=`https://www.twitch.tv/videos/${Y}`);break;case"FC2":b.IsLiveStream||(this.video.SourceUrl=`https://video.fc2.com/content/${Y}`)}this.metaService.setByVideo(b)}),(0,B.w)(()=>this.dbService.getChannelById(this.video.ChannelId,this.video.Source)),(0,k.U)(b=>{this.channel=b,this.channel&&this.channel.Avatar&&(this.avatarAvif=this.channel.Avatar.substring(0,this.channel.Avatar.lastIndexOf("."))+".avif"),this.ngDynamicBreadcrumbService.updateBreadcrumbLabels({ChannelName:this.channel?.ChannelName??this.video.ChannelId,VideoId:this.video.id})}),(0,B.w)(()=>this.authService.loginAlreadySigninUser$()),(0,B.w)(b=>this.video?.Status!==C.K.Archived&&this.video?.Status!==C.K.PermanentArchived||!b?(0,X.of)(!1):this.videoService.GetToken$(this.video.id,this.video.ChannelId).pipe((0,k.U)(x=>(x&&(this.canPlay=!0),this.token=x,this.canPlay)),(0,N.K)(function(){var x=(0,_.Z)(function*(M){if(403!==M.status)throw M;return window.location.hostname.startsWith("demo.")?(yield P().fire({showCancelButton:!1,customClass:{confirmButton:"btn btn-primary"},buttonsStyling:!1,backdrop:!0,title:d.translateService.instant("This is a demo site and we do not offer the real recordings."),html:d.translateService.instant("<p>In a normal deployment, you can view the recordings here. However, we are unable to display them on this demo site.</p><p>Instead, we will provide you with samples. \u{1f609}</p>"),icon:"warning",confirmButtonText:d.translateService.instant("Got it!")}),d.canPlay=!0,d.token="?",d.video.DownloadUrl="https://raw.githubusercontent.com/ShatteredDisk/rickroll/master/rickroll.mp4",!0):(yield P().fire({showCancelButton:!1,customClass:{confirmButton:"btn btn-primary"},buttonsStyling:!1,backdrop:!0,title:d.translateService.instant("You are not permitted to view this video."),html:d.translateService.instant("<p>You are not permitted to view this video. If you believe this is a mistake, please contact the administrator.</p>"),icon:"warning",confirmButtonText:d.translateService.instant("Got it!")}),!1)});return function(M){return x.apply(this,arguments)}}()))),(0,N.K)(function(){var b=(0,_.Z)(function*(x){return d.canPlay=!1,console.error(x),yield P().fire({buttonsStyling:!1,backdrop:!0,title:d.translateService.instant("Error!"),html:d.translateService.instant("Something went wrong. Please refresh the page and try again."),icon:"error",showConfirmButton:!1,showCancelButton:!1,showCloseButton:!0}),!1});return function(x){return b.apply(this,arguments)}}()))}get user(){return this.userService.User}ngOnInit(){var e=this;this.blobstorage=I.E.environment.blobstorage,this.blobstorage_public=I.E.environment.blobstorage_public,this.route.paramMap.pipe((0,tn.b)(()=>{this.spinner.show(void 0,{type:"ball-triangle-path",size:"medium",bdColor:"rgba(0, 0, 0, 0.8)",color:"#fff",fullScreen:!0})}),(0,B.w)(o=>this.dbService.getVideoById(o.get("id"),o.get("channelId"))),this.processVideo).subscribe(()=>{this.reloadTimer=setInterval((0,_.Z)(function*(){e.router.navigate([],{relativeTo:e.route,queryParams:{t:e.time},queryParamsHandling:"merge"}),e.videoService.GetToken$(e.video.id,e.video.ChannelId).subscribe(o=>{e.startTime=e.time,e.token=o,console.log("Update Token",o)})}),432e5),this.thumbnail=this.video.Thumbnail?`${this.blobstorage_public}/thumbnails/${this.video.Thumbnail}`:this.channel?.Banner?`${this.blobstorage_public}/banner/${this.channel.Banner}`:"/assets/img/preview.png",this.thumbnailAvif=this.thumbnail.substring(0,this.thumbnail.lastIndexOf("."))+".avif",this.spinner.hide()},()=>this.spinner.hide())}OnTimeUpdated(e){this.time=e}removeVideo(){var e=this;return(0,_.Z)(function*(){const o=P().mixin({showCancelButton:!0,progressSteps:['<i class="fa ft-edit-2"></i>',"!",'<i class="ft-check"></i>'],customClass:{confirmButton:"btn btn-primary",cancelButton:"btn btn-danger ml-1"},buttonsStyling:!1,backdrop:!0,cancelButtonText:e.translateService.instant("Cancel")});(yield o.fire({currentProgressStep:1,title:e.translateService.instant("Notice!"),html:e.translateService.instant("remove-video-notice"),icon:"warning",confirmButtonText:e.translateService.instant("Got it!"),showLoaderOnConfirm:!0,preConfirm:()=>e.videoService.RemoveVideo$(e.video.id,e.video.ChannelId).pipe((0,k.U)(()=>(e.video.Status=C.K.Deleted,e.video)),e.processVideo,(0,k.U)(a=>!a))})).isConfirmed?yield o.fire({currentProgressStep:2,title:e.translateService.instant("Success!"),html:e.translateService.instant("You have removed this video."),icon:"success",confirmButtonText:e.translateService.instant('<i class="ft-heart-on"></i> Great!'),showCancelButton:!1}):console.warn("User cancelled.")})()}updateVideoStatus(e){var o=this.video;o.Status=e,this.videoService.UpdateVideo$(o).pipe(this.processVideo).subscribe()}updateVideoSourceStatus(e){var o=this.video;o.SourceStatus=e,this.videoService.UpdateVideo$(o).pipe(this.processVideo).subscribe()}ngOnDestroy(){clearInterval(this.reloadTimer)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(w.gz),t.Y36(w.F0),t.Y36(ce.Kz),t.Y36(A.K),t.Y36(_e),t.Y36(V.K),t.Y36(E.R),t.Y36(y.sK),t.Y36(S.t2),t.Y36(L.e))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ng-component"]],decls:2,vars:1,consts:[[4,"ngIf"],[1,"row"],["class","col-12 alert text-center","role","alert",3,"alert-secondary","alert-danger",4,"ngIf"],[1,"col-lg-8","col-12"],["class","effect-sadie",4,"ngIf","ngIfElse"],["elseTemplate",""],["matchHeight","sameHeight",1,"row"],[1,"col-md-6","col-12"],["class","card text-center channel-card",4,"ngIf","ngIfElse"],["channelTemplate",""],["class","col-md-6 col-12",4,"ngIf","ngIfElse"],["elseDownload",""],["class","col-lg-4 col-12",4,"ngIf"],["role","alert",1,"col-12","alert","text-center"],[1,"effect-sadie"],[3,"source","poster","startTime","timeChange"],[1,"effect-sadie","rounded"],["type","image/avif",3,"srcset"],["alt","Video thumbnail",1,"w-100",3,"src"],["translate","",3,"translateParams"],[1,"card","text-center","channel-card"],[1,"card-content"],[1,"card-body","sameHeight"],[1,"row","d-flex"],[1,"col-4","align-self-center","mb-2","mb-lg-0","pr-0"],[1,"user-profile-image","mx-auto"],["height","100px",1,"rounded-circle",3,"src"],[1,"col-8","align-self-center"],[3,"routerLink"],[1,"card-title","mb-3"],[1,"card-text"],[1,"user-profile-image","ft-user","mx-auto"],["translate","",1,"card-title","mb-3"],["class","card text-center",4,"ngIf"],[1,"card","text-center"],[1,"card-body","sameHeight","d-flex","flex-column","justify-content-around"],[1,"ft-download",2,"font-size","xxx-large"],["target","_blank","translate","",1,"btn","gradient-king-yna","mx-3","mt-2",3,"href"],["target","_blank","translate","","href","/pages/login",1,"btn","gradient-king-yna","mx-3","mt-2",3,"click"],[1,"col-lg-4","col-12"],[1,"card"],[1,"card-body"],[1,"table-responsive"],[1,"table","m-0"],["scope","row"],["scope","row","translate",""],[3,"videoStatus"],[4,"ngIf","ngIfElse"],["elseTemplate2",""],["class","card",4,"ngIf"],["target","_blank","rel","noopener noreferrer","ngbTooltip","Go to video source!","placement","bottom",3,"href"],["placement","bottom",3,"ngbTooltip"],["display","dynamic","placement","top-end","ngbDropdown","",1,"mb-2"],["id","videoStatus","ngbDropdownToggle","",1,"btn","btn-block","btn-primary"],["translate",""],["ngbDropdownMenu","","aria-labelledby","videoStatus","role","menu",1,"dropdownList"],["class","dropdown-item",3,"click",4,"ngFor","ngForOf"],["id","videoSourceStatus","ngbDropdownToggle","",1,"btn","btn-block","btn-primary"],["ngbDropdownMenu","","aria-labelledby","videoSourceStatus","role","menu",1,"dropdownList"],[1,"dropdown-item",3,"click"],["type","button","class","btn btn-danger btn-block","translate","",3,"click",4,"ngIf"],["type","button","translate","",1,"btn","btn-danger","btn-block",3,"click"]],template:function(e,o){1&e&&(t._UZ(0,"ngx-spinner"),t.YNc(1,In,16,8,"section",0)),2&e&&(t.xp6(1),t.Q6J("ngIf",o.video))},dependencies:[g.sg,g.O5,w.yS,on,T.jt,T.iD,T.Vi,T._L,y.Pi,an,ae,S.Ro,g.uU],styles:["section[_ngcontent-%COMP%]{position:relative;list-style:none}section[_ngcontent-%COMP%] figure[_ngcontent-%COMP%]{position:relative;overflow:hidden;min-width:auto;text-align:center;margin:15px 0}section[_ngcontent-%COMP%] figure[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{position:relative;display:block;min-height:100%;max-width:100%}section[_ngcontent-%COMP%] figure[_ngcontent-%COMP%] figcaption[_ngcontent-%COMP%]{padding:2em;color:#fff;text-transform:uppercase;font-size:1.25em;-webkit-backface-visibility:hidden;backface-visibility:hidden;position:absolute;top:0;left:0;width:100%;height:100%}section[_ngcontent-%COMP%] figure[_ngcontent-%COMP%] figcaption[_ngcontent-%COMP%]:before{pointer-events:none}section[_ngcontent-%COMP%] figure[_ngcontent-%COMP%] figcaption[_ngcontent-%COMP%]:after{pointer-events:none}section[_ngcontent-%COMP%] figure[_ngcontent-%COMP%] figcaption[_ngcontent-%COMP%] > a[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:1000;text-indent:200%;white-space:nowrap;font-size:0;opacity:0}section[_ngcontent-%COMP%] figure[_ngcontent-%COMP%] h2[_ngcontent-%COMP%]{word-spacing:-.15em;font-weight:300;margin:0;color:#fff;text-shadow:#000 .15em .15em .35em}section[_ngcontent-%COMP%] figure[_ngcontent-%COMP%] h2[_ngcontent-%COMP%] span[_ngcontent-%COMP%]{font-weight:800}section[_ngcontent-%COMP%] figure[_ngcontent-%COMP%] p[_ngcontent-%COMP%]{margin:0;letter-spacing:1px;font-size:68.5%}.table[_ngcontent-%COMP%] th[_ngcontent-%COMP%], .table[_ngcontent-%COMP%] td[_ngcontent-%COMP%]{padding:1rem 1.5rem}.channel-card[_ngcontent-%COMP%] .card-text[_ngcontent-%COMP%]{font-size:small}.dropdownList[_ngcontent-%COMP%]{max-height:60vh;overflow-y:auto}#star[_ngcontent-%COMP%]{width:4rem;height:4rem;animation:jello-horizontal 1.3s infinite both}@keyframes jello-horizontal{0%{transform:scaleZ(1)}30%{transform:scale3d(1.25,.75,1)}40%{transform:scale3d(.75,1.25,1)}50%{transform:scale3d(1.15,.85,1)}65%{transform:scale3d(.95,1.05,1)}75%{transform:scale3d(1.05,.95,1)}to{transform:scaleZ(1)}}.user-profile-image[_ngcontent-%COMP%]{aspect-ratio:1/1;overflow:hidden;display:flex;justify-content:center;align-items:center;width:100px;height:100px}.user-profile-image[_ngcontent-%COMP%] > img[_ngcontent-%COMP%]{-o-object-fit:cover;object-fit:cover;width:100%;height:100%}.user-profile-image.ft-user[_ngcontent-%COMP%]{font-size:xxx-large}"]}),n})();function Pn(n,i){if(1&n&&t._UZ(0,"img",30),2&n){const e=t.oxw(2);t.Q6J("src",e.user.Picture,t.LSH)}}function Hn(n,i){1&n&&(t.TgZ(0,"div",31),t._UZ(1,"i",32),t._uU(2," This is required "),t.qZA())}function Mn(n,i){1&n&&(t.TgZ(0,"small",18),t._uU(1,"You can not change your email once submitted."),t.qZA())}function Vn(n,i){1&n&&(t.TgZ(0,"small",33),t._uU(1,"Please contact the administrator if you need to update your email address."),t.qZA())}function Rn(n,i){1&n&&(t.TgZ(0,"div",31),t._UZ(1,"i",32),t._uU(2," The maximum is 100 characters. "),t.qZA())}const Ce=function(n,i){return{"is-invalid":n,"is-valid":i}};function An(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"div",1)(1,"div",2)(2,"div",3)(3,"div",4)(4,"div")(5,"div",5),t.YNc(6,Pn,1,1,"img",6),t.TgZ(7,"div",7)(8,"p",8)(9,"small",9),t._uU(10,"We grabbed your avatar from "),t.TgZ(11,"a",10),t._uU(12,"Gravatar"),t.qZA(),t._uU(13," using your email address."),t.qZA()()()(),t._UZ(14,"hr",11),t.TgZ(15,"form",12),t.NdJ("ngSubmit",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.onGeneralFormSubmit())}),t.TgZ(16,"div",13)(17,"div",14)(18,"label",15),t._uU(19,"UID"),t.qZA(),t.TgZ(20,"div",16),t._UZ(21,"input",17),t.qZA(),t.TgZ(22,"small",18),t._uU(23,"Please provide your UID to the administrator when you need help."),t.qZA()(),t.TgZ(24,"div",14)(25,"label",19),t._uU(26,"Display Name"),t.qZA(),t.TgZ(27,"div",16),t._UZ(28,"input",20),t.YNc(29,Hn,3,0,"div",21),t.qZA()(),t.TgZ(30,"div",14)(31,"label",22),t._uU(32,"E-mail"),t.qZA(),t.TgZ(33,"div",16),t._UZ(34,"input",23),t.qZA(),t.YNc(35,Mn,2,0,"small",24),t.YNc(36,Vn,2,0,"small",25),t.qZA(),t.TgZ(37,"div",14)(38,"label",26),t._uU(39,"Note"),t.qZA(),t.TgZ(40,"div",16),t._UZ(41,"textarea",27),t.YNc(42,Rn,3,0,"div",21),t.qZA()(),t.TgZ(43,"div",28)(44,"button",29),t._uU(45," Save Changes "),t.qZA()()()()()()()()()}if(2&n){const e=t.oxw();t.xp6(6),t.Q6J("ngIf",e.user.Picture),t.xp6(9),t.Q6J("formGroup",e.generalForm),t.xp6(13),t.Q6J("ngClass",t.WLB(9,Ce,e.generalFormSubmitted&&e.gf.username.invalid,e.generalFormSubmitted&&!e.gf.username.invalid)),t.xp6(1),t.Q6J("ngIf",e.generalFormSubmitted&&(e.gf.username.invalid||(null==e.gf.username.errors?null:e.gf.username.errors.required))),t.xp6(5),t.Q6J("readonly",e.lockEmail)("ngClass",t.WLB(12,Ce,e.generalFormSubmitted&&e.gf.email.invalid,e.generalFormSubmitted&&!e.gf.email.invalid)),t.xp6(1),t.Q6J("ngIf",!e.lockEmail),t.xp6(1),t.Q6J("ngIf",e.lockEmail),t.xp6(6),t.Q6J("ngIf",e.generalFormSubmitted&&(e.gf.note.invalid||(null==e.gf.note.errors?null:e.gf.note.errors.maxlength)))}}let En=(()=>{class n{constructor(e,o,r){this.userService=e,this.toastr=o,this.authService=r,this.generalFormSubmitted=!1,this.lockEmail=!1,this.generalForm=new m.nJ({uid:new m.p4(this.userService.User.id),username:new m.p4(this.userService.User.UserName,[m.kI.required]),note:new m.p4(this.userService.User.Note,[m.kI.maxLength(100)]),email:new m.p4(this.userService.User.Email,[m.kI.email])})}ngOnInit(){this.lockEmail=this.ValidateEmail(this.userService.User.Email),this.userService.userLogin$.pipe((0,re.q)(1)).subscribe(e=>{e||this.authService.redirectToLoginPageIfNotLoggedIn()})}get user(){return this.userService.User}get gf(){return this.generalForm.controls}onGeneralFormSubmit(){if(this.generalFormSubmitted=!0,this.generalForm.valid){const e=this.userService.User;return e.UserName=this.gf.username.value,e.Note=this.gf.note.value,e.Email=this.gf.email.value,void this.userService.updateUser(e).subscribe(o=>{this.lockEmail=this.ValidateEmail(e.Email),this.toastr.success("Saved!","Success")})}}ValidateEmail(e){return/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/.test(e)}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(V.K),t.Y36(de._W),t.Y36(L.e))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-general"]],decls:1,vars:1,consts:[["class","card",4,"ngIf"],[1,"card"],[1,"card-content"],[1,"card-body"],[1,"tab-content"],[1,"media"],["alt","profile-img","class","rounded mr-3","height","64","width","64",3,"src",4,"ngIf"],[1,"media-body"],[1,"text-muted","mb-0","mt-1","mt-sm-0"],["translate",""],["href","https://gravatar.com/","target","_blank","rel","noopener noreferrer"],[1,"mt-1","mt-sm-2"],[3,"formGroup","ngSubmit"],[1,"row"],[1,"col-12","form-group"],["for","uid"],[1,"controls"],["type","text","formControlName","uid","readonly","readonly",1,"form-control"],["translate","",1,"text-muted","text-bold-700"],["for","username","translate",""],["type","text","formControlName","username","placeholder","Valued Customer","required","",1,"form-control",3,"ngClass"],["class","help-block mt-1 text-danger",4,"ngIf"],["for","email"],["type","text","formControlName","email","placeholder","E-mail",1,"form-control",3,"readonly","ngClass"],["class","text-muted text-bold-700","translate","",4,"ngIf"],["class","text-muted","translate","",4,"ngIf"],["for","note","translate",""],["formControlName","note","placeholder","Tell us something about you...","rows","3",1,"form-control"],[1,"col-12","d-flex","flex-sm-row","flex-column","justify-content-end"],["type","submit","translate","",1,"btn","btn-primary","mr-sm-2","mb-1"],["alt","profile-img","height","64","width","64",1,"rounded","mr-3",3,"src"],[1,"help-block","mt-1","text-danger"],[1,"ft-alert-circle","align-middle"],["translate","",1,"text-muted"]],template:function(e,o){1&e&&t.YNc(0,An,46,15,"div",0),2&e&&t.Q6J("ngIf",o.user)},dependencies:[g.mk,g.O5,y.Pi,m._Y,m.Fj,m.JJ,m.JL,m.Q7,m.sg,m.u]}),n})();const O=function(n){return{active:n}};function Bn(n,i){if(1&n&&t._UZ(0,"app-general",14),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,O,"general"===e.activeTab))}}function Fn(n,i){if(1&n&&t._UZ(0,"app-support-token",15),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,O,"support-token"===e.activeTab))}}function On(n,i){if(1&n&&t._UZ(0,"app-download-token",16),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,O,"download-token"===e.activeTab))}}function Zn(n,i){if(1&n&&t._UZ(0,"app-referral-program",17),2&n){const e=t.oxw();t.Q6J("ngClass",t.VKq(1,O,"referral-program"===e.activeTab))}}const zn=function(){return["/account-settings"]};let xe=(()=>{class n{constructor(e,o,r){this.route=e,this.router=o,this.metaService=r,this.activeTab="general",this.alertVisible=!0,this.socialForm=new m.nJ({twitter:new m.p4(""),facebook:new m.p4(""),googlePlus:new m.p4(""),linkedin:new m.p4(""),instagram:new m.p4(""),quora:new m.p4("")})}ngOnInit(){this.route.paramMap.subscribe(e=>this.setActiveTab(e.get("tab")??"general")),this.metaService.resetToDefault()}setActiveTab(e){this.activeTab=e}onSocialFormSubmit(){}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(w.gz),t.Y36(w.F0),t.Y36(E.R))},n.\u0275cmp=t.Xpm({type:n,selectors:[["app-account-settings"]],decls:17,vars:9,consts:[[1,"row"],[1,"col-12"],["translate","",1,"content-header"],[1,"col-md-3","mt-3"],["id","myTab","role","tablist",1,"nav","flex-column","nav-pills"],[1,"nav-item"],["id","general-tab","data-toggle","tab","role","tab","aria-controls","general","aria-selected","true",1,"nav-link",3,"routerLink","ngClass","click"],[1,"ft-settings","mr-1","align-middle"],["translate","",1,"align-middle"],[1,"col-md-9"],["class","tab-pane","id","general","role","tabpanel","aria-labelledby","general-tab",3,"ngClass",4,"ngIf"],["class","tab-pane","id","support-token","role","tabpanel","aria-labelledby","support-token-tab",3,"ngClass",4,"ngIf"],["class","tab-pane","id","download-token","role","tabpanel","aria-labelledby","download-token-tab",3,"ngClass",4,"ngIf"],["class","tab-pane","id","referral-program","role","tabpanel","aria-labelledby","referral-program-tab",3,"ngClass",4,"ngIf"],["id","general","role","tabpanel","aria-labelledby","general-tab",1,"tab-pane",3,"ngClass"],["id","support-token","role","tabpanel","aria-labelledby","support-token-tab",1,"tab-pane",3,"ngClass"],["id","download-token","role","tabpanel","aria-labelledby","download-token-tab",1,"tab-pane",3,"ngClass"],["id","referral-program","role","tabpanel","aria-labelledby","referral-program-tab",1,"tab-pane",3,"ngClass"]],template:function(e,o){1&e&&(t.TgZ(0,"div",0)(1,"div",1)(2,"div",2),t._uU(3,"Account Settings"),t.qZA()()(),t.TgZ(4,"div",0)(5,"div",3)(6,"ul",4)(7,"li",5)(8,"a",6),t.NdJ("click",function(){return o.setActiveTab("general")}),t._UZ(9,"i",7),t.TgZ(10,"span",8),t._uU(11,"General"),t.qZA()()()()(),t.TgZ(12,"div",9),t.YNc(13,Bn,1,3,"app-general",10),t.YNc(14,Fn,1,3,"app-support-token",11),t.YNc(15,On,1,3,"app-download-token",12),t.YNc(16,Zn,1,3,"app-referral-program",13),t.qZA()()),2&e&&(t.xp6(8),t.Q6J("routerLink",t.DdM(6,zn))("ngClass",t.VKq(7,O,"general"===o.activeTab)),t.xp6(5),t.Q6J("ngIf","general"===o.activeTab),t.xp6(1),t.Q6J("ngIf","support-token"===o.activeTab),t.xp6(1),t.Q6J("ngIf","download-token"===o.activeTab),t.xp6(1),t.Q6J("ngIf","referral-program"===o.activeTab))},dependencies:[g.mk,g.O5,w.yS,y.Pi,En],styles:[".alert-light-warning{background-color:#feefd0!important;color:#f77e17!important;border-color:#feefd0}.media{align-items:center}\n",".ng-dropdown-panel .ng-dropdown-panel-items .ng-option img{margin-right:.7rem}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option img+b{vertical-align:middle}.ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-marked,.ng-dropdown-panel .ng-dropdown-panel-items .ng-option-selected{background-color:#975aff!important;color:#fff!important}.ng-select .ng-select-container{background-color:transparent!important;border-color:#e0e0e0;border-radius:.35rem;color:#342e49}.ng-select .ng-dropdown-panel{border-color:#e0e0e0;box-shadow:none;margin:0}.ng-select.ng-select-opened>.ng-select-container{border-color:#975aff!important}.ng-select.ng-select-focused:not(.ng-select-opened)>.ng-select-container{border-color:#975aff;box-shadow:none}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value{background-color:#975aff;color:#fff;border-radius:.35rem}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon{border:1px solid #7441DB;border-right:0!important;border-top-left-radius:.35rem;border-bottom-left-radius:.35rem;padding:1px 0 1px 5px}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-icon:hover{background-color:inherit}.ng-select.ng-select-multiple .ng-select-container .ng-value-container .ng-value .ng-value-label{border:1px solid #7441DB;border-left:0!important;border-top-right-radius:.35rem;border-bottom-right-radius:.35rem}html body.layout-dark:not(.layout-transparent) .ng-select .ng-select-container{border-color:#474748;color:#b2b1b5}html body.layout-dark:not(.layout-transparent) .ng-select .ng-select-container .ng-input>input::-moz-placeholder{color:#b2b1b5}html body.layout-dark:not(.layout-transparent) .ng-select .ng-select-container .ng-input>input,html body.layout-dark:not(.layout-transparent) .ng-select .ng-select-container .ng-input>input::placeholder{color:#b2b1b5}html body.layout-dark.layout-transparent .ng-select .ng-select-container{border-color:#eee3;color:#d6d5d8}html body.layout-dark.layout-transparent .ng-select .ng-select-container .ng-input>input::-moz-placeholder{color:#d6d5d8}html body.layout-dark.layout-transparent .ng-select .ng-select-container .ng-input>input,html body.layout-dark.layout-transparent .ng-select .ng-select-container .ng-input>input::placeholder{color:#d6d5d8}html body.layout-dark .ng-dropdown-panel{border-color:#474748}html body.layout-dark .ng-dropdown-panel .ng-dropdown-panel-items .ng-option{background-color:#2e333b;color:#b2b1b5}html body.layout-dark .ng-dropdown-panel .ng-dropdown-panel-items .ng-option.ng-option-disabled{color:#626164}html body.layout-dark .ng-dropdown-panel .ng-optgroup.ng-option-disabled{background-color:#2e333b;color:#626164}html body.layout-dark .ng-dropdown-panel .ng-dropdown-header,html body.layout-dark .ng-dropdown-panel .ng-dropdown-footer{background-color:#22272e;color:#626164;border-color:#474748}\n"],encapsulation:2}),n})();var Un=h(2174),ye=h(5233);function Wn(n,i){if(1&n){const e=t.EpF();t.TgZ(0,"button",4),t.NdJ("click",function(){t.CHM(e);const r=t.oxw();return t.KtG(r.promptAddVideo())}),t._uU(1," Add Video "),t.qZA()}}const Nn=[{path:"",component:It,data:{title:"Home",breadcrumb:[{label:"Home",url:""}]}},{path:"videos",component:(()=>{class n{constructor(e,o,r,a,s,l){this.route=e,this.router=o,this.userService=r,this.authService=a,this.translateService=s,this.videoService=l}ngOnInit(){this.route.queryParamMap.pipe((0,he.g)(2e3)).subscribe(e=>{"true"===e.get("promptAddVideo")&&this.userService.isUserLoggedIn()&&this.promptAddVideo()})}promptAddVideo(){var e=this;return(0,_.Z)(function*(){if(!e.authService.redirectToLoginPageIfNotLoggedIn(void 0,"?promptAddVideo=true"))return;const o=P().mixin({showCancelButton:!0,progressSteps:["?",'<i class="ft-edit"></i>','<i class="ft-heart-on"></i>'],customClass:{confirmButton:"btn btn-primary",cancelButton:"btn btn-danger ml-1"},cancelButtonText:e.translateService.instant("Cancel"),buttonsStyling:!1,backdrop:!0}),r=yield o.fire({currentProgressStep:0,title:e.translateService.instant("Please choose the video platform"),input:"radio",inputOptions:{Youtube:"Youtube",Twitcasting:"Twitcasting",Twitch:"Twitch",FC2:"FC2"},inputValidator:l=>!l&&"You need to select something!"});if(!r.isConfirmed)return;let a="";switch(r.value){case"Youtube":a="https://www.youtube.com/watch?v=....";break;case"Twitcasting":a="https://twitcasting.tv/..../movie/....";break;case"Twitch":a="https://www.twitch.tv/videos/....";break;case"FC2":a="https://video.fc2.com/content/20...."}const s=yield o.fire({currentProgressStep:1,title:e.translateService.instant("Please input the video url"),input:"url",inputPlaceholder:a,confirmButtonText:e.translateService.instant("Submit"),showLoaderOnConfirm:!0,preConfirm:l=>e.AddVideo$(l).toPromise()});!s.isConfirmed||(s.value?s.value.toString().length>3&&(yield o.fire({currentProgressStep:2,title:e.translateService.instant("Success!"),html:e.translateService.instant("Video has been added! It'll take a while for the video to be processed."),icon:"success",confirmButtonText:e.translateService.instant('<i class="ft-heart-on"></i> Great!'),showCancelButton:!1})):yield o.fire({currentProgressStep:2,progressSteps:["?",'<i class="ft-edit"></i>','<i class="ft-x"></i>'],title:e.translateService.instant("Error!"),html:e.translateService.instant("Something went wrong. Please refresh the page and try again."),icon:"error",showConfirmButton:!1,showCancelButton:!1,showCloseButton:!0}),window.location.reload())})()}AddVideo$(e){return this.videoService.AddVideo$(e).pipe((0,k.U)(o=>!!o.id),(0,N.K)(o=>(console.error(o),(0,X.of)(!1))))}}return n.\u0275fac=function(e){return new(e||n)(t.Y36(w.gz),t.Y36(w.F0),t.Y36(V.K),t.Y36(L.e),t.Y36(y.sK),t.Y36(_e))},n.\u0275cmp=t.Xpm({type:n,selectors:[["ng-component"]],decls:7,vars:1,consts:[[1,"row"],[1,"col-12"],["translate","",1,"content-header","mr-1"],["type","button","class","btn btn-primary gradient-ibiza-sunset shadow-z-1-hover float-right","translate","",3,"click",4,"ngIf"],["type","button","translate","",1,"btn","btn-primary","gradient-ibiza-sunset","shadow-z-1-hover","float-right",3,"click"]],template:function(e,o){1&e&&(t.TgZ(0,"section")(1,"div",0)(2,"div",1)(3,"span",2),t._uU(4,"Videos"),t.qZA(),t.YNc(5,Wn,2,0,"button",3),t.qZA()()(),t._UZ(6,"app-video-list")),2&e&&(t.xp6(5),t.Q6J("ngIf",o.userService.User&&o.userService.User.IsAdmin))},dependencies:[g.O5,y.Pi,J]}),n})(),data:{title:"Videos",breadcrumb:[{label:"Home",url:"/"},{label:"Videos",url:""}]}},{path:"channels",component:en,data:{title:"Channels",breadcrumb:[{label:"Home",url:"/"},{label:"Channels",url:""}]}},{path:"channels/:channelId",component:Yt,data:{title:"Channel",breadcrumb:[{label:"Home",url:"/"},{label:"Channels",url:"/channels"},{label:"{{ChannelName}}",url:""}]}},{path:"channels/:channelId/videos/:id",component:kn,data:{title:"Video",breadcrumb:[{label:"Home",url:"/"},{label:"Channels",url:"/channels"},{label:"{{ChannelName}}",url:"/channels/:channelId"},{label:"{{VideoId}}",url:""}]}},{path:"account-settings",component:xe,data:{title:"Account Settings",breadcrumb:[{label:"Home",url:"/"},{label:"Account Settings",url:""}]},canActivate:[ye.a]},{path:"account-settings/:tab",component:xe,data:{title:"Account Settings",breadcrumb:[{label:"Home",url:"/"},{label:"Account Settings",url:""}]},canActivate:[ye.a]},{path:"faq",component:Un.v,data:{title:"FAQ",breadcrumb:[{label:"Home",url:"/"},{label:"FAQ",url:""}]}},{path:"login",redirectTo:"/pages/login",pathMatch:"full"}];let Ln=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[w.Bz.forChild(Nn),w.Bz]}),n})();var Yn=h(4873);let $n=(()=>{class n{}return n.\u0275fac=function(e){return new(e||n)},n.\u0275mod=t.oAB({type:n}),n.\u0275inj=t.cJS({imports:[g.ez,Ln,Te,Yn.m,m.u5,m.UX,bt,_t.kz,S.ef.forRoot({type:"ball-triangle-path"})]}),n})()}}]);