import{v as $,aa as C,r as M,w,y as n,E as f,l as o,A as s,x as l,R as u,N as t,B as i,I as d,z as p,L as a}from"./index-ab7e5b57.js";import{V as B,_ as N}from"./EditConfig.vue_vue_type_style_index_0_lang-56b17419.js";import{a as I,V as S}from"./VCardText-2b5487e9.js";import{a as m}from"./VCard-b678de17.js";import{V as g}from"./forwardRefs-d370b8e9.js";import{V as T}from"./VTextField-864bfd83.js";import"./VExpansionPanel-da6332b7.js";import"./VCheckboxBtn-b3446400.js";import"./VSlideGroup-6eee8f80.js";import"./VMenu-9ab9e35f.js";import"./VForm-7d3047ef.js";/* empty css              */import"./VDialog-d826b4f0.js";import"./VSelect-1b49fdac.js";import"./VVirtualScroll-506acdd4.js";const E={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},P=["href"],D=i("br",null,null,-1),R=i("br",null,null,-1),U=i("br",null,null,-1),j=i("br",null,null,-1),x=$({__name:"EditPlayer",props:{playerId:{}},setup(V){const _=V,h=C(),e=M();w(()=>_.playerId,async r=>{r&&(e.value=await a.getPlayerConfig(r))},{immediate:!0});const k=async function(r){r.enabled=e.value.enabled,r.name=e.value.name||null,a.savePlayerConfig(_.playerId,r),h.push({name:"playersettings"})};return(r,v)=>(n(),f("section",null,[o(S,null,{default:s(()=>{var c,b;return[e.value&&l(a).providers[e.value.provider].domain in l(a).providerManifests?(n(),f("div",E,[o(I,null,{default:s(()=>[u(t(r.$t("settings.config_player",[e.value.name||l(a).players[e.value.player_id].name])),1)]),_:1}),o(m,null,{default:s(()=>[i("b",null,t(r.$t("settings.player_id"))+": ",1),u(t(e.value.player_id),1)]),_:1}),o(m,null,{default:s(()=>[i("b",null,t(r.$t("settings.player_provider"))+": ",1),u(t(l(a).providerManifests[l(a).providers[e.value.provider].domain].name)+" ( "+t(l(a).providerManifests[l(a).providers[e.value.provider].domain].description)+") ",1),l(a).providerManifests[l(a).providers[e.value.provider].domain].documentation?(n(),f("a",{key:0,href:l(a).providerManifests[l(a).providers[e.value.provider].domain].documentation,target:"_blank"},t(r.$t("settings.check_docs")),9,P)):d("",!0)]),_:1}),l(a).players[e.value.player_id]?(n(),p(m,{key:0},{default:s(()=>[i("b",null,t(r.$t("settings.player_model"))+": ",1),u(t(l(a).players[e.value.player_id].device_info.manufacturer)+" / "+t(l(a).players[e.value.player_id].device_info.model),1)]),_:1})):d("",!0),l(a).players[e.value.player_id]?(n(),p(m,{key:1},{default:s(()=>[i("b",null,t(r.$t("settings.player_address"))+": ",1),u(t(l(a).players[e.value.player_id].device_info.address),1)]),_:1})):d("",!0),o(m,null,{default:s(()=>[i("b",null,t(r.$t("settings.player_type_label"))+": ",1),u(t(r.$t(`player_type.${l(a).players[e.value.player_id].type}`)),1)]),_:1}),D,o(g),R,U,"name"in e.value?(n(),p(T,{key:2,modelValue:e.value.name,"onUpdate:modelValue":v[0]||(v[0]=y=>e.value.name=y),placeholder:(c=e.value)==null?void 0:c.name,label:r.$t("settings.player_name"),variant:"outlined",clearable:""},null,8,["modelValue","placeholder","label"])):d("",!0),"enabled"in e.value?(n(),p(B,{key:3,modelValue:e.value.enabled,"onUpdate:modelValue":v[1]||(v[1]=y=>e.value.enabled=y),label:r.$t("settings.enable_player"),color:"primary",disabled:(b=l(a).providerManifests[l(a).providers[e.value.provider].domain])==null?void 0:b.builtin},null,8,["modelValue","label","disabled"])):d("",!0)])):d("",!0),j,o(g),e.value?(n(),p(N,{key:1,disabled:!e.value.enabled,"config-entries":Object.values(e.value.values),onSubmit:k},null,8,["disabled","config-entries"])):d("",!0)]}),_:1})]))}});export{x as default};
