import{ay as v,J as d,a3 as b,cH as s,cI as S,aT as e,aP as I,cJ as k,az as E,aA as m,o as r,aG as p,aI as h,aB as w,c3 as N,b8 as T,bx as C,aE as V}from"./index-BRUnowC8.js";import{E as q}from"./EditConfig-DaKyuWVG.js";import{D as g}from"./constants-CXMxJR4j.js";import"./VForm-CLH0WxMk.js";import"./VExpansionPanels-CpHWuHN2.js";import"./VDialog-Bh3mGVOy.js";import"./VAlert-DQxypmdN.js";import"./VSwitch-Dcs-7m3i.js";import"./VSelectionControl-Co1cRcmS.js";import"./VSlider-BOibVdD7.js";import"./VSelect-B-WERBOu.js";import"./VVirtualScroll-htzu2YXu.js";import"./VCheckboxBtn-D390s4L9.js";const $=v({__name:"FrontendConfig",setup(A){const f=V(),n=d([]),u=d(!1);b(()=>{const l=localStorage.getItem("frontend.settings.menu_items"),a=l?l.split(","):g,t=[{key:"theme",type:s.STRING,label:"theme",default_value:"auto",required:!1,options:[{title:"auto",value:"auto"},{title:"dark",value:"dark"},{title:"light",value:"light"}],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.theme")},{key:"language",type:s.STRING,label:"language",default_value:"auto",required:!1,options:[{title:"auto",value:"auto"},...S.global.availableLocales.map(o=>({title:o,value:o}))],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.language")},{key:"menu_items",type:s.STRING,label:"menu_items",default_value:g,required:!1,options:[{title:e("home"),value:"home"},{title:e("search"),value:"search"},{title:e("artists"),value:"artists"},{title:e("albums"),value:"albums"},{title:e("tracks"),value:"tracks"},{title:e("playlists"),value:"playlists"},{title:e("audiobooks"),value:"audiobooks"},{title:e("podcasts"),value:"podcasts"},{title:e("radios"),value:"radios"},{title:e("browse"),value:"browse"},{title:e("settings.settings"),value:"settings"}],multi_value:!0,category:"generic",value:a},{key:"force_mobile_layout",type:s.BOOLEAN,label:"force_mobile_layout",default_value:!1,required:!1,multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.force_mobile_layout")==="true"}];if(I.getProvider("sendspin")?.available??!1){t.splice(3,0,{key:"web_player_mode",type:s.STRING,label:"web_player_mode",default_value:"sendspin",required:!1,options:[{title:e("settings.web_player_mode.options.sendspin"),value:"sendspin"},{title:e("settings.web_player_mode.options.disabled"),value:"disabled"}],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.web_player_mode")||"sendspin"});const o=k();t.splice(4,0,{key:"sendspin_sync_delay",type:s.INTEGER,label:"sendspin_sync_delay",default_value:o,required:!1,multi_value:!1,category:"generic",value:parseInt(localStorage.getItem("frontend.settings.sendspin_sync_delay")||String(o),10)});const c=localStorage.getItem("frontend.settings.sendspin_output_latency_compensation");t.splice(5,0,{key:"sendspin_output_latency_compensation",type:s.BOOLEAN,label:"sendspin_output_latency_compensation",default_value:!0,required:!1,multi_value:!1,category:"generic",value:c!==null?c==="true":!0})}n.value=t});const y=async function(l){for(const a in l){const t=`frontend.settings.${a}`,i=l[a];i!=null?localStorage.setItem(t,i.toString()):localStorage.removeItem(t)}f.push({name:"home"}).then(()=>{window.location.reload()})},_=async function(l,a){};return(l,a)=>(m(),E("section",null,[r(N,null,{default:p(()=>[n.value?(m(),h(q,{key:0,"config-entries":n.value,disabled:!1,onSubmit:y,onAction:_},null,8,["config-entries"])):w("",!0)]),_:1}),r(C,{modelValue:u.value,"onUpdate:modelValue":a[0]||(a[0]=t=>u.value=t),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:p(()=>[r(T,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{$ as default};
