import{h as R}from"./chunk-7SI2OHLV.js";import{a as D}from"./chunk-IYLEQVRP.js";import{b as N}from"./chunk-4OFCYKML.js";import{E as A,a as O,g as U,o as V}from"./chunk-OPKDC23H.js";import{Ec as c,Hb as S,Jb as T,Na as h,Ua as f,Y as g,cc as b,dc as w,ec as v,ga as _,gb as s,ha as C,hb as p,kc as E,mb as m,nb as y,ob as I,pb as d,ra as u,xc as F,zb as M}from"./chunk-ZSQR4KTU.js";import{i as r}from"./chunk-IQVXR75E.js";function x(t,n){t&1&&d(0,"my-collaborator-state",2)}function G(t,n){t&1&&d(0,"my-collaborator-state",3)}function P(t,n){if(t&1&&s(0,x,1,0,"my-collaborator-state",2)(1,G,1,0,"my-collaborator-state",3),t&2){let a=T().$implicit;p(a.editor?0:a.owner?1:-1)}}function j(t,n){if(t&1&&s(0,P,2,1),t&2){let a=n.$implicit;p(a.collaborate?0:-1)}}var X=(()=>{let n=class n{inputId=c.required();items=c([]);channels;selectedId;ngOnChanges(){this.channels=this.items().map(e=>{let o=e.avatarFileUrl?e.avatarFileUrl:N.GET_DEFAULT_AVATAR_URL(21);return Object.assign({},e,{imageUrl:o})})}propagateChange=e=>{};writeValue(e){this.selectedId=typeof e=="string"?parseInt(e,10):e}registerOnChange(e){this.propagateChange=e}registerOnTouched(){}onModelChange(){this.propagateChange(this.selectedId)}getSelectedChannel(){return(this.channels||[]).find(e=>e.id+""==this.selectedId+"")}};r(n,"\u0275fac",function(o){return new(o||n)}),r(n,"\u0275cmp",h({type:n,selectors:[["my-select-channel"]],inputs:{inputId:[1,"inputId"],items:[1,"items"]},features:[E([{provide:O,useExisting:g(()=>n),multi:!0}]),u],decls:3,vars:4,consts:[["itemExtra",""],[3,"ngModelChange","inputId","items","ngModel","filter"],["type","accepted","disableTooltip","true",1,"lh-1","ms-2"],["type","owner","disableTooltip","true",1,"lh-1","ms-2"]],template:function(o,i){if(o&1){let L=M();y(0,"my-select-options",1),v("ngModelChange",function(l){return _(L),w(i.selectedId,l)||(i.selectedId=l),C(l)}),S("ngModelChange",function(){return i.onModelChange()}),f(1,j,1,1,"ng-template",null,0,F),I()}o&2&&(m("inputId",i.inputId())("items",i.channels),b("ngModel",i.selectedId),m("filter",i.channels&&i.channels.length>5))},dependencies:[A,U,V,R,D],encapsulation:2}));let t=n;return t})();export{X as a};
/**i18n:347eeb695970c32bc275618edc2e751c67145d9fc3012e70543c114a99b9e016*/
//# sourceMappingURL=chunk-KTG6FXAU.js.map
