import{x as I,aA as M,r as T,w as N,y as n,D as g,n as y,A as d,I as a,G as r,S as p,J as i,B as s,aV as S,K as u,z as m,a4 as D}from"./index-Dvn4b3kE.js";import{E}from"./EditConfig-GlgW_AZF.js";import{b as U,V as A,a as v}from"./VCardText-CXkKR7ML.js";import{V as C}from"./VList-BFxH2oe3.js";import{V as G}from"./VTextField-CNfw_aKz.js";import{V as O}from"./VSwitch-BjWr2FW1.js";import{v as R}from"./VListItem-XlHdRn90.js";import"./VExpansionPanels-CRDFiEUd.js";import"./VMenu-BxZEtUbH.js";import"./VCheckboxBtn-B2R62I44.js";import"./VAlert-BKHMgC3s.js";import"./VSlider-D6_NZN0T.js";import"./VVirtualScroll-DezxvIhI.js";import"./VChip-BKGA7XXZ.js";import"./VForm-3D0lQdNE.js";import"./VCard-DDEjK8sh.js";import"./VSpacer-BpjLI35r.js";/* empty css              */import"./VDialog-CHkPjb9d.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const j={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},oe=I({__name:"EditPlayer",props:{playerId:{}},setup(P){const b=M(),e=T(),f=P;N(()=>f.playerId,async l=>{l&&(e.value=await a.getPlayerConfig(l))},{immediate:!0});const w=async function(l){l.enabled=e.value.enabled,l.name=e.value.name||null,a.savePlayerConfig(f.playerId,l),b.push({name:"playersettings"})},B=function(){b.push(`/settings/editplayer/${f.playerId}/dsp`)};return(l,t)=>(n(),g("section",null,[y(U,null,{default:d(()=>{var V,_,k;return[e.value&&r(a).getProviderManifest(e.value.provider).domain in r(a).providerManifests?(n(),g("div",j,[y(A,null,{default:d(()=>{var o;return[p(i(l.$t("settings.config_player",[e.value.name||((o=r(a).players[e.value.player_id])==null?void 0:o.name)||e.value.default_name])),1)]}),_:1}),y(v,null,{default:d(()=>[s("b",null,i(l.$t("settings.player_id"))+": ",1),p(i(e.value.player_id),1)]),_:1}),y(v,null,{default:d(()=>{var o,$;return[s("b",null,i(l.$t("settings.player_provider"))+": ",1),p(i((o=r(a).getProviderManifest(e.value.provider))==null?void 0:o.name)+" ",1),($=r(a).getProviderManifest(e.value.provider))!=null&&$.documentation?(n(),g("a",{key:0,onClick:t[0]||(t[0]=z=>{var c;return r(S)((c=r(a).getProviderManifest(e.value.provider))==null?void 0:c.documentation)})}," ["+i(l.$t("settings.check_docs"))+"]",1)):u("",!0)]}),_:1}),r(a).players[e.value.player_id]?(n(),m(v,{key:0},{default:d(()=>[s("b",null,i(l.$t("settings.player_model"))+": ",1),p(i(r(a).players[e.value.player_id].device_info.manufacturer)+" / "+i(r(a).players[e.value.player_id].device_info.model),1)]),_:1})):u("",!0),(V=r(a).players[e.value.player_id])!=null&&V.device_info.ip_address?(n(),m(v,{key:1},{default:d(()=>[s("b",null,i(l.$t("settings.player_address"))+": ",1),p(i(r(a).players[e.value.player_id].device_info.ip_address),1)]),_:1})):u("",!0),r(a).players[e.value.player_id]?(n(),m(v,{key:2},{default:d(()=>[s("b",null,i(l.$t("settings.player_type_label"))+": ",1),p(i(l.$t(`player_type.${r(a).players[e.value.player_id].type}`)),1)]),_:1})):u("",!0),t[3]||(t[3]=s("br",null,null,-1)),y(C),t[4]||(t[4]=s("br",null,null,-1)),t[5]||(t[5]=s("br",null,null,-1)),"name"in e.value?(n(),m(G,{key:3,modelValue:e.value.name,"onUpdate:modelValue":t[1]||(t[1]=o=>e.value.name=o),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?(n(),m(O,{key:4,modelValue:e.value.enabled,"onUpdate:modelValue":t[2]||(t[2]=o=>e.value.enabled=o),label:l.$t("settings.enable_player"),color:"primary",disabled:(k=r(a).getProviderManifest(e.value.provider))==null?void 0:k.builtin},null,8,["modelValue","label","disabled"])):u("",!0),r(a).players[e.value.player_id].type!==r(D).GROUP?(n(),m(R,{key:5,onClick:B},{default:d(()=>[p(i(l.$t("open_dsp_settings")),1)]),_:1})):u("",!0)])):u("",!0),t[6]||(t[6]=s("br",null,null,-1)),y(C),e.value?(n(),m(E,{key:1,disabled:!e.value.enabled,"config-entries":Object.values(e.value.values),onSubmit:w},null,8,["disabled","config-entries"])):u("",!0)]}),_:1})]))}});export{oe as default};
