import{a7 as k,F as m,L as S,cr as s,cs as V,at as e,a8 as I,a9 as c,o,ae as n,aT as d,an as f,ac as g,E as p,ai as C,aa as E,aU as N,au as T,bI as h,aK as B,b9 as q,ad as w}from"./index-CFcIX8RO.js";import{E as x}from"./EditConfig-tTm2yaGt.js";import{D as v}from"./constants-CXMxJR4j.js";import{V as L}from"./VToolbar-B_3_MVxk.js";import"./VForm-D4C74Wdm.js";import"./VExpansionPanels-D5FURIHn.js";import"./VDialog-C2cPU7vi.js";import"./VAlert-DZurr_D6.js";import"./VSwitch-JHKrUQHN.js";import"./VCheckboxBtn-Dy9mjR59.js";import"./VSlider-BVc6Euty.js";import"./VSelect-9ABLzY_9.js";import"./VVirtualScroll-BRrQ8Y7O.js";const J=k({__name:"FrontendConfig",setup(M){const y=w(),r=m([]),i=m(!1);S(()=>{const a=localStorage.getItem("frontend.settings.menu_items"),t=a?a.split(","):v;r.value=[{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"},...V.global.availableLocales.map(l=>({title:l,value:l}))],multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.language")},{key:"menu_items",type:s.STRING,label:"menu_items",default_value:v,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:t},{key:"enable_builtin_player",type:s.BOOLEAN,label:"enable_builtin_player",default_value:!0,required:!0,multi_value:!1,category:"generic",value:localStorage.getItem("frontend.settings.enable_builtin_player")!="false"},{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")!="false"}]});const _=async function(a){for(const t in a){const l=`frontend.settings.${t}`,u=a[t];u!=null?localStorage.setItem(l,u.toString()):localStorage.removeItem(l)}y.push({name:"home"}).then(()=>{window.location.reload()})},b=async function(a,t){};return(a,t)=>(c(),I("section",null,[o(L,{color:"transparent"},{title:n(()=>[d(f(g(e)("settings.frontend")),1)]),_:1}),o(h,null,{default:n(()=>[o(N,null,{default:n(()=>[d(f(g(e)("settings.frontend_desc")),1)]),_:1}),t[1]||(t[1]=p("br",null,null,-1)),t[2]||(t[2]=p("br",null,null,-1)),o(T),r.value?(c(),C(x,{key:0,"config-entries":r.value,disabled:!1,onSubmit:_,onAction:b},null,8,["config-entries"])):E("",!0)]),_:1}),o(q,{modelValue:i.value,"onUpdate:modelValue":t[0]||(t[0]=l=>i.value=l),scrim:"true",persistent:"",style:{display:"flex","align-items":"center","justify-content":"center"}},{default:n(()=>[o(B,{indeterminate:"",size:"64",color:"primary"})]),_:1},8,["modelValue"])]))}});export{J as default};
