import{d as G,i as V,N as x,cf as f,$ as l,cj as r,ad as b,c as C,b as s,a as H,u as P,e as q,q as J,w as a,bp as W,o as c,b4 as d,t as m,g as N,aW as B,h as I,F as L,r as D,f as F,b0 as S,V as M,bJ as X}from"./index-BLuBzgcR.js";import{V as Y}from"./VTextField-BRzkPyuL.js";import{a as $}from"./VBtn-i8gedOhv.js";import{a as R}from"./VInput-S8c2HXsf.js";import{_ as K}from"./_plugin-vue_export-helper-DlAUqK2U.js";const Z={class:"filters-container"},Q={class:"d-flex ga-2 filter-buttons"},ee=G({__name:"ProviderFilters",props:{showStageFilter:{type:Boolean,default:!1}},emits:["update:search","update:types","update:stages"],setup(U,{emit:j}){const g=X(),o=W(),v=V(""),n=V([]),u=V([]);let h=null,y=null,_=null;const w=x(()=>[{title:l("settings.musicprovider"),value:f.MUSIC},{title:l("settings.playerprovider"),value:f.PLAYER},{title:l("settings.metadataprovider"),value:f.METADATA},{title:l("settings.pluginprovider"),value:f.PLUGIN}]),O=x(()=>[{title:l("settings.stage.options.stable"),value:r.STABLE},{title:l("settings.stage.options.beta"),value:r.BETA},{title:l("settings.stage.options.alpha"),value:r.ALPHA},{title:l("settings.stage.options.experimental"),value:r.EXPERIMENTAL},{title:l("settings.stage.options.unmaintained"),value:r.UNMAINTAINED},{title:l("settings.stage.options.deprecated"),value:r.DEPRECATED}]),T=j,A=function(t){const e=n.value.indexOf(t);e>-1?n.value.splice(e,1):n.value.push(t)},E=function(t){const e=u.value.indexOf(t);e>-1?u.value.splice(e,1):u.value.push(t)},z=function(){if(o.query.search&&(v.value=o.query.search),o.query.types){const t=o.query.types;n.value=t.split(",")}if(o.query.stages){const t=o.query.stages;u.value=t.split(",")}};return b(v,t=>{T("update:search",t),h&&clearTimeout(h),h=setTimeout(()=>{const e={...o.query};t?e.search=t:delete e.search,g.replace({query:e})},750)}),b(n,t=>{T("update:types",t),y&&clearTimeout(y),y=setTimeout(()=>{const e={...o.query};t.length>0?e.types=t.join(","):delete e.types,g.replace({query:e})},750)},{deep:!0}),b(u,t=>{T("update:stages",t),_&&clearTimeout(_),_=setTimeout(()=>{const e={...o.query};t.length>0?e.stages=t.join(","):delete e.stages,g.replace({query:e})},750)},{deep:!0}),z(),(t,e)=>(c(),C("div",Z,[s(Y,{modelValue:v.value,"onUpdate:modelValue":e[0]||(e[0]=i=>v.value=i),"prepend-inner-icon":"mdi-magnify",label:P(l)("search"),variant:"outlined",density:"compact",clearable:"","hide-details":"",class:"search-field"},null,8,["modelValue","label"]),H("div",Q,[s($,{height:"40",elevation:"0"},{default:a(()=>[d(m(P(l)("sort.provider"))+" ",1),s(N,{end:""},{default:a(()=>[...e[1]||(e[1]=[d("mdi-chevron-down",-1)])]),_:1}),s(B,{activator:"parent","close-on-content-click":!1},{default:a(()=>[s(I,null,{default:a(()=>[(c(!0),C(L,null,D(w.value,(i,p)=>(c(),q(M,{key:p,value:p,onClick:k=>A(i.value)},{append:a(()=>[s(R,{"model-value":n.value.includes(i.value),onClick:S(k=>A(i.value),["stop"])},null,8,["model-value","onClick"])]),default:a(()=>[s(F,null,{default:a(()=>[d(m(i.title),1)]),_:2},1024)]),_:2},1032,["value","onClick"]))),128))]),_:1})]),_:1})]),_:1}),U.showStageFilter?(c(),q($,{key:0,height:"40",elevation:"0"},{default:a(()=>[d(m(P(l)("settings.stage.label"))+" ",1),s(N,{end:""},{default:a(()=>[...e[2]||(e[2]=[d("mdi-chevron-down",-1)])]),_:1}),s(B,{activator:"parent","close-on-content-click":!1},{default:a(()=>[s(I,null,{default:a(()=>[(c(!0),C(L,null,D(O.value,(i,p)=>(c(),q(M,{key:p,value:p,onClick:k=>E(i.value)},{append:a(()=>[s(R,{"model-value":u.value.includes(i.value),onClick:S(k=>E(i.value),["stop"])},null,8,["model-value","onClick"])]),default:a(()=>[s(F,null,{default:a(()=>[d(m(i.title),1)]),_:2},1024)]),_:2},1032,["value","onClick"]))),128))]),_:1})]),_:1})]),_:1})):J("",!0)])]))}}),oe=K(ee,[["__scopeId","data-v-6527ad9f"]]);export{oe as P};
