import{Q as U,x as n,c as y,a4 as b,a6 as w,Z as B,B as a,U as r,bm as P,S as N,W as s,aU as q,al as d,aa as m,aV as g,a0 as f,bi as F,Y as H,bn as L}from"./index-orrnp8a1.js";import{V as Y}from"./VForm-BDfEPrwE.js";import{a as k,V as _}from"./VSwitch-Cg3DDPQB.js";import{V as j}from"./VTextField-DaF8PfrV.js";import{a as $}from"./VBtn-BJolvyKt.js";import"./VCheckboxBtn-CICj8ZxL.js";import"./VVirtualScroll-Q9Rc10mA.js";import"./VChip-DzIcRFdM.js";const A={style:{"margin-left":"-5px","margin-right":"-5px"}},Z=U({__name:"AddPlayerGroup",setup(D){const V=L(),u=n("universal"),p=n(""),o=n([]),i=n(!1),v=n(!1),C=y(()=>[{name:"Universal",lookup_key:"universal"},...Object.values(b.providers).filter(l=>l.supported_features.includes(w.SYNC_PLAYERS))]),S=y(()=>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,o.value,i.value),V.push({name:"playersettings"})};return(l,e)=>(N(),B("section",null,[a(P,null,{default:r(()=>[s("div",A,[a(q,null,{default:r(()=>[d(m(l.$t("settings.add_group_player")),1)]),_:1}),a(g,{style:{"white-space":"break-spaces"},innerHTML:f(F)(l.$t("settings.add_group_player_desc"))},null,8,["innerHTML"]),e[7]||(e[7]=s("br",null,null,-1)),a(H),e[8]||(e[8]=s("br",null,null,-1)),e[9]||(e[9]=s("br",null,null,-1)),a(Y,{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":"lookup_key",label:l.$t("settings.group_type"),required:"",disabled:o.value.length>0},null,8,["modelValue","items","label","disabled"]),a(_,{modelValue:i.value,"onUpdate:modelValue":e[1]||(e[1]=t=>i.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(()=>[d(m(l.$t("settings.dynamic_members.description")),1)]),_:1}),a(j,{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:o.value,"onUpdate:modelValue":e[3]||(e[3]=t=>o.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||o.value.length==0&&!i.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=>f(V).back())},{default:r(()=>[d(m(l.$t("close")),1)]),_:1})])]),_:1})]))}});export{Z as default};
