import{Cr as e,Ct as t,E as n,Fn as r,H as i,Mn as a,Nr as o,Pr as s,Tr as c,Yr as l,er as u,fr as d,gr as f,hr as p,jr as m,nr as h,oi as g,pr as _,ri as v,st as y,vr as b,yr as x}from"./KXnyWfWg.js";import"./BPCoDq-Y.js";import"./t5QZyW3e.js";import"./s5alW4sq.js";import"./BjxcM2ra.js";import{t as S}from"./D5iWS3Oc.js";import{n as C,r as w,t as T}from"./80-No0yf.js";import{t as E}from"./bX0gzRkq.js";var D={class:`flex h-full items-center justify-center overflow-y-auto bg-base-100 p-4`},O={class:`animate-spring-up mx-auto w-full max-w-md`},k={class:`mb-8 text-center`},A={class:`mb-4`},j={class:`mx-auto mb-4 flex h-16 w-16 items-center justify-center rounded-box bg-primary/12 text-primary`},M={class:`text-[0.9375rem] text-base-content/80`},N={key:0,class:`mt-6`},P={class:`mb-3 text-[0.8125rem] font-semibold tracking-widest text-base-content/70 uppercase`},F=[`onClick`],I={class:`flex h-7 w-7 shrink-0 items-center justify-center rounded-md bg-base-300 text-base-content/60`},L={class:`flex min-w-0 flex-1 flex-col gap-0.5`},R={class:`flex items-center gap-1.5`},z=[`value`,`placeholder`,`onInput`],B={key:0,class:`overflow-hidden pl-[1.125rem] text-[0.6875rem] text-ellipsis whitespace-nowrap text-base-content/50`},V=[`onClick`],H=c({__name:`setup`,setup(c){let{t:H}=a();u({title:p(()=>H(`setup`))});let U=h(),W=r(),G=l(null);function K(e){W.removeEndpoint(e)}function q(e,t){W.updateEndpoint(e,{label:t})}let J=l(null);return S(J,p({get:()=>W.endpointList,set:e=>W.setEndpointList(e)}),{handle:`.drag-handle`,animation:150,watchElement:!0}),m(async()=>{await G.value?.autoLogin(U.query,{tryDefault:!1})}),(r,a)=>{let c=w,l=C,u=T,p=E;return o(),x(`div`,D,[f(`div`,O,[e(c,{class:`mb-6`}),e(l,{class:`mb-6`}),e(u,{class:`mb-6`}),f(`div`,k,[f(`div`,A,[f(`div`,j,[e(v(i),{size:32})]),a[2]||=f(`h1`,{class:`text-3xl font-bold tracking-wide text-base-content uppercase sm:text-4xl`},[f(`span`,null,`metacube`),f(`span`,{class:`text-base-content/40`},`(`),f(`a`,{class:`text-primary no-underline transition-colors duration-200 hover:text-primary/80`,href:`https://github.com/metacubex/metacubexd`,target:`_blank`},` xd `),f(`span`,{class:`text-base-content/40`},`)`)],-1)]),f(`p`,M,g(v(H)(`setupDescription`)),1)]),e(p,{ref_key:`connectForm`,ref:G,"submit-label":v(H)(`add`)},null,8,[`submit-label`]),v(W).endpointList.length>0?(o(),x(`div`,N,[f(`h3`,P,g(v(H)(`savedEndpoints`)),1),f(`div`,{ref_key:`endpointListRef`,ref:J,class:`flex flex-col gap-3`},[(o(!0),x(_,null,s(v(W).endpointList,r=>(o(),x(`div`,{key:r.id,class:`group flex cursor-pointer items-center gap-2 rounded-xl border border-base-content/10 bg-base-200 p-3 transition-colors duration-200 hover:border-base-content/20 hover:bg-base-300`,onClick:e=>v(G)?.selectEndpoint(r.id)},[e(v(t),{class:`drag-handle shrink-0 cursor-grab text-base-content/30 transition-colors duration-200 hover:text-base-content/60 active:cursor-grabbing`,size:16,onClick:a[0]||=d(()=>{},[`stop`])}),f(`div`,I,[e(v(i),{size:16})]),f(`div`,L,[f(`div`,R,[e(v(y),{class:`shrink-0 text-base-content/30 transition-colors duration-200 group-hover:text-base-content/50`,size:12}),f(`input`,{value:r.label,type:`text`,class:`min-w-0 flex-1 border-none bg-transparent p-0 text-[0.8125rem] font-medium text-base-content transition-colors duration-200 placeholder:text-base-content/60 focus:outline-none`,placeholder:r.url,onClick:a[1]||=d(()=>{},[`stop`]),onInput:e=>q(r.id,e.target.value)},null,40,z)]),r.label?(o(),x(`span`,B,g(r.url),1)):b(``,!0)]),f(`button`,{class:`flex h-6 w-6 shrink-0 cursor-pointer items-center justify-center rounded-full border-none bg-transparent text-base-content/50 transition-all duration-200 hover:bg-error/15 hover:text-error`,onClick:d(e=>K(r.id),[`stop`])},[e(v(n),{size:14})],8,V)],8,F))),128))],512)])):b(``,!0)])])}}});export{H as default};