import{ay as H,J as u,i as T,aP as g,br as U,az as M,aA as d,o as t,aG as r,E as s,aI as V,bg as N,bh as m,aN as p,aD as f,c0 as C,bi as k,aU as S,aB as D,bH as G,M as c,aE as L,c3 as E}from"./index-BRUnowC8.js";import{V as _}from"./VForm-CLH0WxMk.js";import{V as A}from"./VSelect-B-WERBOu.js";import{V as F}from"./VSwitch-Dcs-7m3i.js";import"./VVirtualScroll-htzu2YXu.js";import"./VCheckboxBtn-D390s4L9.js";import"./VSelectionControl-Co1cRcmS.js";const O={style:{"margin-left":"-5px","margin-right":"-5px"}},Q=H({__name:"AddPlayerGroup",props:{provider:{}},setup(P){const $=L(),v=u(""),n=u([]),o=u(!0),b=u(!1),y=P,i=T(()=>g.getProvider(y.provider)),w=T(()=>Object.values(g.players).filter(l=>l.available&&l.type!=U.GROUP&&(l.provider==i.value?.domain||y.provider==="universal_group"))),B=async function(){g.createPlayerGroup(y.provider,v.value,n.value,o.value),$.push({name:"playersettings"})};return(l,e)=>(d(),M("section",null,[t(E,null,{default:r(()=>[s("div",O,[t(N,null,{default:r(()=>[m(p(l.$t("settings.add_group_player")),1)]),_:1}),i.value?.domain==="universal_group"?(d(),V(k,{key:0,style:{"white-space":"break-spaces"},innerHTML:f(C)(l.$t("settings.add_group_player_desc_universal"))},null,8,["innerHTML"])):(d(),V(k,{key:1,style:{"white-space":"break-spaces"},innerHTML:f(C)(l.$t("settings.add_group_player_desc",[i.value?.name]))},null,8,["innerHTML"])),e[6]||(e[6]=s("br",null,null,-1)),t(S),e[7]||(e[7]=s("br",null,null,-1)),e[8]||(e[8]=s("br",null,null,-1)),t(_,{ref:"form",modelValue:b.value,"onUpdate:modelValue":e[3]||(e[3]=a=>b.value=a),style:{"margin-right":"10px"}},{default:r(()=>[t(G,{modelValue:v.value,"onUpdate:modelValue":e[0]||(e[0]=a=>v.value=a),label:l.$t("settings.player_name"),variant:"outlined",clearable:"",required:"",rules:[a=>a.length>0||l.$t("settings.invalid_input")]},null,8,["modelValue","label","rules"]),t(A,{modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),clearable:"",multiple:"",items:w.value,"item-title":"display_name","item-value":"player_id",label:l.$t("settings.group_members")},null,8,["modelValue","items","label"]),t(F,{modelValue:o.value,"onUpdate:modelValue":e[2]||(e[2]=a=>o.value=a),color:"primary",label:l.$t("settings.dynamic_members.label")},null,8,["modelValue","label"]),i.value?.domain!=="universal_group"?(d(),V(k,{key:0,style:{"white-space":"break-spaces","padding-left":"0","margin-top":"-25px","margin-bottom":"35px"}},{default:r(()=>[m(p(l.$t("settings.dynamic_members.description")),1)]),_:1})):D("",!0),e[5]||(e[5]=s("br",null,null,-1)),t(c,{block:"",color:"primary",disabled:!b.value||n.value.length==0&&!o.value,onClick:B},{default:r(()=>[m(p(l.$t("settings.save")),1)]),_:1},8,["disabled"])]),_:1},8,["modelValue"]),e[9]||(e[9]=s("br",null,null,-1)),t(c,{block:"",onClick:e[4]||(e[4]=a=>f($).back())},{default:r(()=>[m(p(l.$t("close")),1)]),_:1})])]),_:1})]))}});export{Q as default};
