import{_ as N}from"./Bi1gop6X.js";import{_ as S}from"./BYYLVaSZ.js";import{_ as V}from"./Dd5m_CIq.js";import{d as $,x as F,r as P,c as a,o as n,u as t,y as j,w as h,f as o,i as r,z as g,A as z,F as b,e as s,t as m,n as A}from"./Dih1Xbo1.js";const D=["onClick"],L={key:0,flex:"~ 1 gap2 items-center",truncate:"","of-hidden":""},W=["src","alt"],E={truncate:"",style:{direction:"rtl"},"leading-none":""},I={flex:"~ items-center gap2 justify-between",class:"n-badge","ml-auto":""},O={key:2,"font-mono":""},R={flex:"~ 1 col","of-auto":""},U={truncate:""},q={key:0,flex:"~ items-center gap-2"},G=["src","alt"],H={"font-mono":"","text-xs":"","font-light":""},J={flex:"~ gap1 wrap","pt-2":"","mx--1":""},K=["n","onClick"],M={"font-mono":""},te=$({__name:"SourceSelector",props:{buttonClass:{}},setup(Q){const{currentBase:v,currentSource:i,setCurrentSource:x,sources:y}=z(),{currentProvider:l,providers:k}=F();function u(c){return k.value[c]}const _=P(!1);function C(c,f){x(c,f),_.value=!1}return(c,f)=>{const w=N,p=S,B=V;return n(),a(B,{modelValue:t(_),"onUpdate:modelValue":f[0]||(f[0]=e=>j(_)?_.value=e:null),"content-classes":"w-full mt-1"},{trigger:h(({click:e})=>[o("button",{title:"Filter",flex:"~ gap2",border:"~ base rounded","w-full":"","items-center":"",py1:"","pl2.5":"","pr0.75":"",class:A(c.buttonClass),onClick:d=>e()},[t(i)?(n(),r("div",L,[t(l)?.user?(n(),r("img",{key:0,src:t(l).user.avatar_url,alt:t(l).user.username,class:"of-h h-4 rounded-full min-w-4"},null,8,W)):t(l)?(n(),a(w,{key:1,name:t(l).logo,"min-w4":"",h4:""},null,8,["name"])):s("",!0),o("div",E,m(t(i).displayName),1),o("div",I,[t(i).driver.startsWith("git")?(n(),a(p,{key:0,icon:"i-mdi-source-branch",class:"mb--0.5"})):s("",!0),t(i).driver==="opfs"?(n(),a(p,{key:1,icon:"i-mdi-folder-text",class:"mb--0.5"})):s("",!0),t(v)?(n(),r("div",O,m(t(v).name),1)):s("",!0)])])):s("",!0)],10,D)]),default:h(()=>[o("div",R,[(n(!0),r(b,null,g(t(y),e=>(n(),r("div",{key:e.name,flex:"~ 1 col","of-hidden":"","border-base":"",p2:"",pb3:"","border-b":"",mx2:"","last:border-none":""},[o("div",U,m(e.displayName),1),u(e.provider)?.user?(n(),r("div",q,[o("img",{src:u(e.provider).user.avatar_url,alt:u(e.provider).user.username,class:"of-h h-4 rounded-full w-4"},null,8,G),o("div",H," @"+m(u(e.provider).user.username),1)])):s("",!0),o("div",J,[(n(!0),r(b,null,g(e.bases,d=>(n(),r("button",{key:d.name,flex:"~ items-center gap2 justify-between",class:"n-badge mx0 hover:bg-[rgba(var(--nui-c-context),0.2)]",n:e.name===t(i)?.name&&d.name===t(v)?.name?"green-500 hover:green-600":"hover:text-active",onClick:T=>C(e.name,d.name)},[e.driver.startsWith("git")?(n(),a(p,{key:0,icon:"i-mdi-source-branch"})):s("",!0),e.driver==="opfs"?(n(),a(p,{key:1,icon:"i-mdi-folder-text",class:"mb--0.5"})):s("",!0),o("div",M,m(d.name),1)],8,K))),128))])]))),128))])]),_:1},8,["modelValue"])}}});export{te as _};
