PageSourceSearch

https://sofurry.com/assets/BrowseResults-B_q-UzY0.js

js sofurry.com collected 2026-09-24 10:38:48 UTC 15,120 bytes, 1 lines download raw bytes

1import{j as t,r as l}from"./vendor-tiptap-D93pKENG.js";import{L as Q,k as W,e as H,a as J}from"./chunk-QUQL4437-gaIRdqWY.js";import{D as K,L as R,T as Y,a as E,S as Z}from"./SubmissionCard-DIzTGc_k.js";import{f as ee}from"./dateFormat-DBDHSVeM.js";import{s as te,S as re}from"./bbcode-BSE40G-J.js";import{G as ae,B as se,M as oe}from"./music-B8F0d5ZD.js";import{V as ne}from"./video-B7xjzf8z.js";import{B as le}from"./book-open-Ck3e-4vi.js";import{C as de}from"./camera-DspOZODW.js";import{F as ce}from"./file-text-DVwDOwQh.js";import{I as q}from"./image-iK-eDQdA.js";import{L as ie}from"./layers-Br6YvhGj.js";import{E as me}from"./eye-C13llpaW.js";import{p as xe}from"./search-query-Bsuh88oK.js";import{A as ue}from"./arrow-up-down-CXJx5RU4.js";import{C as ge}from"./chevron-down-Bn_A-vq_.js";import{L as he}from"./layout-grid-EZs1Bycz.js";import{L as pe}from"./list-CG_BtBDw.js";import{C as fe}from"./chevron-left-K0GUGXoS.js";import{C as we}from"./chevron-right-_wyKjRmN.js";import{L as ve}from"./loader-circle-DUTjyNTE.js";const je={artwork:"bg-primary/90 text-white",story:"bg-accent/90 text-white",music:"bg-[hsl(280_60%_55%/0.9)] text-white",photo:"bg-[hsl(150_50%_45%/0.9)] text-white",comic:"bg-[hsl(350_70%_55%/0.9)] text-white",album:"bg-[hsl(45_80%_50%/0.9)] text-white",video:"bg-[hsl(10_70%_55%/0.9)] text-white","3d":"bg-[hsl(200_70%_55%/0.9)] text-white",game:"bg-[hsl(90_60%_50%/0.9)] text-white"},Ne={artwork:"Artwork",story:"Story",music:"Music",photo:"Photo",comic:"Comic",album:"Album",video:"Video","3d":"3D",game:"Game"},V={artwork:q,story:ce,music:oe,photo:de,comic:le,album:K,video:ne,"3d":se,game:ae},ye=({rating:r,isNsfw:v})=>{const s=r===10,n=r!==void 0?r>=20:!!v;return!s&&!n?null:t.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold shadow-md ${n?"bg-red-600/90 text-white":"bg-amber-500/90 text-white"}`,children:n?"Adult":"Mature"})},Pe=({id:r,title:v,type:s,coverImage:n,coverUrl:x,thumbUrl:D,thumbnailImage:M,authorName:c,authorAvatar:p,timeAgo:I,publishedAt:o,description:j,likes:B,views:L,rating:N,isNsfw:_,isFeatured:f,contentCount:y,wordCount:P,trackCount:b,duration:k,tags:w,activeTags:i})=>{const A=D||M||x||n,S=ee(o)||I,G=(y??0)>1,F=r?`/s/${r}`:void 0,u=s==="music"||s==="album",$=s==="story"&&P?P<200?"< 1 min read":`${Math.ceil(P/200)} min read`:null,U=s==="music"&&k?`${Math.floor(k/60)}:${String(k%60).padStart(2,"0")}`:null,e=j?te(j).trim():"",d=(i!=null&&i.length?[...w??[]].sort((h,O)=>{const z=i.includes(h.toLowerCase()),X=i.includes(O.toLowerCase());return z===X?0:z?-1:1}):w??[]).slice(0,15),g=((w==null?void 0:w.length)??0)-d.length,C=V[s]||q,T=u?"bg-gradient-to-br from-[hsl(280_30%_20%)] to-secondary":s==="story"?"bg-gradient-to-br from-accent/10 to-secondary":"bg-gradient-to-br from-secondary to-muted";return t.jsxs("div",{className:`group w-full relative flex rounded-lg overflow-hidden border bg-card transition-all ${f?"ring-2 ring-primary/50 shadow-[0_0_15px_rgba(var(--primary-rgb,59,130,246),0.5)] hover:shadow-[0_0_25px_rgba(var(--primary-rgb,59,130,246),0.7)] border-primary/30":"border-border hover:border-foreground
1/20"}`,children:[F&&t.jsx(Q,{to:F,className:"absolute inset-0 z-10","aria-label":v}),t.jsxs("div",{className:`flex-shrink-0 relative bg-secondary overflow-hidden w-36 sm:w-44 ${u?"aspect-square":""}`,children:[A?t.jsx("img",{src:A,alt:"",loading:"lazy",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}):t.jsx("div",{className:`w-full h-full flex items-center justify-center ${T}`,children:t.jsx(C,{className:`w-10 h-10 ${u?"text-[hsl(280_60%_55%/0.3)]":s==="story"?"text-accent/25":"text-muted-foreground/20"}`})}),t.jsx("div",{className:"absolute top-2 left-2 z-20",children:t.jsx(ye,{rating:N,isNsfw:_})})]}),t.jsxs("div",{className:"flex-1 min-w-0 px-4 py-3 flex flex-col gap-1.5",children:[t.jsxs("div",{className:"flex items-center gap-2 leading-none",children:[t.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded text-xs font-semibold uppercase tracking-wide shrink-0 ${je[s]??"bg-secondary text-foreground"}`,children:[(()=>{const h=V[s];return h?t.jsx(h,{className:"w-3 h-3"}):null})(),Ne[s]??s]}),G&&t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground/85",children:[t.jsx(ie,{className:"w-3 h-3"}),y," parts"]}),$&&t.jsx("span",{className:"text-xs text-muted-foreground/85",children:$}),s==="album"&&(b??0)>0&&t.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-muted-foreground/85",children:[t.jsx(R,{className:"w-3 h-3"}),b," tracks"]}),U&&t.jsx("span",{className:"text-xs text-muted-foreground/85",children:U}),f&&t.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 rounded bg-primary/90 text-white",children:t.jsx(re,{className:"w-3 h-3 fill-current"})}),t.jsx("time",{dateTime:o,title:o?new Date(o).toLocaleString(void 0,{dateStyle:"long",timeStyle:"short"}):void 0,className:"relative z-20 ml-auto text-xs text-muted-foreground/70 shrink-0 pl-4 cursor-default",children:S})]}),t.jsx("h4",{className:"text-base font-semibold text-foreground truncate group-hover:text-primary transition-colors leading-snug",children:v}),e&&t.jsx("p",{className:"text-sm text-muted-foreground/90 line-clamp-2 leading-relaxed",children:e}),t.jsx("div",{className:"flex-1"}),t.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[p?t.jsx("img",{src:p,alt:c,className:"w-8 h-8 rounded-md flex-shrink-0"}):t.jsx("div",{className:"w-8 h-8 rounded-md bg-muted flex items-center justify-center text-xs text-muted-foreground font-bold flex-shrink-0",children:(c==null?void 0:c[0])||"?"}),t.jsx("span",{className:"text-sm font-medium text-foreground",children:c}),t.jsx("span",{className:"text-muted-foreground/50 select-none mx-0.5",children:"•"}),t.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-muted-foreground/80",children:[t.jsx(Y,{className:"w-3.5 h-3.5"}),E(B??0)]}),t.jsx("span",{className:"text-muted-foreground/50 select-none",children:"•"}),t.jsxs("span",{className:"inline-flex items-center gap-1 text-sm text-muted-foreground/80",children:[t.jsx(me,{className:"w-3.5 h-3.5"}),E(L??0)]})]}),d.length>0&&t.jsxs("div",{className:"relative z-20 flex items-center gap-1.5 flex-wrap pt-0.5",children:[d.map(h=>t.jsx("span",{className:i!=null&&i.includes(h.toLowerCase())?"px-2 py-0.5 rounded text-xs whitespace-nowrap bg-primary/20 text-primary border border-primary/30 font-medium":"px-2 py-0.5 rounded bg-secondary/80 text-xs text-muted-foreground/90 whitespace-nowrap",children:h},h)),g>0&&t.jsxs("span",{className:"text-xs text-muted-foreground/65 whitespace-nowrap",children:["+",g]})]})]})]})},Xe=({submissions:r,sortBy:v,scrollContainerRef:s,onScrollReady:n,paginationMode:x="infinite",showSort:D=!0,maxColumns:M=4})=>{const[c,p]=W(),I=H(),o=J(),j=I.location?new URLSearchParams(I.location.search):c,[B,L]=l.useState(r.data),[N,_]=l.useState(r.currentPage),[f,y]=l.useState(r.lastPage),P=l.useRef(null),b=l.useRef(null),k=l.useRef(r.currentPage).current,w=l.useRef(r.perPage).current;l.useEffect(()=>{if(k<=1||x==="paged"){n==null||n();return}requestAnimationFrame(()=>{const e=s==null?void 0:s.current,a=b.current;if(!e||!a){n==null||n();return}const m=(k-1)*w,d=a.children[m];if(d){const g=e.getBoundingClientRect().top,C=d.getBoundingClientRect().top;e.scrollTop=e.scrollTop+(C-g)}n==null||n()})},[]),l.useEffect(()=>{L(r.data),_(r.currentPage),y(r.lastPage)},[r]),l.useEffect(()=>{var g,C;if(x!=="infinite"||o.state!=="idle"||!((C=(g=o.data)==null?void 0:g.resultsPromise)!=null&&C.submissions)||o.data.resultsPromise.error)return;const{data:e,currentPage:a,lastPage:m}=o.data.resultsPromise.submissions;L(T=>[...T,...e]),_(a),y(m);const d=new URLSearchParams(c);d.set("page",a.toString()),window.history.replaceState(null,"",`?${d.toString()}`)},[o.state,o.data,x]),l.useEffect(()=>{x==="paged"&&(L(r.data),_(r.currentPage),y(r.lastPage))},[x]);const i=l.useCallback(()=>
1{if(o.state!=="idle"||N>=f)return;const e=new URLSearchParams(c);e.set("page",(N+1).toString()),e.set("_json","1"),o.load(`/browse?${e.toString()}`)},[o,N,f,c]),A=l.useRef(i);l.useEffect(()=>{A.current=i},[i]),l.useEffect(()=>{if(x==="paged")return;const e=P.current;if(!e)return;const a=new IntersectionObserver(m=>{m[0].isIntersecting&&A.current()},{root:(s==null?void 0:s.current)??null,rootMargin:"300px"});return a.observe(e),()=>a.disconnect()},[x,s]);const S=e=>{const a=new URLSearchParams(c);a.set("page",e.toString()),p(a,{preventScrollReset:!1})},G=(e,a)=>{if(a<=7)return Array.from({length:a},(d,g)=>g+1);const m=[1];e>3&&m.push("…");for(let d=Math.max(2,e-1);d<=Math.min(a-1,e+1);d++)m.push(d);return e<a-2&&m.push("…"),m.push(a),m},F=e=>{const a=new URLSearchParams(c);a.set("sort_by",e),p(a)},u=j.get("view")==="list"?"list":"grid",$=xe(j.get("q")||"").tags.map(e=>e.toLowerCase()),U=e=>{const a=new URLSearchParams(c);e==="grid"?a.delete("view"):a.set("view","list"),p(a)};return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between gap-3",children:[t.jsx("span",{className:"text-sm text-muted-foreground shrink-0","aria-live":"polite","aria-atomic":"true",children:r.total>0?t.jsxs(t.Fragment,{children:[t.jsxs("span",{className:"font-medium text-foreground",children:[E(r.total),r.total===1e4?"+":""]})," results"]}):"No results"}),t.jsxs("div",{className:"flex items-center gap-2",children:[D&&t.jsxs(t.Fragment,{children:[t.jsxs("div",{className:"relative flex items-center",children:[t.jsx(ue,{className:"pointer-events-none absolute left-2 z-10 w-3 h-3 text-muted-foreground","aria-hidden":"true"}),t.jsx("label",{htmlFor:"browse-sort",className:"sr-only",children:"Sort by"}),t.jsxs("select",{id:"browse-sort",value:j.get("sort_by")||v||"relevance",onChange:e=>F(e.target.value),className:"appearance-none pl-6 pr-6 py-1 rounded-md bg-secondary border border-border text-xs font-medium text-foreground focus:outline-none focus:ring-1 focus:ring-primary cursor-pointer",children:[t.jsx("option",{value:"relevance",children:"Relevance"}),t.jsx("option",{value:"popularity",children:"Popularity"}),t.jsx("option",{value:"latest",children:"Latest"}),t.jsx("option",{value:"views",children:"Views"}),t.jsx("option",{value:"likes",children:"Likes"})]}),t.jsx(ge,{className:"pointer-events-none absolute right-1.5 w-3 h-3 text-muted-foreground","aria-hidden":"true"})]}),t.jsx("div",{className:"h-5 w-px bg-border","aria-hidden":"true"})]}),t.jsxs("div",{className:"flex items-center gap-1",role:"group","aria-label":"View mode",children:[t.jsx("button",{onClick:()=>U("grid"),className:`p-1.5 rounded-md transition-colors ${u==="grid"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-secondary"}`,"aria-label":"Grid view","aria-pressed":u==="grid",children:t.jsx(he,{className:"w-3.5 h-3.5"})}),t.jsx("button",{onClick:()=>U("list"),className:`p-1.5 rounded-md transition-colors ${u==="list"?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-secondary"}`,"aria-label":"List view","aria-pressed":u==="list",children:t.jsx(pe,{className:"w-3.5 h-3.5"})})]})]})]}),r.total>0?u==="list"?t.jsx("div",{ref:b,className:"flex flex-col gap-2",children:B.map((e,a)=>t.jsx(Pe,{id:e.id,title:e.title,type:e.type,coverImage:e.coverImage,coverUrl:e.coverUrl,thumbUrl:e.thumbUrl,thumbnailImage:e.thumbnailImage,authorName:e.authorName,authorAvatar:e.authorAvatar,timeAgo:e.timeAgo,publishedAt:e.publishedAt,description:e.description,likes:e.likes,views:e.views,rating:e.rating,isNsfw:e.isNsfw,isFeatured:e.isFeatured,contentCount:e.contentCount,wordCount:e.wordCount,trackCount:e.trackCount,duration:e.duration,tags:e.tags,activeTags:$},e.id?`${e.id}`:a))}):t.jsx("div",{ref:b,className:`grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 ${M===4?"2xl:grid-cols-4":""} gap-4`,children:B.map((e,a)=>t.jsx(Z,{id:e.id,title:e.title,type:e.type,coverImage:e.coverImage,coverUrl:e.coverUrl,thumbUrl:e.thumbUrl,thumbnailImage:e.thumbnailImage,authorName:e.authorName,authorAvatar:e.authorAvatar,timeAgo:e.timeAgo,publishedAt:e.publishedAt,description:e.description,likes:e.likes,views:e.views,rating:e.rating,isNsfw:e.isNsfw,isFeatured:e.isFeatured,contentCount:e.contentCount,wordCount:e.wordCount,trackCount:e.trackCount,duration:e.duration,tags:e.tags,activeTags:$,variant:"landscape",layout:"grid"},e.id?`${e.id}`:a))}):t.jsx("div",{className:"glass-panel-solid p-12 rounded-lg text-center",children:t.jsxs("div",{className:"max-w-md mx-auto 
1space-y-3",children:[t.jsx("div",{className:"w-16 h-16 mx-auto rounded-full bg-secondary flex items-center justify-center",children:t.jsx("svg",{className:"w-8 h-8 text-muted-foreground",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 21l-6-6m2-5a7 7 0 11-14 0 7 7 0 0114 0z"})})}),t.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"No submissions found"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Try adjusting your filters or search terms to find what you're looking for."}),t.jsx("button",{onClick:()=>{p(new URLSearchParams)},className:"mt-4 px-4 py-2 rounded-md bg-primary text-primary-foreground text-sm font-medium hover:bg-primary/90 transition-colors",children:"Clear all filters"})]})}),r.total>0&&x==="paged"&&r.lastPage>1&&t.jsxs("nav",{"aria-label":"Pagination",className:"flex items-center justify-center gap-1 pt-2 flex-wrap",children:[t.jsx("button",{onClick:()=>S(r.currentPage-1),disabled:r.currentPage<=1,className:"p-1.5 rounded-md text-sm text-muted-foreground hover:text-foreground hover:bg-secondary disabled:opacity-30 disabled:cursor-not-allowed transition-colors","aria-label":"Previous page",children:t.jsx(fe,{className:"w-4 h-4"})}),G(r.currentPage,r.lastPage).map((e,a)=>e==="…"?t.jsx("span",{className:"px-1.5 py-1 text-sm text-muted-foreground select-none",children:"…"},`ellipsis-${a}`):t.jsx("button",{onClick:()=>S(e),"aria-label":`Page ${e}`,"aria-current":e===r.currentPage?"page":void 0,className:`min-w-[2rem] px-2 py-1 rounded-md text-sm font-medium transition-colors ${e===r.currentPage?"bg-primary text-primary-foreground":"text-muted-foreground hover:text-foreground hover:bg-secondary"}`,children:e},e)),t.jsx("button",{onClick:()=>S(r.currentPage+1),disabled:r.currentPage>=r.lastPage,className:"p-1.5 rounded-md text-sm text-muted-foreground hover:text-foreground hover:bg-secondary disabled:opacity-30 disabled:cursor-not-allowed transition-colors","aria-label":"Next page",children:t.jsx(we,{className:"w-4 h-4"})})]}),r.total>0&&x==="infinite"&&t.jsxs(t.Fragment,{children:[t.jsx("div",{ref:P,className:"h-1","aria-hidden":"true"}),o.state!=="idle"&&t.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-sm text-muted-foreground",children:[t.jsx(ve,{className:"w-4 h-4 animate-spin"}),"Loading more…"]}),o.state==="idle"&&N>=f&&f>1&&t.jsxs("p",{className:"text-center text-xs text-muted-foreground/50 py-4",children:["All ",E(r.total)," results loaded"]})]})]})};export{Xe as B};

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.