import{x as I,az as M,r as N,w as S,y as o,D as g,n as p,A as u,I as a,G as t,S as m,J as i,B as s,aR as T,K as d,z as y}from"./index-DuDRe8hE.js";import{E as D}from"./EditConfig-cy0cMyvl.js";import{b as E,V as z,a as v}from"./VCardText-Dn8Yf3BC.js";import{V as C}from"./VList-BlpguAX2.js";import{V as R}from"./VTextField-D5EFKWzi.js";import{V as U}from"./VSwitch--4YJ0kPH.js";import{v as j}from"./VListItem-CuoSvcqW.js";import"./VExpansionPanels-BNWc0M_m.js";import"./VMenu-B49kEbTj.js";import"./VCheckboxBtn-CMIUd74V.js";import"./VAlert-sqJ4UeFM.js";import"./VSlider-BanbeyJ6.js";import"./VVirtualScroll-CdwGYB7u.js";import"./VChip-BRQkwjNJ.js";import"./VForm-COUW7cJR.js";import"./VCard-Cf5RelEw.js";import"./VSpacer-CYzCqmAo.js";/* empty css              */import"./VDialog-BsvLwk-0.js";import"./_plugin-vue_export-helper-DlAUqK2U.js";const A={key:0,style:{"margin-left":"-5px","margin-right":"-5px"}},ne=I({__name:"EditPlayer",props:{playerId:{}},setup(P){const b=M(),e=N(),f=P;S(()=>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,r)=>(o(),g("section",null,[p(E,null,{default:u(()=>{var V,_,k;return[e.value&&t(a).getProviderManifest(e.value.provider).domain in t(a).providerManifests?(o(),g("div",A,[p(z,null,{default:u(()=>{var n;return[m(i(l.$t("settings.config_player",[e.value.name||((n=t(a).players[e.value.player_id])==null?void 0:n.name)||e.value.default_name])),1)]}),_:1}),p(v,null,{default:u(()=>[s("b",null,i(l.$t("settings.player_id"))+": ",1),m(i(e.value.player_id),1)]),_:1}),p(v,null,{default:u(()=>{var n,$;return[s("b",null,i(l.$t("settings.player_provider"))+": ",1),m(i((n=t(a).getProviderManifest(e.value.provider))==null?void 0:n.name)+" ",1),($=t(a).getProviderManifest(e.value.provider))!=null&&$.documentation?(o(),g("a",{key:0,onClick:r[0]||(r[0]=F=>{var c;return t(T)((c=t(a).getProviderManifest(e.value.provider))==null?void 0:c.documentation)})}," ["+i(l.$t("settings.check_docs"))+"]",1)):d("",!0)]}),_:1}),t(a).players[e.value.player_id]?(o(),y(v,{key:0},{default:u(()=>[s("b",null,i(l.$t("settings.player_model"))+": ",1),m(i(t(a).players[e.value.player_id].device_info.manufacturer)+" / "+i(t(a).players[e.value.player_id].device_info.model),1)]),_:1})):d("",!0),(V=t(a).players[e.value.player_id])!=null&&V.device_info.ip_address?(o(),y(v,{key:1},{default:u(()=>[s("b",null,i(l.$t("settings.player_address"))+": ",1),m(i(t(a).players[e.value.player_id].device_info.ip_address),1)]),_:1})):d("",!0),t(a).players[e.value.player_id]?(o(),y(v,{key:2},{default:u(()=>[s("b",null,i(l.$t("settings.player_type_label"))+": ",1),m(i(l.$t(`player_type.${t(a).players[e.value.player_id].type}`)),1)]),_:1})):d("",!0),r[3]||(r[3]=s("br",null,null,-1)),p(C),r[4]||(r[4]=s("br",null,null,-1)),r[5]||(r[5]=s("br",null,null,-1)),"name"in e.value?(o(),y(R,{key:3,modelValue:e.value.name,"onUpdate:modelValue":r[1]||(r[1]=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"])):d("",!0),"enabled"in e.value?(o(),y(U,{key:4,modelValue:e.value.enabled,"onUpdate:modelValue":r[2]||(r[2]=n=>e.value.enabled=n),label:l.$t("settings.enable_player"),color:"primary",disabled:(k=t(a).getProviderManifest(e.value.provider))==null?void 0:k.builtin},null,8,["modelValue","label","disabled"])):d("",!0),p(j,{onClick:B},{default:u(()=>[m(i(l.$t("open_dsp_settings")),1)]),_:1})])):d("",!0),r[6]||(r[6]=s("br",null,null,-1)),p(C),e.value?(o(),y(D,{key:1,disabled:!e.value.enabled,"config-entries":Object.values(e.value.values),onSubmit:w},null,8,["disabled","config-entries"])):d("",!0)]}),_:1})]))}});export{ne as default};
