import{a7 as U,F as i,i as $,ap as g,b3 as _,a8 as B,a9 as d,o as t,ae as r,E as s,ai as V,aS as H,aT as p,an as m,ac as f,bF as C,aU as k,au as F,aa as L,bj as M,ah as c,ad as N,bI as D}from"./index-CFcIX8RO.js";import{V as G}from"./VForm-D4C74Wdm.js";import{V as j}from"./VSelect-9ABLzY_9.js";import{V as E}from"./VSwitch-JHKrUQHN.js";import"./VVirtualScroll-BRrQ8Y7O.js";import"./VCheckboxBtn-Dy9mjR59.js";const O={style:{"margin-left":"-5px","margin-right":"-5px"}},K=U({__name:"AddPlayerGroup",props:{provider:{}},setup(w){const T=N(),v=i(""),n=i([]),o=i(!0),b=i(!1),y=w,u=$(()=>g.getProvider(y.provider)),P=$(()=>Object.values(g.players).filter(l=>l.available&&l.type!=_.GROUP&&(l.provider==u.value?.lookup_key||y.provider==="universal_group"))),S=async function(){g.createPlayerGroup(y.provider,v.value,n.value,o.value),T.push({name:"playersettings"})};return(l,e)=>(d(),B("section",null,[t(D,null,{default:r(()=>[s("div",O,[t(H,null,{default:r(()=>[p(m(l.$t("settings.add_group_player")),1)]),_:1}),u.value?.lookup_key==="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",[u.value?.name]))},null,8,["innerHTML"])),e[6]||(e[6]=s("br",null,null,-1)),t(F),e[7]||(e[7]=s("br",null,null,-1)),e[8]||(e[8]=s("br",null,null,-1)),t(G,{ref:"form",modelValue:b.value,"onUpdate:modelValue":e[3]||(e[3]=a=>b.value=a),style:{"margin-right":"10px"}},{default:r(()=>[t(M,{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(j,{modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),clearable:"",multiple:"",items:P.value,"item-title":"display_name","item-value":"player_id",label:l.$t("settings.group_members")},null,8,["modelValue","items","label"]),t(E,{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"]),u.value?.lookup_key!=="universal_group"?(d(),V(k,{key:0,style:{"white-space":"break-spaces","padding-left":"0","margin-top":"-25px","margin-bottom":"35px"}},{default:r(()=>[p(m(l.$t("settings.dynamic_members.description")),1)]),_:1})):L("",!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:S},{default:r(()=>[p(m(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(T).back())},{default:r(()=>[p(m(l.$t("close")),1)]),_:1})])]),_:1})]))}});export{K as default};
