import{x as P,az as U,r as i,c as f,I as b,P as B,y as T,D as w,n as a,A as r,B as s,S as n,J as d,G as N}from"./index-CFvoaD7J.js";import{b as _,V as q,a as g}from"./VCardText-CpOuj25H.js";import{V as A}from"./VList-fGk9SRdf.js";import{V as D}from"./VForm-B86dz_JX.js";import{a as y,V as F}from"./VSwitch-Cbz5zuOr.js";import{V as G}from"./VTextField-DF4u_eMy.js";import{v as $}from"./VListItem-CSPID7yq.js";import"./VCheckboxBtn-CRgZyCzV.js";import"./VMenu-9pSrU4Fo.js";import"./VVirtualScroll-BDBVEoUv.js";import"./VChip-Ccz1-bmn.js";const c={style:{"margin-left":"-5px","margin-right":"-5px"}},K=P({__name:"AddPlayerGroup",setup(j){const V=U(),u=i("universal"),p=i(""),o=i([]),m=i(!1),v=i(!1),k=f(()=>[{name:"Universal",instance_id:"universal"},...Object.values(b.providers).filter(l=>l.supported_features.includes(B.SYNC_PLAYERS))]),C=f(()=>Object.values(b.players).filter(l=>l.available&&!l.provider.startsWith("player_group")&&(l.provider==u.value||u.value=="universal"))),S=async function(){b.createPlayerGroup(u.value,p.value,o.value,m.value),V.push({name:"playersettings"})};return(l,e)=>(T(),w("section",null,[a(_,null,{default:r(()=>[s("div",c,[a(q,null,{default:r(()=>[n(d(l.$t("settings.add_group_player")),1)]),_:1}),a(g,{style:{"white-space":"break-spaces"}},{default:r(()=>[n(d(l.$t("settings.add_group_player_desc")),1)]),_:1}),e[7]||(e[7]=s("br",null,null,-1)),a(A),e[8]||(e[8]=s("br",null,null,-1)),e[9]||(e[9]=s("br",null,null,-1)),a(D,{ref:"form",modelValue:v.value,"onUpdate:modelValue":e[4]||(e[4]=t=>v.value=t),style:{"margin-right":"10px"}},{default:r(()=>[a(y,{modelValue:u.value,"onUpdate:modelValue":e[0]||(e[0]=t=>u.value=t),clearable:"",items:k.value,"item-title":"name","item-value":"instance_id",label:l.$t("settings.group_type"),required:"",disabled:o.value.length>0},null,8,["modelValue","items","label","disabled"]),a(F,{modelValue:m.value,"onUpdate:modelValue":e[1]||(e[1]=t=>m.value=t),color:"primary",label:l.$t("settings.dynamic_members.label")},null,8,["modelValue","label"]),a(g,{style:{"white-space":"break-spaces","padding-left":"0","margin-top":"-25px","margin-bottom":"35px"}},{default:r(()=>[n(d(l.$t("settings.dynamic_members.description")),1)]),_:1}),a(G,{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(y,{modelValue:o.value,"onUpdate:modelValue":e[3]||(e[3]=t=>o.value=t),clearable:"",multiple:"",items:C.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||o.value.length==0&&!m.value,onClick:S},{default:r(()=>[n(d(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=>N(V).back())},{default:r(()=>[n(d(l.$t("close")),1)]),_:1})])]),_:1})]))}});export{K as default};
