import{t as e}from"./ofetch-Dl6dVB_5.mjs";import{t}from"./config-BYRrjYC5.mjs";import{t as n}from"./cache-DUthuMSu.mjs";import{t as r}from"./parse-date-BdYTmLpo.mjs";import{t as i}from"./wait-BuBzjYLM.mjs";import a from"xxhash-wasm";const o={path:`/user/:id/:type?`,categories:[`social-media`],example:`/picnob.info/user/xlisa_olivex`,parameters:{id:`Instagram id`,type:{description:`Type of profile page`,default:`posts`,options:[{label:`Posts`,value:`posts`},{label:`Stories`,value:`stories`}]}},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`User Profile - Picnob`,maintainers:[`TonyRL`],handler:u,view:2,url:`picnob.info`},s=(e,t)=>`<video controls poster="${t}"><source src="${e}" type="video/mp4"></video>`,c=e=>`<img src="${e}">`,l=(e,t)=>{let n;switch(e){case`carousel`:n=t.albumItems?.map(e=>e.mediaType===`video`?s(e.videoUrl,e.thumbnailImageUrl):c(e.thumbnailImageUrl)).join(`<br>`);break;case`video`:n=s(t.videoUrl,t.thumbnailImageUrl);break;default:n=c(t.thumbnailImageUrl)}return`${n}<br>${t.text?.replaceAll(`
`,`<br>`)??``}`};async function u(o){let s=`https://picnob.info`,c=o.req.param(`id`),u=o.req.param(`type`)??`posts`,d=`1263fd960207e2d481eff2c60feeae1541f6e90419283f7e674a36d8ac706462`,{h64ToString:f}=await a();if(u!==`posts`&&u!==`stories`)throw Error(`Invalid type parameter. Allowed values are "posts" and "stories".`);let p=await n.tryGet(`picnob.info:pulls:${c}`,async()=>(await e(`${s}/api/v1/pulls`,{headers:{"x-api-key":d},method:`POST`,body:{account:c,type:`all`,isPrivate:!1}})).request_hash,t.cache.routeExpire,!1);for(let t=0;t<10;t++){let n=await e(`${s}/api/v1/pulls/${p}/status`,{headers:{"x-api-key":d}});if(Array.isArray(n)&&n.every(e=>e.status===`success`))break;t<9&&await i(3e3)}let m=await n.tryGet(`picnob.info:profile:${c}`,()=>e(`${s}/api/v1/accounts/${c}/profile`,{headers:{"x-api-key":d}}),t.cache.contentExpire),h=(await n.tryGet(`picnob.info:${u}:${c}`,()=>e(`${s}/api/v1/accounts/${c}/${u}`,{headers:{"x-api-key":d}}),t.cache.routeExpire,!1)).map(e=>({title:e.text?.split(`
`)[0],guid:e.id??f(`${e.account_name}:${e.takenAt}:${e.thumbnailImageUrl}`),author:e.account_name,pubDate:r(e.takenAt),description:l(e.postType??e.mediaType,e)}));return{title:`${m.fullName} (@${c}) ${u===`stories`?`story`:`public`} posts - Picnob`,description:m.biography.replaceAll(`
`,` `),link:`https://www.instagram.com/${c}/`,image:m.profilePicHdImageId??m.profilePicImageId,item:h}}export{o as route};