PageSourceSearch

https://transchinese.org/_next/static/chunks/app/search/page-afa68afef7ea112b.js

js transchinese.org collected 2026-10-02 05:58:25 UTC 14,232 bytes, 1 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[491],{78793:(e,t,r)=>{Promise.resolve().then(r.bind(r,25547))},25547:(e,t,r)=>{"use strict";r.r(t),r.d(t,{default:()=>v});var a=r(57437),s=r(2265),n=r(16463),l=r(63176);let i=[{label:"全部",value:"all"},{label:"小说",value:"novel"}],d=l.Z.map(e=>({name:e.title,value:new URL(e.href||"").host,type:e.type,is_restricted:e.is_restricted})),o=d.map(e=>e.value);function c(e){let{onSearch:t,isSearching:r}=e,[n,l]=(0,s.useState)(""),[c,g]=(0,s.useState)(!1),[x,u]=(0,s.useState)(o),[h,m]=(0,s.useState)("all"),[p,y]=(0,s.useState)(""),[b,f]=(0,s.useState)(""),[v,j]=(0,s.useState)(""),k=e=>{m(e),u("all"===e?o:d.filter(t=>t.type===e).map(e=>e.value))},N=e=>{u(t=>t.includes(e)?t.filter(t=>t!==e):[...t,e])};return(0,a.jsxs)("form",{onSubmit:e=>{e.preventDefault(),t({query:n,domain:x.length?x.join(","):void 0,tag:p||void 0,year:b||void 0,region:v||void 0})},className:"w-full max-w-4xl space-y-4",children:[(0,a.jsx)("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3",children:(0,a.jsx)("div",{className:"flex space-x-1 rounded-lg bg-gray-100 p-1 dark:bg-gray-700 overflow-x-auto",children:i.map(e=>{let{label:t,value:r}=e;return(0,a.jsx)("button",{type:"button",onClick:()=>k(r),className:"rounded-md px-4 py-2 text-sm font-medium transition-colors whitespace-nowrap ".concat(h===r?"bg-white text-blue-600 shadow dark:bg-gray-800 dark:text-blue-400":"text-gray-600 hover:bg-gray-200 dark:text-gray-300 dark:hover:bg-gray-600"),children:t},r)})})}),(0,a.jsxs)("div",{className:"flex flex-col sm:flex-row gap-3",children:[(0,a.jsx)("input",{type:"text",value:n,onChange:e=>l(e.target.value),className:"flex-grow rounded-md border border-gray-300 bg-white  p-3 text-base text-gray-900 placeholder-gray-500 focus:outline-none focus:ring-2 focus:ring-blue-500  disabled:cursor-not-allowed disabled:opacity-60 dark:border-gray-600 dark:bg-gray-800 dark:text-gray-100 dark:placeholder-gray-400 dark:focus:ring-blue-400",placeholder:"请输入搜索关键词",disabled:r}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{type:"button",onClick:()=>g(!c),className:"flex-1 sm:flex-none rounded-md bg-gray-100 px-4 py-3 text-sm text-gray-700 hover:bg-gray-200 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600",children:c?"隐藏筛选":"显示筛选"}),(0,a.jsx)("button",{type:"submit",disabled:r,className:"flex-1 sm:flex-none rounded-md bg-blue-600 px-6 py-3  text-base font-medium text-white transition-colors duration-200 hover:bg-blue-700 disabled:cursor-not-allowed disabled:opacity-60 dark:bg-blue-500 dark:hover:bg-blue-600",children:r?"搜索中...":"搜索"})]})]}
1),c&&(0,a.jsxs)("div",{className:"flex flex-col gap-4 rounded-md border border-gray-200 bg-white p-4 dark:border-gray-700 dark:bg-gray-800",children:[(0,a.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,a.jsx)("label",{htmlFor:"archives",className:"text-sm font-medium text-gray-700 dark:text-gray-200",children:"归档:"}),(0,a.jsx)("div",{className:"flex flex-wrap gap-3",children:d.map(e=>{let{name:t,value:r,type:s}=e;return(0,a.jsxs)("label",{className:"flex items-center gap-2",htmlFor:"domain-".concat(r),children:[(0,a.jsx)("input",{id:"domain-".concat(r),type:"checkbox",checked:x.includes(r),onChange:()=>N(r),className:"rounded border-gray-300 text-blue-600  focus:ring-blue-500 dark:border-gray-600"}),(0,a.jsx)("span",{className:"text-sm ".concat(s===h?"font-medium text-blue-600 dark:text-blue-400":"text-gray-700 dark:text-gray-200"),children:t})]},r)})})]}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("label",{htmlFor:"tag",className:"text-sm font-medium text-gray-700 dark:text-gray-200 min-w-[3rem]",children:"标签:"}),(0,a.jsx)("input",{id:"tag",type:"text",value:p,onChange:e=>y(e.target.value),className:"flex-1 rounded-md border border-gray-300 p-1.5 text-sm dark:border-gray-600 dark:bg-gray-700",placeholder:"标签"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("label",{htmlFor:"year",className:"text-sm font-medium text-gray-700 dark:text-gray-200 min-w-[3rem]",children:"年份:"}),(0,a.jsx)("input",{id:"year",type:"text",value:b,onChange:e=>f(e.target.value),className:"flex-1 rounded-md border border-gray-300 p-1.5 text-sm dark:border-gray-600 dark:bg-gray-700",placeholder:"2024"})]}),(0,a.jsxs)("div",{className:"flex items-center gap-2",children:[(0,a.jsx)("label",{htmlFor:"region",className:"text-sm font-medium text-gray-700 dark:text-gray-200 min-w-[3rem]",children:"地区:"}),(0,a.jsx)("input",{id:"region",type:"text",value:v,onChange:e=>j(e.target.value),className:"flex-1 rounded-md border border-gray-300 p-1.5 text-sm dark:border-gray-600 dark:bg-gray-700",placeholder:"地区"})]})]})]})]})}function g(e){let{result:t,index:r}=e,s=t.url.split("/"),n=s[s.length-1],l=s.slice(3,s.length-1).join("/"),i=(e=>{try{return new URL(e).hostname}catch(e){return"Invalid URL"}})(t.url);return(0,a.jsxs)("li",{className:"border-b border-gray-300 pb-4 dark:border-gray-700",children:[(0,a.jsx)("a",{href:t.url,className:"text-lg font-bold text-blue-600 hover:underline dark:text-blue-400 dark:hover:text-blue-300",children:n}),(0,a.jsx)("p",{className:"text-sm text-gray-600 dark:text-gray-400",children:t.url}),(0,a.jsx)("p",{className:"mt-2 text-sm text-gray-800 dark:text-gray-200",children:t.description}),(0,a.jsxs)("div",{className:"mt-2 text-sm text-gray-600 dark:text-gray-400",children:[(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"dark:text-gray-300",children:"Author:"})," ",t.author]})," ","|",(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"dark:text-gray-300",children:" Date:"})," ",t.date]})," ","|",(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"dark:text-gray-300",children:" Region:"})," ",t.region]})," ","|",(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"dark:text-gray-300",children:" Format:"})," ",t.format]})," ","|",(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"dark:text-gray-300",children:" Size:"})," ",t.size," bytes"]})," ","|",(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"dark:text-gray-300",children:" Tags:"})," ",t.tags.join(", ")]})," ","|",(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"dark:text-gray-300",children:" Path:"})," ",l]})," ","|",(0,a.jsxs)("span",{children:[(0,a.jsx)("strong",{className:"dark:text-gray-300",children:" Domain:"})," ",i]})]}),(0,a.jsxs)("p",{className:"mt-2 text-sm text-gray-600 dark:text-gray-400",children:[(0,a.jsx)("strong",{className:"dark:text-gray-300",children:"Original:"}),t.link.startsWith("http")?(0,a.jsx)("a",{href:t.link,target:"_blank",rel:"noopener noreferrer",className:"text-blue-600 hover:underline dark:text-blue-400 dark:hover:text-blue-300",children:t.link}):"Unknown"]})]},r)}function x(e){let{results:t,error:r}
1=e,[n,l]=(0,s.useState)(1),i=Math.ceil(t.length/20),d=(n-1)*20,o=t.slice(d,d+20);return(0,a.jsxs)("div",{className:"mx-auto w-full max-w-2xl",children:[r&&(0,a.jsx)("p",{className:"text-center text-red-600 dark:text-red-400",children:r}),(0,a.jsxs)("p",{className:"text-center text-gray-600 dark:text-gray-400",children:["Total Results: ",t.length]}),t.length>0&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("ul",{className:"mt-6 space-y-6",children:o.map((e,t)=>(0,a.jsx)(g,{result:e,index:t},t))}),(0,a.jsxs)("div",{className:"mt-6 flex justify-between",children:[(0,a.jsx)("button",{onClick:()=>{n>1&&l(n-1)},disabled:1===n,className:"rounded bg-gray-300 px-4 py-2 text-gray-700  transition-colors duration-200  hover:bg-gray-400 disabled:opacity-50 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600",children:"Previous"}),(0,a.jsxs)("p",{className:"text-gray-600 dark:text-gray-400",children:["Page ",n," of ",i]}),(0,a.jsx)("button",{onClick:()=>{n<i&&l(n+1)},disabled:n===i,className:"rounded bg-gray-300 px-4 py-2 text-gray-700  transition-colors duration-200  hover:bg-gray-400 disabled:opacity-50 dark:bg-gray-700 dark:text-gray-200 dark:hover:bg-gray-600",children:"Next"})]})]})]})}var u=r(84513);let h={"digital.transchinese.org":"/search-index/repo-digital-transchinese-org.json.gz","novel.transchinese.org":"/search-index/repo-novel-transchinese-org.json.gz","comic.transchinese.org":"/search-index/repo-comic-transchinese-org.json.gz","archive.cdtsf.com":"/search-index/repo-archive-cdtsf-com.json.gz","news.transchinese.org":"/search-index/repo-news-transchinese-org.json.gz","enovel.cdtsf.com":"/search-index/repo-enovel-cdtsf-com.json.gz","fnovel.cdtsf.com":"/search-index/repo-fnovel-cdtsf-com.json.gz","snovel.cdtsf.com":"/search-index/repo-snovel-cdtsf-com.json.gz","unovel.transchinese.org":"/search-index/repo-unovel-transchinese-org.json.gz","xnovel.transchinese.org":"/search-index/repo-xnovel-transchinese-org.json.gz"},m={};async function p(e){if(e in m)return m[e];let t=h[e];if(!t)return null;let r=(async()=>{try{let e=await fetch(t),r=await e.arrayBuffer(),a=u.ZP.inflate(new Uint8Array(r),{to:"str
1ing"});return JSON.parse(a)}catch(t){return console.error("Failed to load",e,t),null}})();return m[e]=r,r}async function y(e,t,r,a,s){let n=t?t.split(",").map(e=>e.trim()).filter(Boolean):Object.keys(h),l=e.toLowerCase(),i=[];for(let{domain:e,index:t}of(await Promise.all(n.map(async e=>{let t=await p(e);return{domain:e,index:t}})))){if(i.length>=100)break;if(t)for(let[n,d]of Object.entries(t)){if(i.length>=100)break;let t=n.toLowerCase(),o=(d.description||"").toLowerCase();(!l||t.includes(l)||o.includes(l))&&(!r||d.tags&&d.tags.includes(r))&&(!a||d.date&&d.date.includes(a))&&(s&&d.region!==s||i.push({url:"https://"+e+"/"+n.replace(/\.[^/.]+$/,""),description:d.description||"",tags:d.tags||[],type:d.type||"",author:d.author||"",date:d.date||"",region:d.region||"",format:d.format||"",size:d.size||0,link:"https://"+e+"/"+n.replace(/\.[^/.]+$/,"")}))}}return i}let b=()=>(0,a.jsx)("div",{className:"flex justify-center p-8",children:(0,a.jsx)("div",{className:"animate-pulse",children:"Loading..."})});function f(){let e=(0,n.useRouter)(),t=(0,n.useSearchParams)(),[r,l]=(0,s.useState)(!1),[i,d]=(0,s.useState)(null),[o,g]=(0,s.useState)([]),u=()=>!!(t.get("term")||t.get("domain")||t.get("tag")||t.get("year")||t.get("region")),h=()=>{let e=t.get("term"),r=t.get("domain"),a=t.get("tag"),s=t.get("year"),n=t.get("region");(e||r||a||s||n)&&m({query:e||"",domain:r||void 0,tag:a||void 0,year:s||void 0,region:n||void 0})};(0,s.useEffect)(()=>{u()&&h()},[t]);let m=async t=>{let{query:r,domain:a,tag:s,year:n,region:i}=t;d(null),l(!0),g([]);try{let t=new URLSearchParams({term:r,...a&&{domain:a},...s&&{tag:s},...n&&{year:n},...i&&{region:i}});e.push("?".concat(t.toString()),{scroll:!1});let l=await y(r,a||void 0,s||void 0,n||void 0,i||void 0);g(l)}catch(e){d("Search failed. Please try again.")}finally{l(!1)}};return(0,a.jsxs)("div",{className:"mx-auto max-w-7xl p-8",children:[(0,a.jsxs)("div",{className:"mb-8 rounded-md bg-amber-50 p-4 text-center text-amber-800",children:["更完善的搜索功能请访问 ",(0,a.jsx)("a",{href:"https://tsindex.org",children:"tsindex.org 多元性别搜索引擎"})]}),(0,a.jsxs)("div",{className:"flex flex-col items-center gap-6",children:[(0,a.jsx)("h1",{className:"text-2xl font-bold",children:"条目检索"}),(0,a.jsx)(c,{onSearch:m,isSearching:r,initialValues:{query:t.get("term")||"",domain:t.get("domain")||"",tag:t.get("tag")||"",year:t.get("year")||"",region:t.get("region")||""}}),(0,a.jsx)(x,{results:o,error:i})]})]})}function v(){return(0,a.jsx)(s.Suspense,{fallback:(0,a.jsx)(b,{}),children:(0,a.jsx)(f,{})})}},63176:(e,t,r)=>{"use strict";r.d(t,{Z:()=>n});let a=JSON.parse('[{"name":"跨性别与多元性别新闻网页档案库","description":"保存各类跨性别与多元性别相关的新闻网页存档和相关图片。","path":"https://news.transchinese.org/","url":"https://news.transchinese.org/","is_restricted":false,"type":"resource","size":3883,"last_updated":null},{"name":"跨性别与多元性别文档档案库","description":"保存各类资料、书籍、论文、报告、演示文稿等与跨性别和多元性别相关的独立文件。","path":"https://digital.transchinese.org/","url":"https://digital.transchinese.org/","is_restricted":false,"type":"resource","size":1409,"last_updated":null},{"name":"伪娘与性转相关漫画存档库","description":"保存各类性转相关漫画存档和相关图片。","path":"https://comic.transchinese.org/","url":"https://comic.transchinese.org/","is_restricted":false,"type":"comic","size":3409,"last_updated":null},{"name":"变身文学与小说存档库一(未分类)","description":"保存各类变身、伪娘、性转文学与小说存档,主要关注剧情,按短篇长篇分类。","path":"https://novel.transchinese.org","url":"https://novel.transchinese.org","is_restricted":false,"type":"novel","size":2543,"last_updated":null},{"name":"变身文学与小说存档库二(变百/变嫁)","description":"保存各类变身、伪娘、性转文学与小说存档,按变百或变嫁内容分类,主要关注剧情。可能较老。","path":"https://xnovel.transchinese.org","url":"https://xnovel.transchinese.org","is_restricted":false,"type":"novel","size":1714,"last_updated":null},{"name":"变身文学与小说存档库三(持续更新)","description":"保存各类 CDTS、变身、伪娘、性转文学与变身小说存档,持续更新中。","path":"https://unovel.transchinese.org","url":"https://unovel.transchinese.org","is_restricted":false,"type":"novel","size":894,"last_updated":null}]'),s=a.map(e=>({title:e.name,description:e.description,size:e.size,imgSrc:"/static/images/time-machine.jpg",href:e.url,is_restricted:e.is_restricted,type:e.type}));console.log(a);let n=s},16463:(e,t,r)=>{"use strict";var a=r(71169);r.o(a,"usePathname")&&r.d(t,{usePathname:function(){return a.usePathname}}),r.o(a,"useRouter")&&r.d(t,{useRouter:function(){return a.useRouter}}),r.o(a,"useSearchParams")&&r.d(t,{useSearchParams:function(){return a.useSearchParams}})}},e=>{var t=t=>e(e.s=t);e.O(0,[125,130,215,744],()=>t(78793)),_N_E=e.O()}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.