import{Q as U,x as i,c as g,a4 as b,a6 as w,Z as B,B as a,U as r,bD as P,S as N,W as s,aZ as _,ao as d,ab as m,a_ as f,a0 as y,bz as q,Y as D,bE as E}from"./index-Bduq4vJM.js";import{V as F}from"./VForm-Cm4j-rit.js";import{a as k,V as H}from"./VSwitch-7T-ZmqqN.js";import{V as L}from"./VTextField-lpT7m_Xn.js";import{a as $}from"./VBtn-DWiYTBpb.js";import"./VCheckboxBtn-DLibXb0-.js";import"./VVirtualScroll-VdTkqEkN.js";const Y={style:{"margin-left":"-5px","margin-right":"-5px"}},Z=U({__name:"AddPlayerGroup",setup(c){const V=E(),u=i("universal"),p=i(""),n=i([]),o=i(!1),v=i(!1),C=g(()=>[...Object.values(b.providers).filter(l=>l.supported_features.includes(w.SYNC_PLAYERS)),{name:"Universal",instance_id:"universal"}]),S=g(()=>Object.values(b.players).filter(l=>l.available&&!l.provider.startsWith("player_group")&&(l.provider==u.value||u.value=="universal"))),T=async function(){b.createPlayerGroup(u.value,p.value,n.value,o.value),V.push({name:"playersettings"})};return(l,e)=>(N(),B("section",null,[a(P,null,{default:r(()=>[s("div",Y,[a(_,null,{default:r(()=>[d(m(l.$t("settings.add_group_player")),1)]),_:1}),a(f,{style:{"white-space":"break-spaces"},innerHTML:y(q)(l.$t("settings.add_group_player_desc"))},null,8,["innerHTML"]),e[7]||(e[7]=s("br",null,null,-1)),a(D),e[8]||(e[8]=s("br",null,null,-1)),e[9]||(e[9]=s("br",null,null,-1)),a(F,{ref:"form",modelValue:v.value,"onUpdate:modelValue":e[4]||(e[4]=t=>v.value=t),style:{"margin-right":"10px"}},{default:r(()=>[a(k,{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=t=>u.value=t),clearable:"",items:C.value,"item-title":"name","item-value":"instance_id",label:l.$t("settings.group_type"),required:"",disabled:n.value.length>0},null,8,["modelValue","items","label","disabled"]),a(H,{modelValue:o.value,"onUpdate:modelValue":e[1]||(e[1]=t=>o.value=t),color:"primary",label:l.$t("settings.dynamic_members.label")},null,8,["modelValue","label"]),a(f,{style:{"white-space":"break-spaces","padding-left":"0","margin-top":"-25px","margin-bottom":"35px"}},{default:r(()=>[d(m(l.$t("settings.dynamic_members.description")),1)]),_:1}),a(L,{modelValue:p.value,"onUpdate:modelValue":e[2]||(e[2]=t=>p.value=t),label:l.$t("settings.player_name"),variant:"outlined",clearable:"",required:""},null,8,["modelValue","label"]),a(k,{modelValue:n.value,"onUpdate:modelValue":e[3]||(e[3]=t=>n.value=t),clearable:"",multiple:"",items:S.value,"item-title":"display_name","item-value":"player_id",label:l.$t("settings.group_members"),required:""},null,8,["modelValue","items","label"]),e[6]||(e[6]=s("br",null,null,-1)),a($,{block:"",color:"primary",disabled:!v.value||n.value.length==0&&!o.value,onClick:T},{default:r(()=>[d(m(l.$t("settings.save")),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue"]),e[10]||(e[10]=s("br",null,null,-1)),a($,{block:"",onClick:e[5]||(e[5]=t=>y(V).back())},{default:r(()=>[d(m(l.$t("close")),1)]),_:1})])]),_:1})]))}});export{Z as default};
