import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{parse as t}from"tldts";const n={name:`User subscriptions`,categories:[`social-media`],path:`/profile/:uid`,example:`/follow/profile/41279032429549568`,parameters:{uid:`User ID or user handle`},radar:[{source:[`app.follow.is/profile/:uid`],target:`/profile/:uid`}],handler:o,maintainers:[`KarasuShin`,`DIYgod`,`DFobain`],features:{supportRadar:!0},view:5},r=e=>`lists`in e,i=e=>`inboxId`in e,a=e=>`feeds`in e;async function o(t){let n=t.req.param(`uid`),o=`https://api.follow.is`,l=c(n||``)?n:n.startsWith(`@`)?n.slice(1):n,u=new URLSearchParams({handle:l});c(l||``)&&u.append(`id`,l);let d=await e(`${o}/profiles?${u.toString()}`),f=await e(`${o}/subscriptions?userId=${d.data.id}`);return{title:`${d.data.name}'s subscriptions`,item:f.data.filter(e=>!i(e)&&!(a(e)&&e.feeds.errorAt)).map(e=>r(e)?{title:e.lists.title,description:e.lists.description,link:`https://app.follow.is/list/${e.listId}`,image:e.lists.image}:{title:e.feeds.title,description:e.feeds.description,link:`https://app.follow.is/feed/${e.feedId}`,image:s(e.feeds.siteUrl).src,category:e.category?[e.category]:void 0}),link:`https://app.follow.is/share/users/${n}`,image:d.data.image}}const s=(e,n)=>{let r,i=``;try{let{host:a}=new URL(e),o=t(a).domainWithoutSuffix;i=`https://avatar.vercel.sh/${o}.svg?text=${o?.slice(0,2).toUpperCase()}`,r=`https://unavatar.follow.is/${a}?fallback=${n||!1}`}catch{let n=t(e).domainWithoutSuffix;r=`https://avatar.vercel.sh/${n}.svg?text=${n?.slice(0,2).toUpperCase()}`}return{src:r,fallbackUrl:i}},c=e=>{if(!e||!/^\d{13,19}$/.test(e))return!1;let t=BigInt(e),n=(t>>63n-41n)+1712546615000n,r=new Date(Number(n));return r.getFullYear()>=2024&&r.getFullYear()<=2050&&t<=(1n<<63n)-1n};export{c as isBizId,n as route};