import{Da as e5,Eo as kb,Gr as Va,Io as lA,Is as rh,Lr as Uj,Oi as Zt,Oo as kj,Qr as W$,Wa as g,Za as gx,_s as ph,gc as wf,ua as cA,vc as wp}from"./chunk-B_pj7Jpm.js";import{A as qn,O as ln,r as D,s as Jn}from"./chunk-BPHMC4rz.js";import{c as oi}from"./chunk-CEibY8iL.js";var O=class i{inputId=ph.required();scopeItems;selectedId;ngOnInit(){this.buildScopeItems()}buildScopeItems(){this.scopeItems=[{id:`local`,label:"Only videos from this platform"},{id:`federated`,label:"Videos from all platforms"}]}propagateChange=e=>{};writeValue(e){this.selectedId=e}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}onModelChange(){this.propagateChange(this.selectedId)}static ɵfac=function(o){return new(o||i)};static ɵcmp=Va({type:i,selectors:[[`my-select-videos-scope`]],inputs:{inputId:[1,`inputId`]},features:[e5([{provide:D,useExisting:wf(()=>i),multi:!0}])],decls:1,vars:3,consts:[[3,`ngModelChange`,`inputId`,`items`,`ngModel`]],template:function(o,t){o&1&&(wp(0,`my-select-options`,0),lA(`ngModelChange`,function(n){return W$(t.selectedId,n)||(t.selectedId=n),n}),rh(`ngModelChange`,function(){return t.onModelChange()}),kb(),kj()),o&2&&(gx(`inputId`,t.inputId())(`items`,t.scopeItems),cA(`ngModel`,t.selectedId),Uj())},dependencies:[Jn,qn,ln,oi],encapsulation:2,changeDetection:1})};var w=class i{server=g(Zt);inputId=ph.required();sortItems;selectedId;serverConfig;ngOnInit(){this.serverConfig=this.server.getHTMLConfig(),this.buildSortItems()}buildSortItems(){this.sortItems=[{id:`-publishedAt`,label:"Recently Added"},{id:`-originallyPublishedAt`,label:"Original Publication Date"},{id:`name`,label:"نام"}],this.isTrendingSortEnabled(`most-viewed`)&&this.sortItems.push({id:`-trending`,label:"Recent Views"}),this.isTrendingSortEnabled(`hot`)&&this.sortItems.push({id:`-hot`,label:"Hot"}),this.isTrendingSortEnabled(`most-liked`)&&this.sortItems.push({id:`-likes`,label:"تعداد لایک"}),this.sortItems.push({id:`-views`,label:"Global Views"})}isTrendingSortEnabled(e){return this.serverConfig.trending.videos.algorithms.enabled.includes(e)}propagateChange=e=>{};writeValue(e){this.selectedId=e}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}onModelChange(){this.propagateChange(this.selectedId)}static ɵfac=function(o){return new(o||i)};static ɵcmp=Va({type:i,selectors:[[`my-select-videos-sort`]],inputs:{inputId:[1,`inputId`]},features:[e5([{provide:D,useExisting:wf(()=>i),multi:!0}])],decls:1,vars:3,consts:[[3,`ngModelChange`,`inputId`,`items`,`ngModel`]],template:function(o,t){o&1&&(wp(0,`my-select-options`,0),lA(`ngModelChange`,function(n){return W$(t.selectedId,n)||(t.selectedId=n),n}),rh(`ngModelChange`,function(){return t.onModelChange()}),kb(),kj()),o&2&&(gx(`inputId`,t.inputId())(`items`,t.sortItems),cA(`ngModel`,t.selectedId),Uj())},dependencies:[Jn,qn,ln,oi],encapsulation:2,changeDetection:1})};export{w as n,O as t};
//# debugId=5719fe17-11b8-5d2d-9af6-d2be64ca676d
//# sourceMappingURL=chunk-Boe1xg5G2.js.map