import{f as n,m as r,g as c,e as l,ab as p,i,w as f,P as m}from"./app-JmgyQoR0.js";import{b as h,h as u,t as w}from"./vue-y3KLWBaS.js";const d={class:"mk-follow-page"},y=h({__name:"follow",setup(_){async function a(e){const{canceled:s}=await f({type:"question",text:i.t("followConfirm",{name:e.name||e.username})});if(s){window.close();return}m("following/create",{userId:e.id})}const o=new URL(location.href).searchParams.get("acct");if(o==null)throw new Error("acct required");let t;return o.startsWith("https://")?(t=n("ap/show",{uri:o}),t.then(e=>{e.type==="User"?a(e.object):e.type==="Note"?r.push(`/notes/${e.object.id}`):c({type:"error",text:"Not a user"}).then(()=>{window.close()})})):(t=n("users/show",l.parse(o)),t.then(e=>{a(e)})),p(t,null,null,i.ts.fetchingAsApObject),(e,s)=>(u(),w("div",d))}});export{y as default};
