import{P as e}from"./semantic-ui-react-m4AAKEby.js";var t=({quietUnavailable:t=!1,username:n})=>{let r=t?`?quietUnavailable=true`:``;return e.get(`/users/${encodeURIComponent(n)}/info${r}`)},n=({username:t})=>e.get(`/users/${encodeURIComponent(t)}/status`),r=({username:t})=>e.get(`/users/${encodeURIComponent(t)}/endpoint`),i=async({username:t})=>{let n=encodeURIComponent(t),r=`/users/${n}/browse/status`,i=`/users/${n}/browse`;if((await e.get(r)).data?.isComplete)return(await e.get(i)).data;await e.post(`/users/${n}/browse/request`);for(let t=0;t<240;t+=1){let t=(await e.get(r)).data,n=String(t?.state||``).toLowerCase();if(t?.isComplete)return(await e.get(i)).data;if(n===`failed`||n===`cancelled`)throw Error(t?.reason||`The remote peer is unavailable`);await new Promise(e=>setTimeout(e,500))}throw Error(`Browse timed out while waiting for the remote peer`)},a=({username:t})=>e.get(`/users/${encodeURIComponent(t)}/browse/status`),o=async({username:t,directory:n})=>(await e.post(`/users/${encodeURIComponent(t)}/directory`,{directory:n})).data,s=({username:t})=>e.get(`/users/${encodeURIComponent(t)}/group`);export{s as a,r as i,a as n,t as o,o as r,n as s,i as t};