import{v as k,aa as h,r as m,c as $,w as B,y as f,E as y,l as a,A as t,x as v,R as V,N as d,I as N,B as o,L as p}from"./index-347ebc0b.js";import{a as U,V as w}from"./VCardText-96771680.js";import{V as T,j as b}from"./forwardRefs-094784c1.js";import{V as P}from"./VForm-b64afd9b.js";import{V as S}from"./VTextField-bf3d7462.js";import{V as j}from"./VSelect-6908993e.js";import"./VMenu-76eea3a9.js";import"./VCheckboxBtn-10b60710.js";import"./VSlideGroup-71936378.js";import"./VVirtualScroll-2e3572fb.js";const q={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},A=o("br",null,null,-1),D=o("br",null,null,-1),E=o("br",null,null,-1),F=o("br",null,null,-1),G=o("br",null,null,-1),Q=k({__name:"AddGroupPlayer",props:{provider:{}},setup(_){const c=h(),s=m(""),n=m([]),i=m(!1),u=_,g=$(()=>Object.values(p.players).filter(e=>u.provider=="ugp"||e.provider==u.provider&&e.can_sync_with.length).sort((e,l)=>e.display_name.toUpperCase()>l.display_name.toUpperCase()?1:-1).map(e=>({title:e.display_name,value:e.player_id})));B(()=>u.provider,async e=>{s.value="",i.value=!1,n.value=[]},{immediate:!0});const C=async function(){p.createPlayerGroup(u.provider,s.value,n.value),c.push({name:"playersettings"})};return(e,l)=>(f(),y("section",null,[a(w,null,{default:t(()=>[e.provider&&e.provider in v(p).providers?(f(),y("div",q,[a(U,null,{default:t(()=>[V(d(e.$t("settings.add_group_player"))+" ("+d(v(p).providers[e.provider].name)+") ",1)]),_:1}),A,a(T),D,E,a(P,{ref:"form",modelValue:i.value,"onUpdate:modelValue":l[2]||(l[2]=r=>i.value=r),style:{"margin-right":"10px"}},{default:t(()=>[a(S,{modelValue:s.value,"onUpdate:modelValue":l[0]||(l[0]=r=>s.value=r),label:e.$t("settings.player_name"),variant:"outlined",clearable:"",required:""},null,8,["modelValue","label"]),a(j,{modelValue:n.value,"onUpdate:modelValue":l[1]||(l[1]=r=>n.value=r),clearable:"",multiple:"",items:g.value,label:e.$t("settings.group_members"),required:""},null,8,["modelValue","items","label"]),F,a(b,{block:"",color:"primary",disabled:!i.value,onClick:C},{default:t(()=>[V(d(e.$t("settings.save")),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue"]),G,a(b,{block:"",onClick:l[3]||(l[3]=r=>v(c).back())},{default:t(()=>[V(d(e.$t("close")),1)]),_:1})])):N("",!0)]),_:1})]))}});export{Q as default};
