import{t as e}from"./parse-date-BdYTmLpo.mjs";import{t}from"./got-BBDj7u1e.mjs";import{Fragment as n,jsx as r,jsxs as i}from"hono/jsx/jsx-runtime";import{renderToString as a}from"hono/jsx/dom/server";import{raw as o}from"hono/html";const s={0:`动态`,7:`书评`,12:`视频`},c=/<\u2267\u2746>{"name":"(.*?)","uid":"\d+","at":"1"}<\/\u2266\u2746>/g,l=(e=``)=>e.replaceAll(`

`,`</p><p>`).replaceAll(c,` @$1`),u=e=>e?.match(/"url":"(.*?)"/)?.[1],d={path:`/user/:id/:type?`,categories:[`new-media`],example:`/dedao/user/VkA5OqLX4RyGxmZRNBMlwBrDaJQ9og`,parameters:{id:`用户 id，可在对应用户主页 URL 中找到`,type:"类型，见下表，默认为`0`，即动态"},features:{requireConfig:!1,requirePuppeteer:!1,antiCrawler:!1,supportBT:!1,supportPodcast:!1,supportScihub:!1},name:`用户主页`,maintainers:[`nczitzk`],handler:f,description:`| 动态 | 书评 | 视频 |
| ---- | ---- | ---- |
| 0    | 7    | 12   |`};async function f(c){let d=c.req.param(`id`)??``,f=c.req.param(`type`)?Number.parseInt(c.req.param(`type`)):0,p=c.req.query(`limit`)?Number.parseInt(c.req.query(`limit`)):100,m=`https://m.igetget.com`,h=`${m}/native/mine/account#/user/detail?enId=${d}`,g=`${m}/native/api/homePage/topicNote`,_=(await t({method:`post`,url:`${m}/native/api/homePage/userInfo`,json:{hazy:d}})).data,v=_.c.nickname,y=_.c.avatar,b=`${_.c.v_info}: ${_.c.slogan}`,x=(await t({method:`post`,url:g,json:{uid:null,max_id_str:`0`,count:p,max_createtime:0,is_only_repost:0,load_chain:!0,load_tag:1,source:0,note_type:f,only_origin:!1,with_highlight:!0,hazy:d}})).data.c.list.map(t=>({author:v,title:t.content||t.note||t.extra.title,link:t.share_url,pubDate:e(t.create_time*1e3),description:a(i(n,{children:[t.origin_notes_owner.name?i(n,{children:[r(`p`,{children:o(l(t.content))}),r(`br`,{}),i(`p`,{children:[`引用 `,t.origin_notes_owner.name,t.origin_notes_owner.Vinfo?` (${t.origin_notes_owner.Vinfo})`:``,`:`]})]}):null,r(`p`,{children:o(l(t.note))}),t.extra?i(n,{children:[r(`br`,{}),t.extra.img?t.extra.share_ext?r(`a`,{href:t.extra.share_ext.h_5_url,children:i(`figure`,{children:[r(`img`,{src:t.extra.img}),r(`figcaption`,{children:t.extra.title})]})}):i(`figure`,{children:[r(`img`,{src:t.extra.img}),r(`figcaption`,{children:t.extra.title})]}):null,t.extra.images?t.extra.images.map(e=>{let t=u(e);return t?r(`img`,{src:t}):null}):null,t.video.video_cover?(()=>{let e=u(t.video.video_cover);return e?r(`figure`,{children:r(`img`,{src:e})}):null})():null]}):null]}))}));return{title:`${v}的得到主页 - ${s[f]}`,link:h,item:x,image:y,description:b,allowEmpty:!0}}export{d as route};