import{d as w,ak as B,r as E,K as N,c as o,h as f,f as p,w as d,b as a,u as r,W as m,t,g as s,j as u,e as y}from"./index-CLKg64ON.js";import{V as S,E as T}from"./EditConfig-CkB1xNeb.js";import{b as h,V as I,a as v}from"./VCardText-BAUfdzDA.js";import{V as $}from"./VList-BvG6-yh2.js";import{V as j}from"./VTextField-C1QkMZRy.js";import"./VExpansionPanels-BBVj4yuE.js";import"./VListItem-B_TSjQ1y.js";import"./VCheckboxBtn-DXJHHMHd.js";import"./VMenu-CLSWQG_U.js";import"./VAlert-CCGDAWu2.js";import"./VForm-Cft_KNdc.js";import"./VVirtualScroll-DKBgr9yN.js";import"./VCard-BaRPabiE.js";import"./VSpacer-CqqJVVs3.js";/* empty css              */import"./VDialog-BpGrcp5y.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const D={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},U=["href"],ee=w({__name:"EditPlayer",props:{playerId:{}},setup(C){const P=B(),e=E(),b=C;N(()=>b.playerId,async l=>{l&&(e.value=await a.getPlayerConfig(l))},{immediate:!0});const M=async function(l){l.enabled=e.value.enabled,l.name=e.value.name||null,a.savePlayerConfig(b.playerId,l),P.push({name:"playersettings"})};return(l,i)=>(o(),f("section",null,[p(h,null,{default:d(()=>{var g,_,V;return[e.value&&r(a).getProviderManifest(e.value.provider).domain in r(a).providerManifests?(o(),f("div",D,[p(I,null,{default:d(()=>{var n;return[m(t(l.$t("settings.config_player",[e.value.name||((n=r(a).players[e.value.player_id])==null?void 0:n.name)||e.value.default_name])),1)]}),_:1}),p(v,null,{default:d(()=>[s("b",null,t(l.$t("settings.player_id"))+": ",1),m(t(e.value.player_id),1)]),_:1}),p(v,null,{default:d(()=>{var n,c,k;return[s("b",null,t(l.$t("settings.player_provider"))+": ",1),m(t((n=r(a).getProviderManifest(e.value.provider))==null?void 0:n.name)+" ",1),(c=r(a).getProviderManifest(e.value.provider))!=null&&c.documentation?(o(),f("a",{key:0,href:(k=r(a).getProviderManifest(e.value.provider))==null?void 0:k.documentation,target:"_blank"}," ["+t(l.$t("settings.check_docs"))+"]",9,U)):u("",!0)]}),_:1}),r(a).players[e.value.player_id]?(o(),y(v,{key:0},{default:d(()=>[s("b",null,t(l.$t("settings.player_model"))+": ",1),m(t(r(a).players[e.value.player_id].device_info.manufacturer)+" / "+t(r(a).players[e.value.player_id].device_info.model),1)]),_:1})):u("",!0),(g=r(a).players[e.value.player_id])!=null&&g.device_info.address?(o(),y(v,{key:1},{default:d(()=>[s("b",null,t(l.$t("settings.player_address"))+": ",1),m(t(r(a).players[e.value.player_id].device_info.address),1)]),_:1})):u("",!0),r(a).players[e.value.player_id]?(o(),y(v,{key:2},{default:d(()=>[s("b",null,t(l.$t("settings.player_type_label"))+": ",1),m(t(l.$t(`player_type.${r(a).players[e.value.player_id].type}`)),1)]),_:1})):u("",!0),i[2]||(i[2]=s("br",null,null,-1)),p($),i[3]||(i[3]=s("br",null,null,-1)),i[4]||(i[4]=s("br",null,null,-1)),"name"in e.value?(o(),y(j,{key:3,modelValue:e.value.name,"onUpdate:modelValue":i[0]||(i[0]=n=>e.value.name=n),placeholder:(_=e.value)==null?void 0:_.name,label:l.$t("settings.player_name"),variant:"outlined",clearable:"",class:"configcolumnleft",style:{"margin-right":"25px"}},null,8,["modelValue","placeholder","label"])):u("",!0),"enabled"in e.value?(o(),y(S,{key:4,modelValue:e.value.enabled,"onUpdate:modelValue":i[1]||(i[1]=n=>e.value.enabled=n),label:l.$t("settings.enable_player"),color:"primary",disabled:(V=r(a).getProviderManifest(e.value.provider))==null?void 0:V.builtin},null,8,["modelValue","label","disabled"])):u("",!0)])):u("",!0),i[5]||(i[5]=s("br",null,null,-1)),p($),e.value?(o(),y(T,{key:1,disabled:!e.value.enabled,"config-entries":Object.values(e.value.values),onSubmit:M},null,8,["disabled","config-entries"])):u("",!0)]}),_:1})]))}});export{ee as default};
