import{d as y,an as V,r as p,z as g,b as n,P as _,c as S,g as C,f as a,w as s,i as o,Y as u,t as i,u as P}from"./index-5e5d70f8.js";import{V as h,a as k,b as $}from"./VCardText-bdfad4e5.js";import{V as w}from"./VList-1bffb8df.js";import{V as N,a as Y}from"./VForm-b8a697a6.js";import{V as B}from"./VTextField-fa7e9a48.js";import{s as v}from"./VListItem-a276ed14.js";import"./VCheckboxBtn-d41d6adf.js";import"./VMenu-4ca080f5.js";import"./VVirtualScroll-a35573be.js";const T={style:{"margin-left":"-5px","margin-right":"-5px"}},A=o("br",null,null,-1),E=o("br",null,null,-1),F=o("br",null,null,-1),R=o("br",null,null,-1),U=o("br",null,null,-1),K=y({__name:"AddSyncGroupPlayer",setup(j){const c=V(),d=p(""),t=p([]),m=p(!1),f=g(()=>t.value.length>0?Object.values(n.players).filter(e=>{var l;return e.available&&(e.can_sync_with.includes(t.value[0])||e.player_id==t.value[0])&&((l=n.getProvider(e.provider))==null?void 0:l.supported_features.includes(_.SYNC_PLAYERS))}):Object.values(n.players).filter(e=>{var l;return e.available&&e.can_sync_with.length&&((l=n.getProvider(e.provider))==null?void 0:l.supported_features.includes(_.SYNC_PLAYERS))})),b=async function(){n.createSyncPlayerGroup(d.value,t.value),c.push({name:"playersettings"})};return(e,l)=>(S(),C("section",null,[a($,null,{default:s(()=>[o("div",T,[a(h,null,{default:s(()=>[u(i(e.$t("settings.create_sync_group_player")),1)]),_:1}),a(k,{style:{"white-space":"break-spaces"}},{default:s(()=>[u(i(e.$t("settings.create_sync_group_player_desc")),1)]),_:1}),A,a(w),E,F,a(N,{ref:"form",modelValue:m.value,"onUpdate:modelValue":l[2]||(l[2]=r=>m.value=r),style:{"margin-right":"10px"}},{default:s(()=>[a(B,{modelValue:d.value,"onUpdate:modelValue":l[0]||(l[0]=r=>d.value=r),label:e.$t("settings.player_name"),variant:"outlined",clearable:"",required:""},null,8,["modelValue","label"]),a(Y,{modelValue:t.value,"onUpdate:modelValue":l[1]||(l[1]=r=>t.value=r),clearable:"",multiple:"",items:f.value,"item-title":"display_name","item-value":"player_id",label:e.$t("settings.group_members"),required:""},null,8,["modelValue","items","label"]),R,a(v,{block:"",color:"primary",disabled:!m.value,onClick:b},{default:s(()=>[u(i(e.$t("settings.save")),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue"]),U,a(v,{block:"",onClick:l[3]||(l[3]=r=>P(c).back())},{default:s(()=>[u(i(e.$t("close")),1)]),_:1})])]),_:1})]))}});export{K as default};
