import{u as B}from"./vue-router-BgJK_hRC.js";import{c as g,k as D,C as T}from"./index-CxiRlsCY.js";import{q as S,D as V,e as U,aa as L,m as M,a8 as N,a6 as _,n as C,r as G}from"./vuetify-RelkxOq-.js";import{d as q,r as u,c,b as E,e as d,H as t,E as r,f as s,D as f,$ as m,a1 as p,u as k,I as F}from"./lucide-C2DU1LFb.js";import"./qrcode-DSFhiIp2.js";import"./marked-C0Rlrcoy.js";import"./color-BTziYnFN.js";import"./vue-i18n-DySrp6mW.js";import"./vueuse-DIaEWNCo.js";/* empty css            */import"./swiper-Jy9GbtzK.js";const O={style:{"margin-left":"-5px","margin-right":"-5px"}},Z=q({__name:"AddPlayerGroup",props:{provider:{}},setup(w){const $=B(),v=u(""),n=u([]),o=u(!0),b=u(!1),y=w,i=c(()=>g.getProvider(y.provider)),H=c(()=>Object.values(g.players).filter(l=>l.available&&l.type!=D.GROUP&&(l.provider==i.value?.instance_id||y.provider==="universal_group"))),P=async function(){g.createPlayerGroup(y.provider,v.value,n.value,o.value),$.push({name:"playersettings"})};return(l,e)=>(d(),E("section",null,[t(G,null,{default:r(()=>[s("div",O,[t(S,null,{default:r(()=>[m(p(l.$t("settings.add_group_player")),1)]),_:1}),i.value?.domain==="universal_group"?(d(),f(V,{key:0,style:{"white-space":"break-spaces"},innerHTML:k(T)(l.$t("settings.add_group_player_desc_universal"))},null,8,["innerHTML"])):(d(),f(V,{key:1,style:{"white-space":"break-spaces"},innerHTML:k(T)(l.$t("settings.add_group_player_desc",[i.value?.name]))},null,8,["innerHTML"])),e[6]||(e[6]=s("br",null,null,-1)),t(U),e[7]||(e[7]=s("br",null,null,-1)),e[8]||(e[8]=s("br",null,null,-1)),t(L,{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(N,{modelValue:n.value,"onUpdate:modelValue":e[1]||(e[1]=a=>n.value=a),clearable:"",multiple:"",items:H.value,"item-title":"display_name","item-value":"player_id",label:l.$t("settings.group_members")},null,8,["modelValue","items","label"]),t(_,{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(),f(V,{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})):F("",!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:P},{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=>k($).back())},{default:r(()=>[m(p(l.$t("close")),1)]),_:1})])]),_:1})]))}});export{Z as default};
