PageSourceSearch

https://www.aipictors.com/assets/route273.js

js aipictors.com collected 2026-09-24 09:42:02 UTC 92,785 bytes, 249 lines download raw bytes

1import{r as d,j as e,a as pt}from"./jsx-runtime.js";import{t as A}from"./gql-tada.js";import{A as jt}from"./app-animated-tabs.js";import{A as wt}from"./app-loading-page.js";import{C as ss}from"./cross-platform-tooltip.js";import{B as v}from"./button.js";import{C as Nt}from"./checkbox.js";import{S as Ue,a as Re,b as _e,c as He,d as Q}from"./select.js";import{S as vt}from"./separator.js";import{S as M}from"./skeleton.js";import{T as bt,c as Me}from"./tabs.js";import{u as yt,S as be,W as kt}from"./use-work-dialog-url.js";import{c as Ve,M as Pt}from"./config.js";import{A as se}from"./auth-context.js";import{u as Wt}from"./use-locale.js";import{u as V}from"./use-translation.js";import{u as Ct}from"./use-update-query-params.js";import{u as Fe}from"./index6.js";import{L as pe}from"./like-button.js";import{a as os,O as It,A as St,N as Ee}from"./embla-carousel-autoplay.esm.js";import{R as ls}from"./responsive-pagination.js";import{P as ds,R as As}from"./responsive-photo-works-album.js";import{A as me,a as je,b as ue}from"./avatar.js";import{C as Ie,b as Se,a as Te,c as ks}from"./card.js";import{I as Tt}from"./input.js";import{c as re}from"./utils.js";import{u as $s}from"./use-infinite-scroll.js";import{u as Us}from"./use-paged-infinite.js";import{u as Ge}from"./use-scroll-restoration.js";import{C as Rs,W as _s}from"./work-comment-list.js";import{t as Hs}from"./to-date-time-text.js";import{w as ie}from"./with-icon-url-fallback.js";import{c as Be}from"./index3.js";import{X as Lt}from"./x.js";import{L as W,u as At}from"./components.js";import{P as Ms}from"./plus.js";import{L as we}from"./loader-circle.js";import{M as cs}from"./message-circle.js";import{u as Fs}from"./useSuspenseQuery.js";import{u as ts}from"./useMutation.js";import{b as J}from"./useQuery.js";import{u as Es}from"./index27.js";import{C as ms,O as Ps,W as $t}from"./cropped-work-square.js";import{U as Ut}from"./user-name-badge.js";import{C as Os,a as zs,b as as,c as Rt,d as _t}from"./carousel.js";import{H as Ds}from"./heart.js";import{a as Ht,H as Mt}from"./home-award-works.js";import{b as Ft,a as Et,d as Ot,A as zt}from"./works-pagination-mode.js";import{H as us,a as Vs}from"./home-video-works-section.js";import{H as xs,a as Gs}from"./home-novels-works-section.js";import{c as Le,H as hs,a as Dt,b as Vt}from"./home-work-section.js";import{u as Bs}from"./index.js";import{T as Gt}from"./triangle-alert.js";import{C as ns}from"./chevron-right.js";import{a as Bt,H as Qt}from"./home-new-comments.js";import{B as rs}from"./badge.js";import{R as qt}from"./release-tag-badge.js";import{P as Kt,F as Yt}from"./support-coin-icons.js";import{S as Ws}from"./support-rank-avatar.js";import{T as Jt}from"./trophy.js";import{H as Xt}from"./home-tag-list.js";import{T as Zt,a as ea,b as sa,c as ta}from"./tooltip.js";import{K as aa}from"./index8.js";import{S as na,R as ra}from"./rows.js";import{U as Qs}from"./user-avatar-with-frame.js";import{I as ia}from"./image.js";import{I as oa}from"./images.js";import{H as la,a as da}from"./home-works-tag-section.js";import{H as ca}from"./home-works-users-recommended-section.js";import{c as ma}from"./create-meta.js";import{t as ua}from"./to-work-type-text.js";import{M as xa}from"./minus.js";import{L as Oe}from"./list.js";import{E as ye}from"./external-link.js";const de=32;function Cs(s,a){const t=[];for(let n=0;n<s.length;n+=a)t.push(s.slice(n,n+a));return t}const ha=A(`
2  fragment PartialWorkFields on WorkNode @_unmask {
3    id
4    title
5    largeThumbnailImageURL
6    description
7    tagNames
8    isLiked
9    likesCount
10    createdAt
11    commentsCount
12    isCommentsEditable
13    user {
14      id
15      name
16      login
17      iconUrl
18    }
19    subWorks {
20      imageUrl
21    }
22  }
23`),fa=A(`
24  query FollowedTagsPreview($limit: Int!) {
25    viewer {
26      id
27      followingTags(offset: 0, limit: $limit) {
28        id
29        name
30      }
31    }
32  }
33`),ga=A(`mutation UnFollowTag($input: UnfollowTagInput!) {
34    unfollowTag(input: $input)
35  }`),pa=A(`mutation FollowTag($input: FollowTagInput!) {
36    followTag(input: $input)
37  }`),qs=A(`query TagFeed(
38    $limit: Int!
39    $offset: Int!
40    $feedWhere: FeedWhereInput!
41    $feedPostsWhere: FeedPostsWhereInput
42  ) {
43    feed(where: $feedWhere) {
44      posts(limit: $limit, offset: $offset, where: $feedPostsWhere) {
45        id
46        work {
47          ...PartialWorkFields
48          comments(offset: 0, limit: 128) {
49            ...Comment
50          }
51        }
52      }
53    }
54  }`,[Rs,ha]),Ks=A(`query TagFeedWorkList(
55    $limit: Int!
56    $offset: Int!
57    $feedWhere: FeedWhereInput!
58    $feedPostsWhere: FeedPostsWhereInput
59  ) {
60    feed(where: $feedWhere) {
61      posts(limit: $limit, offset: $offset, where: $feedPostsWhere) {
62        id
63        work {
64          ...PhotoAlbumWork
65        }
66      }
67    }
68  }`,[ds]);function ja({_tab:s,page:a,setPage:t,isPagination:n,onSelect:i,updateWorks:o}){var te;
68const l=Be(),c=V(),[m,k]=os(),[h,u]=d.useState(0),[g,N]=d.useState(!1),[p,x]=d.useState(""),f=d.useRef(null),{data:C,refetch:y}=Fs(fa,{variables:{limit:6}}),$=((te=C==null?void 0:C.viewer)==null?void 0:te.followingTags)??[],I=$.slice(0,5),S=$.length>5,G=`follow-tags-${n}-${h}`,[F,{loading:T}]=ts(ga),[_,{loading:z}]=ts(pa),E=d.useCallback(async L=>{try{await F({variables:{input:{tagName:L}}}),await y(),t(0),u(U=>U+1),Fe(c("タグを削除しました","Tag removed"))}catch(U){console.error(U),U instanceof Error&&Fe(U.message)}},[y,t,c,F]),Z=d.useCallback(()=>{N(L=>{const U=!L;return U&&window.setTimeout(()=>{const K=f.current;K&&(K.scrollIntoView({behavior:"smooth",block:"center"}),K.focus())},0),U})},[]),R=d.useCallback(async()=>{const L=p.trim();if(L)try{await _({variables:{input:{tagName:L}}}),x(""),N(!1),await y(),t(0),u(U=>U+1),Fe(c("タグを追加しました","Tag added"))}catch(U){console.error(U),U instanceof Error&&Fe(U.message)}},[p,_,y,t,c]);return e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"mb-4 flex justify-end space-x-2",children:[e.jsx(v,{onClick:()=>l("/settings/followed/tags"),variant:"secondary",children:c("管理","Manage")}),e.jsx(v,{onClick:()=>k(!m),children:m?c("一覧表示","List"):c("カード表示","Cards")})]}),e.jsxs("div",{className:"relative z-10 flex flex-wrap items-center gap-2",children:[I.map(L=>e.jsxs("div",{className:"inline-flex h-9 items-center rounded-full bg-secondary text-secondary-foreground",children:[e.jsx("button",{type:"button",className:re("ml-1 inline-flex size-7 cursor-pointer items-center justify-center rounded-full transition-colors","hover:bg-secondary/80 disabled:pointer-events-none disabled:opacity-50"),onClick:U=>{U.preventDefault(),U.stopPropagation(),E(L.name)},disabled:T,"aria-label":c("タグを削除","Remove tag"),children:e.jsx(Lt,{className:"size-4"})}),e.jsx(W,{to:`/tags/${L.name}`,className:"px-3 font-medium text-sm",children:L.name})]},L.id)),e.jsx(v,{type:"button",variant:"secondary",size:"icon",className:"relative z-10 cursor-pointer rounded-full",onClick:L=>{L.preventDefault(),L.stopPropagation(),Z()},"aria-label":c("タグを追加","Add tag"),children:e.jsx(Ms,{className:"size-4"})}),S&&e.jsx("span",{className:"text-sm",children:"…"})]}),g&&e.jsxs("div",{className:"flex items-start gap-x-2",children:[e.jsx("div",{className:"flex-1",children:e.jsx(Tt,{ref:f,className:"w-full rounded-full",type:"text",value:p,onChange:L=>x(L.target.value),placeholder:c("タグ","Tag"),maxLength:40})}),e.jsx(v,{type:"button",variant:"secondary",className:"rounded-full",onClick:R,disabled:z||p.trim().length===0,children:c("追加","Add")})]}),e.jsx("p",{className:"text-muted-foreground text-xs",children:c("フォロータグを変更した後に投稿された作品から、この一覧に反映されます","New posts after changing followed tags will appear in this list.")}),n?e.jsx(wa,{_tab:s,page:a,setPage:t,isTimelineView:m,setIsTimelineView:k,onSelect:i,updateWorks:o},G):e.jsx(Na,{_tab:s,isTimelineView:m,setIsTimelineView:k,onSelect:i,updateWorks:o},G)]})}function wa({_tab:s,page:a,setPage:t,isTimelineView:n,setIsTimelineView:i,onSelect:o,updateWorks:l}){var f,C;const c=d.useContext(se);V();const[m,k]=d.useState(""),h=a*de,{data:u,loading:g,refetch:N}=J(n?qs:Ks,{skip:c.isLoading||c.isNotLoggedIn,variables:{limit:de,offset:h,feedWhere:{userId:c.userId??"-1",type:"FOLLOW_TAG"},feedPostsWhere:{ratings:["G","R15"]}},fetchPolicy:"cache-and-network",errorPolicy:"ignore"}),p=((f=u==null?void 0:u.feed)==null?void 0:f.posts)??[];Ge("follow-tag-pagination",!!p.length);const x=y=>{t(y),N({offset:y*de})};return d.useEffect(()=>{var $;if(!l||!(($=u==null?void 0:u.feed)!=null&&$.posts)||n)return;const y=`${a}-${u.feed.posts.length}-${u.feed.posts.map(I=>I.id).join(",")}`;if(y!==m){const I=u.feed.posts.map(S=>S.work).filter(S=>!!S);l(I),k(y)}},[(C=u==null?void 0:u.feed)==null?void 0:C.posts,l,a,n,m,s]),c.isLoading?e.jsx(De,{}):c.isNotLoggedIn||!c.userId?e.jsx(Js,{}):!g&&p.length===0?e.jsx(Xs,{}):e.jsxs(e.Fragment,{children:[e.jsx(Ys,{posts:p,isTimelineView:n,setIsTimelineView:i,onSelect:o}),e.jsx("div",{className:"h-8"}),e.jsx("div",{className:"-translate-x-1/2 fixed bottom-0 left-1/2 z-10 w-full border-border/40 bg-background/95 p-2 backdrop-blur-sm supports-backdrop-filter:bg-background/80",children:e.jsx(ls,{perPage:de,maxCount:1e3,currentPage:a,onPageChange:x})})]})}function Na({_tab:s,isTimelineView:a,setIsTimelineView:t,onSelect:n,updateWorks:i}){var U,K,q,ce;const o=Es(),l=d.useContext(se),[c,m]=d.useState(!1),[k,h]=d.useState(0),u=d.useMemo(()=>({userId:l.userId??"-1",type:"FOLLOW_TAG"}),[l.userId]),g={ratings:["G","R15"]},N={limit:de,offset:0,feedWhere:u,feedPostsWhere:g},p=a?qs:Ks,x=d.useMemo(()=>{var b,j;if(l.isLoading||l.isNotLoggedIn)return[];try{const O=o.readQuery({query:p,variables:N});return(j=(b=O==null?void 0:O.feed)==null?void 0:b.posts)!=null&&j.length?Cs(O.feed.posts,de):[]}catch{return[]}},[o,p,N,l.isLoading,l.isNotLoggedIn]),{data:f,fetchMore:C,loading:y}=J(p,{skip:l.isLoading||l.isNotLoggedIn,variables:N,fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",errorPolicy:"ignore"}),$=JSON.stringify({tv:a,uid:l.userId,ratings:g.ratings.join("-")}),{pages:I,appendPage:S,appendPages:G,replaceFirstPage:F,flat:T}=Us(x,$),_=d.useRef("");d.useEffect(()=>{var P;const b=(P=f==null?void 0:f.feed)==null?void 0:P.posts;if(!(b!=null&&b.length))return;const j=Cs(b,de),O=j[0].map(B=>B.id).join(",");O!==_.current&&(F(j[0]),j.length>1&&G(j.slice(1)),_.current=O)},[(U=f==null?void 0:f.feed)==null?void 0:U.posts,F,G]),d.useMemo(()=>T.map(b=>
68b.work).filter(Boolean),[T]);const z=d.useMemo(()=>T.map(b=>b.work).filter(Boolean),[T]),E=d.useRef("");d.useEffect(()=>{if(!i||a||z.length===0)return;const b=z.map(j=>j.id).join(",");b!==E.current&&(i(z),E.current=b)},[i,a,z]);const Z=x.length>0||!!((q=(K=f==null?void 0:f.feed)==null?void 0:K.posts)!=null&&q.length);Ge("follow-tag-infinite",Z);const R=(((ce=I.at(-1))==null?void 0:ce.length)??0)>=de-8,te=d.useCallback(async()=>{var b,j;if(!(!R||y||c)){m(!0);try{const P=(j=(b=(await C({variables:{...N,offset:T.length}})).data)==null?void 0:b.feed)==null?void 0:j.posts;P!=null&&P.length&&S(P)}finally{m(!1)}}},[R,y,c,C,N,T.length,S]),L=$s(te,{hasNext:R,loading:y});return l.isLoading?e.jsx(De,{}):l.isNotLoggedIn||!l.userId?e.jsx(Js,{}):!y&&T.length===0?e.jsx(Xs,{}):e.jsxs("div",{className:"space-y-8",children:[I.map((b,j)=>e.jsxs("div",{className:"w-full",children:[e.jsx(Ys,{posts:b,isTimelineView:a,setIsTimelineView:t,onSelect:n}),j<I.length-1&&!a&&e.jsx("div",{className:"mt-8 border-muted/20 border-t"})]},j.toString())),c&&e.jsx(De,{}),R&&e.jsx("div",{ref:L,style:{height:1}})]})}function Ys({posts:s,isTimelineView:a,setIsTimelineView:t,onSelect:n}){const i=V(),[o,l]=d.useState({}),[c,m]=d.useState({}),k=s.filter(g=>!!g.work).map(g=>g.work);if(k.length===0)return null;const h=g=>l(N=>({...N,[g]:!N[g]})),u=g=>m(N=>({...N,[g]:!N[g]}));return a?e.jsx(va,{works:k,t:i,hiddenComments:o,subWorksVisible:c,toggleCommentsVisibility:h,toggleSubWorksVisibility:u,onSelect:n,index:s.findIndex(g=>{var N;return((N=g.work)==null?void 0:N.id)===k[0].id})??0}):e.jsx(ba,{works:k,onSelect:n})}function va({works:s,t:a,hiddenComments:t,subWorksVisible:n,toggleCommentsVisibility:i,toggleSubWorksVisibility:o,onSelect:l,index:c}){return e.jsx("div",{className:"m-auto w-full space-y-4",children:s.map(m=>{var k,h,u,g,N,p,x,f;return e.jsxs(Ie,{className:"rounded-lg border",children:[e.jsx(Se,{className:"m-auto flex max-w-[1200px] justify-start",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(me,{children:[e.jsx(je,{className:"rounded-full",src:ie((k=m.user)==null?void 0:k.iconUrl),alt:""}),e.jsx(ue,{})]}),e.jsxs(W,{to:`/users/${(h=m.user)==null?void 0:h.login}`,className:"flex items-center space-x-2",children:[e.jsx("div",{className:"font-semibold text-md",children:(u=m.user)==null?void 0:u.name}),e.jsxs("div",{className:"text-sm",children:["@",(g=m.user)==null?void 0:g.login]})]})]})}),e.jsx(Te,{className:"m-auto max-w-[1200px]",children:e.jsx(d.Suspense,{fallback:e.jsx(De,{}),children:e.jsxs("div",{className:"w-full md:flex md:space-x-8",children:[e.jsxs("div",{className:"space-y-2 md:w-1/2 md:max-w-[560px]",children:[e.jsxs("div",{className:"relative",children:[e.jsx(W,{to:`/posts/${m.id}`,children:e.jsx("img",{src:m.largeThumbnailImageURL,alt:m.title,className:"w-full rounded-md"})}),l?e.jsx("button",{type:"button",className:"block h-full w-full overflow-hidden rounded",onClick:()=>l==null?void 0:l(m.id),children:e.jsx(W,{to:`/posts/${m.id}`,children:e.jsx("img",{src:m.largeThumbnailImageURL,alt:m.title,className:"w-full rounded-md"})})}):e.jsx(W,{to:`/posts/${m.id}`,children:e.jsx("img",{src:m.largeThumbnailImageURL,alt:m.title,className:"w-full rounded-md"})}),(N=m.subWorks)!=null&&N.length?e.jsxs(e.Fragment,{children:[!n[m.id]&&e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-16 rounded-b-md bg-gradient-to-t from-black/80 to-transparent"}),e.jsx(v,{className:"-translate-x-1/2 absolute bottom-2 left-1/2 transform rounded-full opacity-80",variant:"secondary",onClick:()=>o(m.id),children:n[m.id]?a("閉じる","Close"):a(`もっと見る(${m.subWorks.length})`,`Show More (${m.subWorks.length})`)}),n[m.id]&&m.subWorks.map((C,y)=>C.imageUrl&&e.jsx(W,{to:`/posts/${m.id}`,children:e.jsx("img",{src:C.imageUrl,alt:m.title,className:"w-full rounded-md"})},y.toString()))]}):null]}),e.jsx("div",{className:"font-semibold text-md",children:m.title}),e.jsx("div",{children:m.description}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx(pe,{size:40,text:a("いいね","Like"),targetWorkId:m.id,targetWorkOwnerUserId:((p=m.user)==null?void 0:p.id)??"",defaultLiked:m.isLiked,defaultLikedCount:m.likesCount,isBackgroun
68dNone:!1,strokeWidth:2}),e.jsxs(v,{variant:"secondary",className:"flex items-center space-x-1",onClick:()=>i(m.id),children:[e.jsx(cs,{className:"size-5"}),e.jsx("span",{children:m.commentsCount})]})]}),e.jsx("div",{className:"flex flex-wrap gap-x-4",children:(x=m.tagNames)==null?void 0:x.map(C=>e.jsx(W,{to:`/tags/${C}`,className:"p-0",children:e.jsx(v,{variant:"link",className:"p-0",children:C})},C))}),e.jsx("div",{className:"text-sm",children:m.createdAt?Hs(m.createdAt):""})]}),e.jsx("div",{className:re(t[m.id]?"block":"hidden","w-full overflow-y-auto md:block"),children:m.isCommentsEditable&&m.comments&&e.jsx(_s,{workId:m.id,comments:m.comments,defaultShowCommentCount:3,workOwnerIconImageURL:(f=m.user)==null?void 0:f.iconUrl})})]})})})]},m.id)})})}function ba({works:s,onSelect:a}){if(typeof window<"u"&&window.innerWidth<768){const n=s.map(i=>{var o,l,c;return{id:i.id,title:i.title,imageUrl:i.largeThumbnailImageURL,width:300,height:200,userId:(o=i.user)==null?void 0:o.id,userName:(l=i.user)==null?void 0:l.name,userIcon:((c=i.user)==null?void 0:c.iconUrl)??void 0}});return e.jsx("div",{className:"m-auto w-full space-y-4",children:e.jsx(It,{works:n,onWorkClick:a,gridCols:3,itemHeight:180})})}return e.jsx("div",{className:"m-auto w-full space-y-4",children:e.jsx(As,{works:s,size:"large",isShowProfile:!0,autoPlayVideoPreview:!0,onSelect:a})})}function De(){return e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(we,{className:"size-8 animate-spin text-border"})})}function Js(){const s=V();return e.jsx("div",{className:"flex h-64 items-center justify-center",children:e.jsx("p",{className:"text-center",children:s("ログインすることでユーザやタグをフォローして、タイムラインで作品を楽しむことができます","You can enjoy works on the timeline by following users and tags by logging in")})})}function Xs(){const s=V();return e.jsx("div",{className:"flex h-64 items-center justify-center",children:e.jsx("p",{className:"text-center",children:s("まだデータがありません、ユーザやタグをフォローして最新の作品をキャッチアップしましょう!","No data yet, follow users and tags to catch up on the latest works!")})})}const ne=32;function Is(s,a){const t=[];for(let n=0;n<s.length;n+=a)t.push(s.slice(n,n+a));return t}function ya(s){const[a,t]=d.useState(s.isPagination??!1);d.useEffect(()=>{s.isPagination!==void 0&&s.isPagination!==a&&t(s.isPagination)},[s.isPagination,a]);const n=`follow-user-${a}`;return e.jsx("div",{className:"space-y-4",children:a?e.jsx(ka,{...s},n):e.jsx(Pa,{...s},n)})}function ka(s){var f,C;const a=d.useContext(se),t=Be(),n=V(),[i,o]=d.useState(""),[l,c]=os(),m=s.page??0,k=s.setPage??(()=>{}),h=ne*m,{data:u,loading:g,refetch:N}=J(l?et:st,{skip:a.isLoading||a.isNotLoggedIn,variables:{offset:h,limit:ne,feedWhere:{userId:a.userId??"-1",type:"FOLLOW_USER"},feedPostsWhere:{ratings:["G","R15"]}},fetchPolicy:"cache-and-network",errorPolicy:"ignore"}),p=((f=u==null?void 0:u.feed)==null?void 0:f.posts)??[];Ge("follow-user-pagination",!!p.length);const x=y=>{k(y),N({offset:y*ne,limit:ne,feedWhere:{userId:a.userId??"-1",type:"FOLLOW_USER"},feedPostsWhere:{ratings:["G","R15"]}})};return d.useEffect(()=>{var $;if(!s.updateWorks||!(($=u==null?void 0:u.feed)!=null&&$.posts)||l)return;const y=`${m}-${u.feed.posts.length}-${u.feed.posts.map(I=>I.id).join(",")}`;if(y!==i){const I=u.feed.posts.map(S=>S.work).filter(S=>!!S);s.updateWorks(I),o(y)}},[(C=u==null?void 0:u.feed)==null?void 0:C.posts,s.updateWorks,m,l,i,s.tab]),a.isLoading?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(we,{className:"size-8 animate-spin text-border"})}):a.isNotLoggedIn||a.userId===void 0||!a.userId?e.jsx("div",{className:"flex h-64 items-center justify-center",children:e.jsx("p",{className:"text-center",children:n("ログインすることでユーザやタグをフォローして、タイムラインで作品を楽しむことができます","You can enjoy works on the timeline by following users and tags by logging in")})}):p.length===0&&!g?e.jsx("div",{className:"flex h-64 items-center justify-center",children:e.jsx("p",{className:"text-center",children:n("まだデータがありません、ユーザやタグをフォローして最新の作品をキャッチアップしましょう!","No data yet, follow users and tags to catch up on the latest works!")})}):e.jsxs("div",{className:"space-y-4",children:[g&&p.length===0?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(we,{className:"size-8 animate-spin text-border"})}):e.jsx(Zs,{posts:p,isTimelineView:l,setIsTimelineView:c,navigate:t,t:n,_isPagination:!0,onSelect:s.onSelect}),p.length>0&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"h-8"}),e.jsx("div",{className:"-translate-x-1/2 fixed bottom-0 left-1/2 z-10 w-full border-border/40 bg-background/95 p-2 backdrop-blur-sm supports-backdrop-filter:bg-background/80",children:e.jsx(ls,{perPage:ne,maxCount:1e3,currentPage:m,onPageChange:x})})]})]})}function Pa(s){var U,K,q,ce;const a=Es(),t=d.useContext(se),n=Be(),i=V(),[o,l]=os(),[c,m]=d.useState(!1),[k,h]=d.useState(0),u=o?et:st,g=d.useMemo(()=>({userId:t.userId??"-1",type:"FOLLOW_USER"}),[t.userId]),N={ratings:["G","R15"]},p=d.useMemo(()=>({offset:0,limit:ne,feedWhere:g,feedPostsWhere:N}),[g]),x=d.useMemo(()=>{var b,j;if(t.isLoading||t.isNotLoggedIn)return[];try{const O=a.readQuery({query:u,variables:p});return(j=(b=O==null?void 0:O.feed)==null?void 0:b.posts)!=null&&j.length?Is(O.feed.posts,ne):[]}catch{return[]}},[a,u,p,t.isLoading,t.isNotLoggedIn]),{data:f,fetchMore:C,loading:y}
68=J(u,{skip:t.isLoading||t.isNotLoggedIn,variables:p,fetchPolicy:"cache-and-network",nextFetchPolicy:"cache-first",errorPolicy:"ignore"}),$=d.useMemo(()=>JSON.stringify({tv:o,uid:t.userId,ratings:N.ratings.join("-")}),[o,t.userId]),{pages:I,appendPage:S,appendPages:G,replaceFirstPage:F,flat:T}=Us(x,$),_=d.useRef(""),z=d.useMemo(()=>T.map(b=>b.work).filter(Boolean),[T]),E=d.useRef("");d.useEffect(()=>{var P;const b=(P=f==null?void 0:f.feed)==null?void 0:P.posts;if(!(b!=null&&b.length))return;const j=Is(b,ne);if(!j.length)return;const O=j[0].map(B=>B.id).join(",");O!==_.current&&(F(j[0]),j.length>1&&G(j.slice(1)),_.current=O)},[(U=f==null?void 0:f.feed)==null?void 0:U.posts,F,G]),d.useEffect(()=>{if(!s.updateWorks||o||z.length===0)return;const b=z.map(j=>j.id).join(",");b!==E.current&&(s.updateWorks(z),E.current=b)},[z,s.updateWorks,o]);const Z=x.length>0||!!((q=(K=f==null?void 0:f.feed)==null?void 0:K.posts)!=null&&q.length);Ge("follow-user-infinite",Z);const R=(((ce=I.at(-1))==null?void 0:ce.length)??0)>=ne-8,te=d.useCallback(async()=>{var b,j;if(!(!R||y||c)){m(!0);try{const P=(j=(b=(await C({variables:{...p,offset:T.length}})).data)==null?void 0:b.feed)==null?void 0:j.posts;P!=null&&P.length&&S(P)}finally{m(!1)}}},[R,y,c,C,p,T.length,S]),L=$s(te,{hasNext:R,loading:y});return t.isLoading?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(we,{className:"size-8 animate-spin text-border"})}):t.isNotLoggedIn||!t.userId?e.jsx("div",{className:"flex h-64 items-center justify-center",children:e.jsx("p",{className:"text-center",children:i("ログインすることでユーザやタグをフォローして、タイムラインで作品を楽しむことができます","You can enjoy works on the timeline by following users and tags by logging in")})}):T.length===0&&!y?e.jsx("div",{className:"flex h-64 items-center justify-center",children:e.jsx("p",{className:"text-center",children:i("まだデータがありません、ユーザやタグをフォローして最新の作品をキャッチアップしましょう!","No data yet, follow users and tags to catch up on the latest works!")})}):e.jsxs("div",{className:"space-y-8",children:[I.map((b,j)=>b.length>0&&e.jsxs("div",{className:"w-full",children:[e.jsx(Zs,{posts:b,isTimelineView:o,setIsTimelineView:l,navigate:n,t:i,showControls:j===0,_isPagination:!1,onSelect:s.onSelect}),j<I.length-1&&!o&&e.jsx("div",{className:"mt-8 border-muted/20 border-t"})]},j.toString())),c&&e.jsx("div",{className:"flex justify-center py-4",children:e.jsx(we,{className:"size-8 animate-spin text-border"})}),R&&e.jsx("div",{ref:L,style:{height:1}})]})}function Zs({posts:s,isTimelineView:a,setIsTimelineView:t,navigate:n,t:i,showControls:o=!0,_isPagination:l,onSelect:c}
68){const[m,k]=d.useState({}),[h,u]=d.useState({}),g=x=>{k(f=>({...f,[x]:!f[x]}))},N=x=>{u(f=>({...f,[x]:!f[x]}))},p=s.filter(x=>(x==null?void 0:x.work)!=null).map(x=>x.work);return p.length===0?null:e.jsxs("div",{className:"flex flex-col space-y-4",children:[o&&e.jsxs("div",{className:"mb-4 flex justify-end space-x-2",children:[e.jsx(v,{onClick:()=>{n("/following")},variant:"secondary",children:i("管理","Manage")}),e.jsx(v,{onClick:()=>t(!a),children:a?i("一覧表示","List"):i("カード表示","Cards")})]}),a?e.jsx("div",{className:"m-auto w-full space-y-4",children:p.map(x=>{var f,C,y,$,I,S,G,F;return e.jsxs(Ie,{className:"rounded-lg border",children:[e.jsx(Se,{className:"m-auto flex max-w-[1200px] justify-start",children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsxs(me,{children:[e.jsx(je,{className:"rounded-full",src:ie((f=x.user)==null?void 0:f.iconUrl),alt:""}),e.jsx(ue,{})]}),e.jsxs(W,{to:`/users/${(C=x.user)==null?void 0:C.login}`,className:"flex items-center space-x-2",children:[e.jsx("div",{className:"font-semibold text-md",children:(y=x.user)==null?void 0:y.name}),e.jsxs("div",{className:"text-sm",children:["@",($=x.user)==null?void 0:$.login]})]})]})}),e.jsx(Te,{className:"m-auto max-w-[1200px]",children:e.jsx(d.Suspense,{fallback:e.jsx("div",{className:"flex justify-center py-4",children:e.jsx(we,{className:"size-8 animate-spin text-border"})}),children:e.jsxs("div",{className:"w-full md:flex md:space-x-8",children:[e.jsxs("div",{className:"space-y-2 md:w-1/2 md:max-w-[560px]",children:[e.jsxs("div",{className:"relative",children:[c?e.jsx("button",{type:"button",className:"block h-full w-full overflow-hidden rounded",onClick:()=>c(x.id),children:e.jsx("img",{src:x.largeThumbnailImageURL,alt:x.title,className:"w-full rounded-md"})}):e.jsx(W,{to:`/posts/${x.id}`,children:e.jsx("img",{src:x.largeThumbnailImageURL,alt:x.title,className:"w-full rounded-md"})}),((I=x.subWorks)==null?void 0:I.length)>0&&e.jsxs(e.Fragment,{children:[!h[x.id]&&e.jsx("div",{className:"absolute inset-x-0 bottom-0 h-16 rounded-b-md bg-gradient-to-t from-black/80 to-transparent"}),e.jsx(v,{className:"-translate-x-1/2 absolute bottom-2 left-1/2 transform rounded-full opacity-80",variant:"secondary",onClick:()=>N(x.id),children:h[x.id]?i("閉じる","Close"):i(`もっと見る(${x.subWorks.length})`,`Show More (${x.subWorks.length})`)}),h[x.id]&&x.subWorks.map((T,_)=>T.imageUrl&&e.jsx(W,{to:`/posts/${x.id}`,children:e.jsx("img",{src:T.imageUrl,alt:x.title,className:"w-full rounded-md"})},_.toString()))]})]}),e.jsx("div",{className:"font-semibold text-md",children:x.title}),e.jsx("div",{children:x.description}),e.jsxs("div",{className:"flex items-center space-x-4",children:[e.jsx("div",{className:"flex items-center",children:e.jsx(pe,{size:40,text:i("いいね","Like"),targetWorkId:x.id,targetWorkOwnerUserId:((S=x.user)==null?void 0:S.id)??"",defaultLiked:x.isLiked,defaultLikedCount:x.likesCount,isBackgroundNone:!1,strokeWidth:2})}),e.jsxs(v,{variant:"secondary",className:"flex cursor-pointer items-center space-x-1",onClick:()=>g(x.id),children:[e.jsx(cs,{className:"size-5"}),e.jsx("p",{children:x.commentsCount})]})]}),e.jsx("div",{className:"flex flex-wrap gap-x-4",children:(G=x.tagNames)==null?void 0:G.map(T=>e.jsx(W,{to:`/tags/${T}`,className:"p-0",children:e.jsx(v,{className:"p-0",variant:"link",children:`#${T}`})},T))}),e.jsx("div",{className:"text-sm",children:x.createdAt&&Hs(x.createdAt)})]}),e.jsx("div",{className:re(m[x.id]?"block":"hidden","md:block","w-full overflow-y-auto"),children:x.isCommentsEditable&&x.comments&&e.jsx(_s,{workId:x.id,comments:x.comments,defaultShowCommentCount:3,workOwnerIconImageURL:(F=x.user)==null?void 0:F.iconUrl})})]})})})]},x.id)})}):e.jsx("div",{className:"m-auto w-full space-y-4",children:e.jsx(As,{works:p,size:"large",isShowProfile:!0,autoPlayVideoPreview:!0,onSelect:c})})]})}const Wa=A(`fragment PartialWorkFields on WorkNode @_unmask {
69    id
70    title
71    largeThumbnailImageURL
72    description
73    tagNames
74    isLiked
75    likesCount
76    createdAt
77    commentsCount
78    isCommentsEditable
79    user {
80      id
81      name
82      login
83      iconUrl
84    }
85    subWorks {
86      imageUrl
87    }
88  }`),et=A(`query Feed($limit: Int!, $offset: Int!, $feedWhere: FeedWhereInput!, $feedPostsWhere: FeedPostsWhereInput) {
89    feed(where: $feedWhere) {
90      posts(limit: $limit, offset: $offset, where: $feedPostsWhere) {
91        id
92        work {
93          ...PartialWorkFields
94          comments(offset: 0, limit: 128) {
95            ...Comment
96          }
97        }
98      }
99    }
100  }`,[Rs,Wa]),st=A(`query FeedWorkList($limit: Int!, $offset: Int!, $feedWhere: FeedWhereInput!, $feedPostsWhere: FeedPostsWhereInput) {
101    feed(where: $feedWhere) {
102      posts(limit: $limit, offset: $offset, where: $feedPostsWhere) {
103        id
104        work {
105          ...PhotoAlbumWork
106        }
107      }
108    }
109  }`,[ds]);function Ca(s){const a=d.useContext(se),t=s.awardDateText.split("/")[0],n=s.awardDateText.split("/")[1],i=s.awardDateText.split("/")[2],o=new Date;o.setDate(o.getDate()-1);const{data:l}=J(Sa,{skip:a.isLoading,variables:{offset:0,limit:Ve.query.homeWorkCount.award,where:{year:Number(t),month:Number(n),day:Number(i),isSensitive:!1}}}),c=(l==null?void 0:l.workAwards)??s.awards,m=`${o.getFullYear()}/${o.getMonth()+1}/${o.getDate()}`,k=V();return e.jsxs("section",{className:"relative space-y-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h2",{className:"items-center space-x-2 font-bold text-xl",children:s.title}),e.jsx(W,{to:`rankings/${m}`,children:e.jsx(v,{variant:"secondary",size:"sm",children:k("すべて見る","All")})})]}),e.jsxs(Os,{opts:{dragFree:!0,loop:!1},children:[e.jsxs(zs,{children:[c.map((h,u)=>{var g,N,p,x,f,C,y,$,I,S,G,F,T,_,z,E,Z,R;return e.jsx(as,{className:"relative basis-1/3.5 space-y-2",children:e.jsxs("div",{className:"flex flex-col space-y-2",children:[e.jsxs("div",{className:"relative",children:[h.id&&((g=h.work)==null?void 0:g.smallThumbn
109ailImageURL)&&h.work.smallThumbnailImageWidth&&h.work.smallThumbnailImageHeight&&e.jsx(ms,{workId:h.work.id,imageUrl:(N=h.work)==null?void 0:N.smallThumbnailImageURL,subWorksCount:h.work.subWorksCount,thumbnailImagePosition:h.work.thumbnailImagePosition??0,size:"lg",imageWidth:h.work.smallThumbnailImageWidth,imageHeight:h.work.smallThumbnailImageHeight,ranking:u+1}),((p=h.work)==null?void 0:p.id)&&((f=(x=h.work)==null?void 0:x.user)==null?void 0:f.id)&&e.jsx("div",{className:"absolute right-0 bottom-0",children:e.jsx(pe,{size:56,targetWorkId:h.work.id,targetWorkOwnerUserId:((C=h.work.user)==null?void 0:C.id)??"",defaultLiked:h.work.isLiked,defaultLikedCount:0,isBackgroundNone:!0,strokeWidth:2,isParticle:!0})})]}),e.jsx("p",{className:"max-w-40 overflow-hidden text-ellipsis text-nowrap font-bold text-md",children:(y=h.work)==null?void 0:y.title}),e.jsxs("div",{className:"flex max-w-40 items-center justify-between",children:[((I=($=h.work)==null?void 0:$.user)==null?void 0:I.id)&&((G=(S=h.work)==null?void 0:S.user)==null?void 0:G.name)&&e.jsx(Ut,{userId:(T=(F=h.work)==null?void 0:F.user)==null?void 0:T.id,userIconImageURL:ie((z=(_=h.work)==null?void 0:_.user)==null?void 0:z.iconUrl),name:(Z=(E=h.work)==null?void 0:E.user)==null?void 0:Z.name,width:"sm"}),e.jsx("div",{className:"flex items-center space-x-1",children:e.jsxs("div",{className:"flex items-center space-x-1",children:[e.jsx(Ds,{className:"size-3 fill-gray-400 text-gray-400"}),e.jsx("span",{className:"text-xs",children:(R=h.work)==null?void 0:R.likesCount})]})})]})]},u.toString())},`carousel-${u.toString()}`)}),e.jsx(as,{className:"relative w-16 basis-1/3.5 space-y-2"})]}),e.jsx(Rt,{className:"absolute left-0"}),e.jsx(_t,{className:"absolute right-0"})]})]})}const Ia=A(`fragment HomeWorkAward on WorkAwardNode @_unmask {
110      id
111      work {
112        id
113        title
114        likesCount
115        isLiked
116        smallThumbnailImageURL
117        smallThumbnailImageHeight
118        smallThumbnailImageWidth
119        thumbnailImagePosition
120        subWorksCount
121        user {
122          id
123          name
124          iconUrl
125        }
126      }
127  }`),Sa=A(`query WorkAwards($offset: Int!, $limit: Int!, $where: WorkAwardsWhereInput!) {
128    workAwards(offset: $offset, limit: $limit, where: $where) {
129      id
130      ...HomeWorkAward
131    }
132  }`,[Ia]);function ke(s){const[a,t]=d.useState(!1),n=d.useRef(null);return d.useEffect(()=>{if(a||typeof window>"u")return;if(!("IntersectionObserver"in window)){t(!0);return}const i=n.current;if(!i)return;const o=new IntersectionObserver(([l])=>{l.isIntersecting&&(t(!0),o.disconnect())},{rootMargin:s.rootMargin??"240px 0px",threshold:s.threshold??0});return o.observe(i),()=>o.disconnect()},[a,s.rootMargin,s.threshold]),e.jsx("div",{ref:n,children:a?s.children:s.fallback})}function Pe(s){const a=Array.from({length:s.itemCount??(s.variant==="cropped"?8:6)});return e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{className:"text-left font-bold text-xl",children:s.title}),e.jsx("div",{className:s.variant==="cropped"?"grid grid-cols-2 gap-2 md:grid-cols-3 md:gap-4 xl:grid-cols-4 2xl:grid-cols-5":"grid grid-cols-2 gap-3 md:grid-cols-3",children:a.map((t,n)=>e.jsxs("div",{className:"space-y-2",children:[e.jsx(M,{className:s.variant==="cropped"?"aspect-square w-full rounded-md":"aspect-[4/3] w-full rounded-md"}),e.jsx(M,{className:"h-4 w-4/5"}),e.jsx(M,{className:"h-3 w-2/5"})]},n.toString()))})]})}function Ta({anchorAt:s,onSelect:a,...t}){const{isLoading:n}=d.useContext(se),[i]=Bs(),o=Number(i.get("page")??"0"),l=o>=0?o:0;d.useEffect(()=>{t.setPage&&t.page!==l&&t.setPage(l)},[l,t.page,t.setPage]);const{data:c,loading:m}=J(La,{skip:n,variables:{where:{isSensitive:!1}},fetchPolicy:"no-cache",errorPolicy:"ignore"});d.useEffect(()=>{t.updateWorks&&(c!=null&&c.hotWorks)&&t.updateWorks(c.hotWorks)},[c==null?void 0:c.hotWorks,t.updateWorks]);const k=(c==null?void 0:c.hotWorks)??[];return e.jsx("div",{className:"space-y-4",children:m&&!k.length?e.jsx(Ft,{loading:m}):e.jsx(Et,{workType:t.workType,works:k,isCropped:t.isCropped,onSelect:a})})}const La=A(`query Works($where:HotWorksWhereInput!) {
133     hotWorks(where:$where){
134       ...HomeWork
135       ...HomeNovelsWorkListItem
136       ...HomeVideosWorkListItem
137     }
138   }`,[Le,xs,us]);function Aa(s){const a=d.useMemo(()=>Ot(),[]),t=`hot-${s.workType}-${s.sortType}-${s.isPagination}`,n={...s,sortType:"LIKES_COUNT",timeRange:"WEEK"};return e.jsx("div",{className:"space-y-4",children:e.jsx(Ta,{...n,anchorAt:a,updateWorks:s.updateWorks},t)})}var $a={};function X(s,a){typeof a=="boolean"&&(a={forever:a}),this._originalTimeouts=JSON.parse(JSON.stringify(s)),this._timeouts=s,this._options=a||{},this._maxRetryTime=a&&a.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}var Ua=X;X.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};X.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};X.prototype.retry=function(s){if(this._timeout&&clearTimeout(this._timeout),!s)return!1;var a=new Date().getTime();if(s&&a-this._operationStart>=this._maxRetryTime)return this._errors.push(s),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(s);var t=this._timeouts.shift();if(t===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),t=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},t),this._options.unref&&this._timer.unref(),!0};X.prototype.attempt=function(s,a){this._fn=s,a&&(a.timeout&&(this._operationTimeout=a.timeout),a.cb&&(this._operationTimeoutCb=a.cb));var t=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){t._operationTimeoutCb()},t._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};X.prototype.try=function(s){console.log("Using RetryOperation.try() is deprecated"),this.attempt(s)};X.prototype.start=function(s){console.log("Using RetryOperation.start() is deprecated"),this.attempt(s)};X.prototype.start=X.prototype.try;X.prototype.errors=function(){return this._errors};X.prototype.attempts=function(){return this._attempts};X.prototype.mainError=function(){if(this._errors.length===0)return null;for(var s={},a=null,t=0,n=0;n<this._errors.length;n++){var i=this._errors[n],o=i.message,l=(s[o]||0)+1;s[o]=l,l>=t&&(a=i,t=l)}return a};(function(s){var a=Ua;s.operation=function(t){var n=s.timeouts(t);return new a(n,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})},s.timeouts=function(t){if(t instanceof Array)return[].concat(t);var n={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var i in t)n[i]=t[i];if(n.minTimeout>n.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var o=[],l=0;l<n.retries;l++)o.push(this.createTimeout(l,n));return t&&t.forever&&!o.length&&o.push(this.createTimeout(l,n)),o.sort(function(c,m){return c-m}),o},s.createTimeout=function(t,n){var i=n.randomize?Math.random()+1:1,o=Math.round(i*Math.max(n.minTimeout,1)*Math.pow(n.factor,t));return o=Math.min(o,n.maxTimeout),o},s.wrap=function(t,n,i){if(n instanceof Array&&(i=n,n=null),!i){i=[];for(var o in t)typeof t[o]=="function"&&i.push(o)}for(var l=0;l<i.length;l++){var c=i[l],m=t[c];t[c]=(function(h){var u=s.operation(n),g=Array.prototype.slice.call(arguments,1
138),N=g.pop();g.push(function(p){u.retry(p)||(p&&(arguments[0]=u.mainError()),N.apply(this,arguments))}),u.attempt(function(){h.apply(t,g)})}).bind(t,m),t[c].options=n}}})($a);const Ra=s=>{if(typeof s=="number")return s<1e12?s*1e3:s;if(typeof s=="string"){const a=Date.parse(s);if(!Number.isNaN(a))return a}return null},_a=s=>Ra(s.publishedAt??s.createdAt),Ha=s=>{const a=_a(s);if(a===null)return null;const t=new Date(a),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0"),o=String(t.getHours()).padStart(2,"0"),l=String(t.getMinutes()).padStart(2,"0");return`${n}.${i} ${o}:${l}`};function Ma(s){const a=V(),t=Ha(s.release);return e.jsx(W,{to:`/releases/${s.release.id}`,className:"block rounded-2xl border border-rose-300/80 bg-gradient-to-r from-rose-50 via-amber-50 to-orange-100 px-4 py-3 shadow-sm transition-all hover:border-rose-400 hover:shadow-md dark:border-rose-900/80 dark:from-rose-950/70 dark:via-zinc-950 dark:to-orange-950/60 dark:hover:border-rose-700",children:e.jsxs("div",{className:"flex items-start gap-3",children:[e.jsx("div",{className:"rounded-full bg-rose-600 p-2 text-white shadow-sm dark:bg-rose-500",children:e.jsx(Gt,{className:"h-4 w-4"})}),e.jsxs("div",{className:"min-w-0 flex-1",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("span",{className:"rounded-full bg-rose-600 px-2.5 py-1 font-bold text-[10px] tracking-[0.18em] text-white dark:bg-rose-500",children:"IMPORTANT"}),e.jsx("p",{className:"font-semibold text-rose-950 text-sm dark:text-rose-100",children:a("重要なお知らせ","Important notice")})]}),e.jsx("p",{className:"mt-2 line-clamp-2 font-medium text-foreground text-sm sm:text-base",children:s.release.title}),t&&e.jsxs("p",{className:"mt-1 text-[11px] text-rose-900/80 dark:text-rose-200/80 sm:text-xs",children:[a("掲載日時","Published"),": ",t]})]}),e.jsx(ns,{className:"mt-1 h-4 w-4 shrink-0 text-rose-700 dark:text-rose-300"})]})})}function Fa(s){const a=d.useContext(se),{data:t}=Fs(Ea,{skip:a.isLoading,variables:{where:{ratings:["G","R15"],isNowCreatedAt:!0}}});return d.useEffect(()=>{s.updateWorks&&s.updateWorks(t==null?void 0:t.newUserWorks)},[t==null?void 0:t.newUserWorks,s.updateWorks]),e.jsxs("div",{className:"space-y-4",children:[(s.workType==="WORK"||s.workType===null)&&e.jsx(hs,{title:"",works:(t==null?void 0:t.newUserWorks)||[],isCropped:s.isCropped,isShowProfile:!0,autoPlayVideoPreview:!0,onSelect:s.onSelect}),(s.workType==="NOVEL"||s.workType==="COLUMN")&&e.jsx(Gs,{title:"",works:(t==null?void 0:t.newUserWorks)||[],onSelect:s.onSelect}),s.workType==="VIDEO"&&e.jsx(Vs,{title:"",works:(t==null?void 0:t.newUserWorks)||[],isAutoPlay:!0,onSelect:s.onSelect})]})}const Ea=A(`query Works($where: NewUsersWorksWhereInput) {
139    newUserWorks: newUserWorks(
140      offset: 0,
141      limit: 20,
142      where: $where
143    ) {
144      ...HomeWork
145      ...HomeNovelsWorkListItem
146      ...HomeVideosWorkListItem
147    }
148  }`,[Le,xs,us]);function Oa(s){const a=V();return e.jsxs("div",{className:"flex flex-col space-y-4",children:[e.jsx("h2",{className:"font-semibold",children:a("新規クリエイター","New Creators")}),s.users.map(t=>{var i;const n=(i=t.name)!=null&&i.length?t.name:"名無し";return e.jsx("div",{className:"flex items-center space-x-2",children:e.jsxs(W,{to:`/users/${t.login}`,className:"flex items-center space-x-2",children:[e.jsxs(me,{children:[e.jsx(je,{className:"rounded-full",src:ie(t.iconUrl),alt:""}),e.jsx(ue,{})]}),e.jsx("div",{className:"font-semibold text-md",children:n})]})},t.id)})]})}const za=A(`fragment HomeNewPostedUsers on UserNode @_unmask {
149    id
150    iconUrl
151    name
152    login
153  }`);function Da(s){const a=d.useContext(se),{data:t}=J(Ga,{skip:a.isLoading,variables:{offset:0,limit:Ve.query.homeWorkCount.newUser,where:{ratings:["G"],isNowCreatedAt:!0}}}),n=(t==null?void 0:t.newUserWorks)??s.works;d.useEffect(()=>{var o;(o=s.onWorksLoaded)==null||o.call(s,n)},[n]);const i=V();return e.jsx(e.Fragment,{children:n.length>0&&e.jsx(hs,{title:i("新規クリエイターの初投稿作品","New creators' first works"),works:n,isCropped:!0,isShowProfile:!1,autoPlayVideoPreview:!0,onSelect:s.onSelect})})}const Va=A(`fragment HomeNewUsersWorks on WorkNode @_unmask {
154    id
155    ...HomeWork
156  }`,[Le]),Ga=A(`query Works($offset: Int!, $limit: Int!, $where: NewUsersWorksWhereInput!) {
157    newUserWorks(offset: $offset, limit: $limit, where: $where) {
158      ...HomeNewUsersWorks
159    }
160  }`,[Va]),Ba=[220,280,240,320,260,300,230,290,250,340,210,305];function We(s){return e.jsxs("div",{className:"space-y-4","aria-hidden":"true",children:[e.jsx("div",{className:"grid grid-cols-2 gap-3 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 xl:grid-cols-6",children:Ba.map((a,t)=>e.jsxs("div",{className:"overflow-hidden rounded-xl bg-card",children:[e.jsxs("div",{className:"relative overflow-hidden",children:[e.jsx(M,{className:"w-full rounded-none",style:{height:`${a}px`}}),e.jsxs("div",{className:"absolute top-2 right-2 flex gap-1.5",children:[t%3===0&&e.jsx("div",{className:"rounded-md bg-background/85 px-1.5 py-1",children:e.jsx(M,{className:"h-3 w-8 bg-muted"})}),e.jsx("div",{className:"rounded-md bg-background/85 px-1.5 py-1",children:e.jsx(M,{className:"h-3 w-6 bg-muted"})})]}),e.jsx("div",{className:"absolute right-3 bottom-3 rounded-full bg-background/90 p-2",children:e.jsx(M,{className:"h-5 w-5 rounded-full bg-muted"})})]}),e.jsxs("div",{className:"space-y-2 px-1 pt-2 pb-1",children:[e.jsx(M,{className:"h-5 w-4/5"}),e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(M,{className:"h-7 w-7 rounded-full"}),e.jsx(M,{className:"h-4 w-20"})]}),e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(M,{className:"h-3.5 w-3.5 rounded-full"}),e.jsx(M,{className:"h-4 w-6"})]})]})]})]},`new-works-skeleton-${s.view}-${a}-${t}`))}),s.isPagination&&e.jsx("div",{className:"fixed inset-x-0 bottom-0 z-10 flex justify-center border border-border/40 bg-background/95 p-2 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:e.jsxs("div",{className:"flex items-center gap-2 rounded-lg bg-background px-3 py-2",children:[e.jsx(M,{className:"h-8 w-8 rounded-md"}),e.jsx(M,{className:"h-8 w-8 rounded-md"}),e.jsx(M,{className:"h-8 w-10 rounded-md"}),e.jsx(M,{className:"h-8 w-8 rounded-md"}),e.jsx(M,{className:"h-8 w-8 rounded-md"})]})})]})}function Qa(s){const a=new Date;switch(a.setHours(0,0,0,0),s){case"TODAY":return{createdAtAfter:a.toISOString(),createdAtBefore:null};case"YESTERDAY":return{createdAtAfter:new Date(a.getTime()-864e5).toISOString(),createdAtBefore:a.toISOString()};case"WEEK":return{createdAtAfter:new Date(a.getTime()-6048e5).toISOString(),createdAtBefore:null};default:return{createdAtAfter:null,createdAtBefore:null}}}function qa(s){var m;const a=d.useContext(se),t=s.page===0&&s.workType===null&&s.isPromptPublic===null&&s.sortType===null&&(s.timeRange===void 0||s.timeRange==="ALL")&&!s.style&&!s.isOneWorkPerUser&&(((m=s.initialWorks)==null?void 0:m.length)??0)>0,n=s.workType==="VIDEO"?8:32,{createdAtAfter:i,createdAtBefore:o}=Qa(s.timeRange||"ALL"),{data:l}=J(Ka,{skip:a.isLoading||t,errorPolicy:"all",fetchPolicy:"cache-first",nextFetchPolicy:"cache-first",variables:{offset:s.page*n,limit:n,where:{ratings:["G","R15"],...s.workType!==null&&{workType:s.workType},...s.isPromptPublic!==null&&{hasPrompt:s.isPromptPublic,isPromptPublic:s.isPromptPublic},...s.sortType!==null&&{orderBy:s.sortType}||{orderBy:"DATE_CREATED"},...s.style&&{style:s.style},...s.isOneWorkPerUser&&{isOneWorkPerUser:!0},...!i&&!o&&{isNowCreatedAt:!0},...i&&{createdAtAfter:i},...o&&{beforeCreatedAt:o}}}}),c=t?s.initialWorks??[]:(l==null?void 0:l.works)??[];return d.useEffect(()=>{c.length>0&&s.updateWorks(c)},[c,s]),e.jsxs("div",{className:"space-y-4",children:[(s.workType==="WORK"||s.workType===null)&&e.jsx(hs,{title:"",works:c,isCropped:s.isCropped,isShowProfile:!0,autoPlayVideoPreview:s.autoPlayVideoPreview,priorityCount:t?4:0,onSelect:s.onSelect}),(s.workType==="NOVEL"||s.workType==="COLUMN")&&e.jsx(Gs,{title:"",works:c,onSelect:s.onSelect}),s.workType==="VIDEO"&&e.jsx(Vs,{title:"",works:c,isAutoPlay:!0,onSelect:s.onSelect}),e.jsx("div",{className:"h-8"}),e.jsx("div",{className:"fixed inset-x-0 bottom-0 z-10 flex justify-center border border-border/40 bg-background/95 p-2 backdrop-blur supports-[backdrop-filter]:bg-background/80",children:e.jsx(ls,{perPage:n,maxCount:1e3,currentPage:s.page,onPageChange:k=>s.setPage(k)})})]})}const Ka=A(`query Works($offset: Int!, $limit: Int!, $where: WorksWhereInput) {
161    works(offset: $offset, limit: $limit, where: $where) {
162      ...HomeWork
163      ...HomeNovelsWorkListItem
164      ...HomeVideosWorkListItem
165    }
166  }`,[Le,xs,us]);function Ss(s,a={}){const{intervalMs:t=2e3,fadeMs:n=240}
166=a,[i,o]=d.useState(0),[l,c]=d.useState(!0);return d.useEffect(()=>{o(0),c(!0)},[s.length]),d.useEffect(()=>{if(s.length<=1)return;let m;const k=window.setInterval(()=>{c(!1),m=window.setTimeout(()=>{o(h=>(h+1)%s.length),c(!0)},n)},t);return()=>{window.clearInterval(k),m!==void 0&&window.clearTimeout(m)}},[n,t,s.length]),{currentIndex:i,isVisible:l}}const Ts=s=>{const a=new Date(s*1e3),t=new Date(a.getTime()-9*60*60*1e3),n=String(t.getMonth()+1).padStart(2,"0"),i=String(t.getDate()).padStart(2,"0");return`${n}.${i}`},Ya=s=>{const a=new Date(s),t=String(a.getMonth()+1).padStart(2,"0"),n=String(a.getDate()).padStart(2,"0");return`${t}.${n}`};function Ja(s){const a=V(),{currentIndex:t,isVisible:n}=Ss(s.events),i=Ss(s.featuredReleases,{intervalMs:3600,fadeMs:240}),o=s.events[t],l=s.featuredReleases[i.currentIndex]??s.releaseList.contents[0];return e.jsxs("div",{className:"grid gap-2 md:grid-cols-2",children:[e.jsxs("div",{className:"rounded-xl border bg-card px-3 py-2 shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"min-w-0",children:e.jsx("h2",{className:"font-semibold text-xs",children:a("開催イベント","Current events")})}),e.jsx(v,{asChild:!0,variant:"ghost",size:"icon",className:"size-6 shrink-0 rounded-full",children:e.jsx(W,{to:"/events","aria-label":a("イベント一覧へ","Go to events"),title:a("イベント一覧へ","Go to events"),children:e.jsx(ns,{className:"h-3.5 w-3.5"})})})]}),o?e.jsx("div",{className:re("transition-all duration-500 ease-out",n?"opacity-100 translate-y-0":"opacity-20 translate-y-1"),children:e.jsxs(W,{to:`/events/${o.slug}`,className:"mt-1.5 block rounded-md px-1 py-0.5 transition-colors hover:bg-muted/40",children:[e.jsxs("div",{className:"flex items-center gap-1.5 overflow-hidden",children:[e.jsx(rs,{className:"shrink-0 px-1.5 py-0 text-[10px]",children:o.status==="ONGOING"?a("開催中","Ongoing"):a("予定","Upcoming")}),e.jsx("span",{className:"line-clamp-1 min-w-0 flex-1 text-sm",children:o.title})]}),e.jsxs("div",{className:"mt-0.5 line-clamp-1 text-[11px] text-muted-foreground",children:[Ts(o.startAt)," -"," ",Ts(o.endAt),o.tags[0]?` ・ #${o.tags[0]}`:""]}),e.jsxs("div",{className:"mt-0.5 flex items-center gap-1.5 text-[11px] text-muted-foreground",children:[e.jsxs(me,{className:"size-4",children:[o.userIconUrl&&e.jsx(je,{src:ie(o.userIconUrl),alt:""}),e.jsx(ue,{className:"text-[9px]",children:(o.userName??"A").slice(0,1)})]}),e.jsx("span",{className:"line-clamp-1",children:o.userName??"Aipictors"})]})]})}):e.jsx("div",{className:"mt-1.5 px-1 py-0.5 text-muted-foreground text-xs",children:a("表示できるイベントはありません","There are no events to show")})]}),e.jsxs("div",{className:"rounded-xl border bg-card px-3 py-2 shadow-sm",children:[e.jsxs("div",{className:"flex items-center justify-between gap-2",children:[e.jsx("div",{className:"min-w-0",children:e.jsx("h2",{className:"font-semibold text-xs",children:a("サイトのお知らせ","Site announcements")})}),e.jsx(v,{asChild:!0,variant:"ghost",size:"icon",className:"size-6 shrink-0 rounded-full",children:e.jsx(W,{to:"/releases","aria-label":a("お知らせ一覧へ","Go to announcements"),title:a("お知らせ一覧へ","Go to announcements"),children:e.jsx(ns,{className:"h-3.5 w-3.5"})})})]}),l?e.jsx("div",{className:re("transition-all duration-500 ease-out",i.isVisible?"opacity-100 translate-y-0":"opacity-20 translate-y-1"),children:e.jsxs(W,{to:`/releases/${l.id}`,className:"mt-1.5 block rounded-md px-1 py-0.5 transition-colors hover:bg-muted/40",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(qt,{tag:l.tag,className:"px-1.5 py-0 text-[10px]"}),e.jsx("span",{className:"line-clamp-1 flex-1 text-sm",children:l.title})]}),e.jsx("div",{className:"mt-0.5 text-[11px] text-muted-foreground",children:Ya(l.createdAt)})]})}):e.jsx("div",{className:"mt-1.5 px-1 py-0.5 text-muted-foreground text-xs",children:a("表示できるお知らせはありません","There are no announcements to show")})]})]})}const ze=s=>`/users/${s.login??s.id}`,le=(s,a="")=>s.name??s.login??s.id??a;
166function Xa(){const s=V(),[a,t]=d.useState([]),[n,i]=d.useState(!1);return d.useEffect(()=>{(async()=>{try{i(!0);const l=await fetch("/api/coins/support/recent?limit=3",{method:"GET"}),c=await l.json();l.ok&&!c.error&&c.data?t(Array.isArray(c.data.items)?c.data.items:[]):(console.warn("History API error:",c.error,"Status:",l.status),t([]))}catch(l){console.error("Support history fetch error:",l),t([])}finally{i(!1)}})()},[]),n?null:e.jsx("div",{className:"space-y-1",children:e.jsxs("div",{className:"rounded border bg-card px-2 py-1",children:[e.jsx("div",{className:"mb-0.5 flex items-center justify-between gap-1",children:e.jsx("p",{className:"text-[11px] font-normal text-muted-foreground",children:s("最新の推し","Latest support")})}),a.length>0?e.jsx("div",{className:"space-y-0.5",children:a.slice(0,3).map((o,l)=>e.jsxs("div",{className:"grid max-w-[28rem] grid-cols-[minmax(0,1fr)_auto] items-center gap-x-3 text-[10px]",children:[e.jsxs("div",{className:"min-w-0 flex items-center gap-1 truncate",children:[o.isAnonymous?e.jsxs(e.Fragment,{children:[e.jsx(me,{className:"size-4",children:e.jsx(ue,{})}),e.jsx("span",{className:"truncate text-muted-foreground",children:s("匿名","Anonymous")})]}):e.jsxs(e.Fragment,{children:[e.jsx(W,{to:ze(o.senderUser),className:"shrink-0 transition-opacity hover:opacity-70",title:le(o.senderUser),children:e.jsxs(me,{className:"size-4",children:[e.jsx(je,{src:ie(o.senderUser.iconUrl),alt:le(o.senderUser)}),e.jsx(ue,{})]})}),e.jsx(W,{to:ze(o.senderUser),className:"truncate transition-opacity hover:opacity-70 text-muted-foreground",title:le(o.senderUser),children:le(o.senderUser)})]}),e.jsx("span",{className:"shrink-0 text-muted-foreground",children:"→"}),e.jsx(W,{to:ze(o.recipientUser),className:"shrink-0 transition-opacity hover:opacity-70",title:le(o.recipientUser),children:e.jsxs(me,{className:"size-4",children:[e.jsx(je,{src:ie(o.recipientUser.iconUrl),alt:le(o.recipientUser)}),e.jsx(ue,{})]})}),e.jsx(W,{to:ze(o.recipientUser),className:"truncate transition-opacity hover:opacity-70 text-muted-foreground",title:le(o.recipientUser),children:le(o.recipientUser)})]}),e.jsxs("span",{className:"font-medium text-foreground whitespace-nowrap text-right",children:[o.ptAmount.toLocaleString(),"pt"]})]},`${o.createdAt}-${o.senderUser.id}-${l}`))}):e.jsx("p",{className:"text-[10px] text-muted-foreground py-0.5",children:s("推し履歴なし","No support history")})]})})}const Ce=s=>s.toLocaleString(),Za=10,en=s=>Math.max(0,Math.floor(s.premiumPtAmount/Za)),sn=s=>Math.max(0,s.freePtAmount),Ls=5;function tn(){const s=V(),[a,t]=d.useState([]),[n,i]=d.useState([]),[o,l]=d.useState(null),[c,m]=d.useState(!0);d.useEffect(()=>{(async()=>{try{m(!0);const[g,N]=await Promise.all([fetch(`/api/coins/support/rankings/public?kind=received&limit=${Ls}`,{method:"GET"}),fetch(`/api/coins/support/rankings/public?kind=sent&limit=${Ls}`,{method:"GET"})]),[p,x]=await Promise.all([g.json(),N.json()]);g.ok&&p.data&&(t(p.data.items),l(p.data.weekStartDate)),N.ok&&x.data&&i(x.data.items)}catch{}finally{m(!1)}})()},[]);const k=o?new Intl.DateTimeFormat("ja-JP",{timeZone:"Asia/Tokyo",year:"numeric",month:"long",day:"numeric"}).format(new Date(`${o}T00:00:00+09:00`)):null;if(!c&&a.length===0&&n.length===0)return null;const h=u=>{const g=en(u),N=sn(u);return e.jsxs("div",{className:"mt-1 space-y-1 text-[11px]",children:[e.jsx("p",{className:"text-muted-foreground",children:s("累計pt","Cumulative pt")}),e.jsx("p",{className:"font-bold text-sm",children:Ce(u.ptAmount)}),e.jsxs("div",{className:"flex items-center justify-end gap-1 text-amber-700 dark:text-amber-400",children:[e.jsx(Kt,{className:"h-4 w-4"}),e.jsx("span",{children:s(`${Ce(g)}コイン`,`${Ce(g)} coins`)})]}),e.jsxs("div",{className:"flex items-center justify-end gap-1 text-muted-foreground",children:[e.jsx(Yt,{className:"h-4 w-4"}),e.jsx("span",{children:s(`${Ce(N)}コイン`,`${Ce(N)} coins`)})]})]})};return e.jsxs("div",{className:"space-y-3",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Jt,{className:"h-5 w-5 text-amber-500"}),e.jsx("p",{className:"font-semibold text-lg",children:s("今週の推し・貢献度ランキング","This week's Supp
166ort rankings")})]}),k&&e.jsxs("p",{className:"text-muted-foreground text-xs",children:[k,"〜"]})]}),c?e.jsx("div",{className:"grid gap-4 lg:grid-cols-2",children:[0,1].map(u=>e.jsxs(Ie,{className:"animate-pulse",children:[e.jsx(Se,{className:"pb-2",children:e.jsx("div",{className:"h-4 w-24 rounded bg-muted"})}),e.jsx(Te,{className:"space-y-3",children:[0,1,2].map(g=>e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("div",{className:"h-10 w-10 rounded-full bg-muted"}),e.jsxs("div",{className:"flex-1 space-y-1",children:[e.jsx("div",{className:"h-3 w-20 rounded bg-muted"}),e.jsx("div",{className:"h-3 w-14 rounded bg-muted"})]}),e.jsx("div",{className:"h-4 w-12 rounded bg-muted"})]},g))})]},u))}):e.jsxs("div",{className:"grid gap-4 lg:grid-cols-2",children:[e.jsxs(Ie,{children:[e.jsx(Se,{className:"pb-2",children:e.jsx(ks,{className:"flex items-center justify-between text-base text-amber-500",children:e.jsx("span",{children:s("推しランキング","Received ranking")})})}),e.jsxs(Te,{className:"space-y-2",children:[a.length===0?e.jsx("p",{className:"text-muted-foreground text-sm",children:s("今週はまだデータがありません。","No data yet this week.")}):a.map(u=>e.jsxs(W,{to:`/users/${u.userLogin??u.userId}`,className:"flex items-center gap-3 rounded-lg border px-3 py-2 transition-colors hover:bg-muted/30",children:[e.jsx(Ws,{rank:u.rank,iconUrl:u.iconUrl,name:u.userName??u.userLogin??u.userId,size:"sm"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("p",{className:"truncate font-semibold text-sm",children:u.userName||u.userLogin||u.userId})}),e.jsx("div",{className:"shrink-0 text-right",children:h(u)})]},u.rank)),e.jsx(v,{asChild:!0,variant:"ghost",size:"sm",className:"mt-1 w-full text-muted-foreground text-sm",children:e.jsx(W,{to:"/coin-rankings?kind=received",children:s("もっと見る","See more")})})]})]}),e.jsxs(Ie,{children:[e.jsx(Se,{className:"pb-2",children:e.jsx(ks,{className:"text-base text-sky-500",children:s("貢献度ランキング","Contribution ranking")})}),e.jsxs(Te,{className:"space-y-2",children:[n.length===0?e.jsx("p",{className:"text-muted-foreground text-sm",children:s("今週はまだデータがありません。","No data yet this week.")}):n.map(u=>e.jsxs(W,{to:`/users/${u.userLogin??u.userId}`,className:"flex items-center gap-3 rounded-lg border px-3 py-2 transition-colors hover:bg-muted/30",children:[e.jsx(Ws,{rank:u.rank,iconUrl:u.iconUrl,name:u.userName??u.userLogin??u.userId,size:"sm"}),e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx("p",{className:"truncate font-semibold text-sm",children:u.userName||u.userLogin||u.userId})}),e.jsx("div",{className:"shrink-0 text-right",children:h(u)})]},u.rank)),e.jsx(v,{asChild:!0,variant:"ghost",size:"sm",className:"mt-1 w-full text-muted-foreground text-sm",children:e.jsx(W,{to:"/coin-rankings?kind=sent",children:s("もっと見る","See more")})})]})]})]})]})}function an(s){return e.jsx("div",{className:"group relative overflow-hidden rounded-md",children:e.jsxs(W,{to:`/tags/${s.tagName}`,className:"rounded-md",children:[e.jsx("img",{className:"h-[240px] w-[196px] bg-white object-cover object-center transition-transform duration-200 ease-in-out group-hover:scale-105",src:s.tagThumbnailUrl,alt:s.tagName}),e.jsx("div",{className:"absolute right-0 bottom-0 left-0 box-border flex h-16 flex-col justify-end bg-linear-to-t from-black to-transparent p-4 pb-3 opacity-88",children:e.jsx("p",{className:"text-white",children:`#${s.tagName}`})})]})})}function nn(s){var t;const a=pt.useRef(St({delay:2e3,stopOnInteraction:!0}));return e.jsxs(e.Fragment,{children:[e.jsx("h2",{className:"items-center space-x-2 font-bold text-xl",children:s.title}),e.jsx(Os,{opts:{dragFree:!0,loop:!0},plugins:[a.current],onMouseEnter:a.current.stop,onMouseLeave:a.current.reset,children:e.jsx(zs,{children:(t=s.tags)==null?void 0:t.map((n,i)=>e.jsx(as,{className:"basis-auto",children:e.jsx(an,{tagName:n.tagName,tagThumbnailUrl:n.thumbnailUrl})},i.toString()))})})]})}A(`fragment HomeTag on RecommendedTagNode @_unmask {
167    tagName
168    thumbnailUrl
169  }`);function is(s){const a=V(),t=()=>{window.location.href=`/generation?work=${s.workId}`};return e.jsxs(v,{variant:"secondary",size:"sm",className:`w-full ${s.className}`,onClick:t,children:[e.jsx(ia,{className:"mr-2 size-4"}),a("参照生成","Reference Generate")]})}function rn(s){const a="gap-x-1 border-border/40 bg-background/70 text-foreground backdrop-blur-sm";return s.works.length<=2?e.jsx("div",{className:"flex flex-wrap justify-center gap-x-8 gap-y-8",children:s.works.map((t,n)=>{var i;return e.jsxs("div",{className:"relative flex flex-col space-y-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ms,{workId:t.id,subWorksCount:t.subWorksCount,commentsCount:t.commentsCount,imageUrl:t.smallThumbn
169ailImageURL,thumbnailImagePosition:t.thumbnailImagePosition??0,size:"lg",imageWidth:t.smallThumbnailImageWidth,imageHeight:t.smallThumbnailImageHeight,isPromptPublic:t.promptAccessType==="PUBLIC",hasVideoUrl:!!t.url,isGeneration:t.isGeneration,hasReferenceButton:!0,onSelect:s.onSelect}),e.jsx("div",{className:"absolute right-0 bottom-0",children:e.jsx(pe,{size:56,targetWorkId:t.id,targetWorkOwnerUserId:((i=t.user)==null?void 0:i.id)??"",defaultLiked:t.isLiked,defaultLikedCount:0,isBackgroundNone:!0,strokeWidth:2})})]}),e.jsx("div",{className:"w-full",children:e.jsx(is,{workId:t.id})})]},t.id.toString())})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"hidden md:block",children:e.jsx(na,{breakpoints:[300,600,900,1200],children:e.jsx(ra,{photos:s.works.map(t=>({key:t.id,id:t.id.toString(),src:s.size==="large"?t.largeThumbnailImageURL:t.smallThumbnailImageURL,width:s.size==="large"?t.largeThumbnailImageWidth:t.smallThumbnailImageWidth,height:s.size==="large"?t.largeThumbnailImageHeight:t.smallThumbnailImageHeight,context:t})),targetRowHeight:s.targetRowHeight!==void 0?s.targetRowHeight:s.direction==="rows"?160:220,sizes:{size:"calc(100vw - 240px)",sizes:[{viewport:"(max-width: 960px)",size:"100vw"}]},componentsProps:{image:{loading:"lazy"}},render:{image:(t,{photo:n})=>{var i,o,l,c,m,k;return e.jsxs("div",{className:"relative h-full w-full overflow-hidden rounded",children:[s.onSelect?e.jsx("button",{type:"button",className:"block h-full w-full cursor-pointer overflow-hidden rounded",onClick:()=>{var h;return(h=s.onSelect)==null?void 0:h.call(s,n.id)},"aria-label":`Open ${n.context.title}`,children:e.jsx(Ps,{src:t.src,alt:n.context.title,className:"h-full w-full transition-transform duration-300 ease-in-out hover:scale-105",width:typeof t.width=="string"?Number.parseInt(t.width):t.width,height:typeof t.height=="string"?Number.parseInt(t.height):t.height,loading:t.loading})}):e.jsx(W,{className:"block h-full w-full overflow-hidden rounded",to:`/posts/${n.context.id}`,children:e.jsx(Ps,{src:t.src,alt:n.context.title,className:"h-full w-full transition-transform duration-300 ease-in-out hover:scale-105",width:typeof t.width=="string"?Number.parseInt(t.width):t.width,height:typeof t.height=="string"?Number.parseInt(t.height):t.height,loading:t.loading})}),e.jsx("div",{className:re("absolute right-0 z-10",s.isShowProfile?"bottom-28":"bottom-0"),onClick:h=>{h.stopPropagation(),h.preventDefault()},children:e.jsx(pe,{size:56,targetWorkId:n.context.id,targetWorkOwnerUserId:((i=n.context.user)==null?void 0:i.id)??"",defaultLiked:n.context.isLiked,defaultLikedCount:0,isBackgroundNone:!0,strokeWidth:2,likedCount:n.context.likesCount})}),n.context.subWorksCount>0&&e.jsxs(rs,{variant:"secondary",className:re("absolute top-1 right-1 z-10 flex items-center",a),children:[e.jsx(oa,{className:"size-3 text-muted-foreground"}),e.jsx("span",{className:"font-semibold text-xs leading-none",children:n.context.subWorksCount+1})]}),n.context.commentsCount>0&&e.jsxs(rs,{variant:"secondary",className:re("absolute top-1 left-1 z-10 flex items-center",a),children:[e.jsx(cs,{className:"size-3 text-muted-foreground"}),e.jsx("span",{className:"font-semibold text-xs leading-none",children:n.context.commentsCount})]}),e.jsx("div",{className:"absolute bottom-32 left-1 z-10",children:e.jsx($t,{isPromptPublic:n.context.promptAccessType==="PUBLIC"&&n.context.prompt!==""||n.context.isGeneration,hasVideoUrl:!!n.context.url,isGeneration:n.context.isGeneration,hasReferenceButton:!0,size:"md"})}),s.isShowProfile&&e.jsxs("div",{className:"mt-2 flex flex-col space-y-2 overflow-hidden text-ellipsis",children:[s.onSelect?e.jsx("button",{type:"button",className:"w-48 cursor-pointer font-bold",onClick:h=>{var u;h.stopPropagation(),(u=s.onSelect)==null||u.call(s,n.context.id.toString())},"aria-label":`Open ${n.context.title}`,children:e.jsx("p",{className:"overflow-hidden text-ellipsis text-nowrap text-left text-sm",children:n.context.title})}):e.jsx(W,{className:"w-48 font-bold",to:`/posts/${n.context.id}`,children:e.jsx("p",{className:"overflow-hidden text-ellipsis text-nowrap text-left text-sm",children:n.context.title})}),e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(W,{to:`/users/${(o=n.context.user)==null?void 0:o.id}`,children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Qs,{alt:((l=n.context.user)==null?void 0:l.name)??"",frame:(c=n.context.user)==null?void 0:c.avatarFrame,isAnimated:!1,sizeClassName:"size-6",src:ie((m=n.context.user)==null?void 0:m.iconUrl)}),e.jsx("span",{className:"truncate text-sm",children:(k=n.context.user)==null?void 0:k.name})]})}),e.jsxs("div",{className:"absolute right-0 ml-auto flex items-center space-x-1 rounded-md bg-card p-1",children:[e.jsx(Ds,{className:"size-3 fill-gray-400 text-gray-400"}),e.jsx("span",{className:"text-xs",children:n.context.likesCount})]})]}),e.jsx("div",{className:"mt-2 w-full",children:e.jsx(is,{workId:n.
169context.id})})]})]})}}})})}),e.jsx("div",{className:"block md:hidden",children:e.jsx(on,{works:s.works,isShowProfile:!0,onSelect:s.onSelect})})]})}function on(s){return e.jsx("div",{className:"grid w-full grid-cols-2 gap-3 pr-2 pb-4",children:s.works.map(a=>{var t,n,i,o,l,c;return e.jsxs("div",{className:"flex flex-col space-y-2",children:[e.jsxs("div",{className:"relative",children:[e.jsx(ms,{workId:a.id,imageUrl:a.smallThumbnailImageURL,thumbnailImagePosition:a.thumbnailImagePosition??0,size:"lg",imageWidth:a.smallThumbnailImageWidth,imageHeight:a.smallThumbnailImageHeight,subWorksCount:a.subWorksCount,commentsCount:a.commentsCount,isPromptPublic:a.promptAccessType==="PUBLIC"||a.isGeneration,hasVideoUrl:!!a.url,isGeneration:a.isGeneration,hasReferenceButton:!0,onSelect:s.onSelect}),e.jsx("div",{className:"absolute right-0 bottom-0",children:e.jsx(pe,{size:56,targetWorkId:a.id,targetWorkOwnerUserId:((t=a.user)==null?void 0:t.id)??"",defaultLiked:a.isLiked,defaultLikedCount:0,isBackgroundNone:!0,strokeWidth:2})})]}),s.isShowProfile&&e.jsxs("div",{className:"flex flex-col space-y-1",children:[s.onSelect?e.jsx("button",{type:"button",onClick:()=>{var m;return(m=s.onSelect)==null?void 0:m.call(s,a.id)},className:"cursor-pointer text-left",children:e.jsx("p",{className:"line-clamp-2 text-sm",children:a.title})}):e.jsx(W,{to:`/posts/${a.id}`,children:e.jsx("p",{className:"line-clamp-2 text-sm",children:a.title})}),e.jsx(W,{to:`/users/${(n=a.user)==null?void 0:n.id}`,children:e.jsxs("div",{className:"flex items-center space-x-2",children:[e.jsx(Qs,{alt:((i=a.user)==null?void 0:i.name)??"",frame:(o=a.user)==null?void 0:o.avatarFrame,isAnimated:!1,sizeClassName:"size-4",src:ie((l=a.user)==null?void 0:l.iconUrl)}),e.jsx("span",{className:"truncate text-xs",children:(c=a.user)==null?void 0:c.name})]})})]}),e.jsx("div",{className:"w-full",children:e.jsx(is,{workId:a.id,className:"text-xs"})})]},a.id)})})}function ln(s){const a=V();return e.jsxs("section",{className:re(s.title?"space-y-4":"gap-y-4"),children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h2",{className:"items-center space-x-2 font-bold text-md",children:[e.jsx("p",{className:"text-left font-bold text-xl",children:s.title&&s.title}),s.tooltip&&e.jsx(Zt,{children:e.jsxs(ea,{children:[e.jsx(sa,{asChild:!0,children:e.jsx(aa,{className:"inline h-6 w-auto"})}),e.jsx(ta,{children:e.jsx("p",{children:s.tooltip})})]})})]}),s.link&&e.jsx(W,{to:s.link,children:e.jsx(v,{variant:"secondary",size:"sm",children:a("すべて見る","All")})})]}),s.isCropped?e.jsx(Vt,{works:s.works}):e.jsx(rn,{works:s.works,size:"large",targetRowHeight:s.targetRowHeight,isShowProfile:s.isShowProfile,onSelect:s.onSelect})]})}A(`fragment HomeWork on WorkNode @_unmask {
170    ...PhotoAlbumWork
171    ...HomeCoppedWork
172  }`,[ds,Dt]);function dn(s){const a=d.useContext(se),{data:t}=J(mn,{skip:a.isLoading||a.isNotLoggedIn,variables:{offset:0,limit:Ve.query.homeWorkCount.generation,where:{orderBy:"DATE_CREATED",sort:"DESC",ratings:["G"],isFeatured:!0,beforeCreatedAt:s.dateText}}}),n=(t==null?void 0:t.works)??s.works;return d.useEffect(()=>{var i;(i=s.onWorksLoaded)==null||i.call(s,n)},[n]),e.jsx(e.Fragment,{children:e.jsx(ln,{title:"作品を選んで無料生成",works:n,isCropped:!1,isShowProfile:!0,onSelect:s.onSelect})})}const cn=A(`fragment HomeGenerationWork on WorkNode @_unmask {
173    id
174    ...HomeWork
175  }`,[Le]),mn=A(`query Works($offset: Int!, $limit: Int!, $where: WorksWhereInput) {
176    works(offset: $offset, limit: $limit, where: $where) {
177      ...HomeGenerationWork
178    }
179  }`,[cn]),zr=s=>ma(Pt.HOME,void 0,s.params.lang),un={home:"/home",new:"/","follow-user":"/follow-user-works","follow-tag":"/follow-tag-works"};function xn(s){d.useEffect(()=>{},[s])}function hn(s={}){var bs;const a=At(),t=V(),n=d.useId(),[i,o]=Bs(),l=Ct();d.useContext(se);const c=s.forcedTab??"new",m=()=>{if(typeof window>"u")return 0;const r=i.get("page"),w=r?Number.parseInt(r,10):0;return!Number.isNaN(w)&&w>=0&&w<=100?w:0},k=()=>{if(typeof window>"u")return null;const r=i.get("workType");return r&&r!=="ALL"?r:null},h=()=>
179{if(typeof window>"u")return null;const r=i.get("isPromptPublic");return r==="true"?!0:r==="false"?!1:null},u=()=>{if(typeof window>"u")return null;const r=i.get("sortType");return r==="DATE_CREATED"||r==="LIKES_COUNT"||r==="COMMENTS_COUNT"?r:null},g=()=>{if(typeof window>"u")return"ALL";const r=i.get("timeRange");return r&&r!=="ALL"?r:"ALL"},N=()=>typeof window>"u"?!1:i.get("isOneWorkPerUser")==="true",p=()=>typeof window>"u"?"new":i.get("view")||"new",x=()=>typeof window>"u"?!0:i.get("isPagination")!=="false",[f,C]=d.useState(!1),y=m(),[$,I]=d.useState(c==="new"?y:0),[S,G]=d.useState(c==="follow-user"?y:0),[F,T]=d.useState(c==="follow-tag"?y:0),[_,z]=d.useState(k()),[E,Z]=d.useState(h()),[R,te]=d.useState(u()),[L,U]=d.useState(N()),K=Be(),[q,ce]=d.useState(g()),b=Wt(),[j,O]=d.useState(p()),[P,B]=d.useState(x()),[Qe,tt]=d.useState(!0),[H,xe]=d.useState(!1),he=yt(),[fs,at]=d.useState([]),[Ne,nt]=d.useState({generated:[],newUsers:(a==null?void 0:a.newUserWorks)??[],recommended:(a==null?void 0:a.promotionWorks)??[],tags:[...(a==null?void 0:a.firstTagWorks)??[],...(a==null?void 0:a.secondTagWorks)??[]]}),fe=r=>{xe(r),r||he.closeDialog(),typeof window<"u"&&localStorage.setItem("aipictors-dialog-mode",JSON.stringify(r))},gs=d.useMemo(()=>[...Ne.recommended,...Ne.generated,...Ne.newUsers,...Ne.tags].filter((w,D,$e)=>$e.findIndex(ve=>ve.id===w.id)===D),[Ne]),Ae=(r,w)=>{nt(D=>D[r].length===w.length&&D[r].every((ve,gt)=>{var ys;return ve.id===((ys=w[gt])==null?void 0:ys.id)})?D:{...D,[r]:w})};d.useEffect(()=>{f||C(!0)},[f]);const ps=r=>{(r==="home"||r==="new"||r==="follow-user"||r==="follow-tag")&&K(un[r])};d.useEffect(()=>{if(!f)return;const r=new URLSearchParams(i);c==="new"?$===0?r.delete("page"):r.set("page",$.toString()):c==="follow-user"?S===0?r.delete("page"):r.set("page",S.toString()):c==="follow-tag"?F===0?r.delete("page"):r.set("page",F.toString()):r.delete("page"),c==="new"?q==="ALL"?r.delete("timeRange"):r.set("timeRange",q):r.delete("timeRange"),c==="new"?j==="new"?r.delete("view"):r.set("view",j):r.delete("view"),P?r.delete("isPagination"):r.set("isPagination","false"),c==="new"&&L?r.set("isOneWorkPerUser","true"):r.delete("isOneWorkPerUser"),l(r)},[c,$,S,F,f,q,L,j,l,i,P]),d.useEffect(()=>{if(typeof window<"u")try{const r=localStorage.getItem("aipictors-dialog-mode");if(r!==null){const w=JSON.parse(r);typeof w=="boolean"&&xe(w)}}catch(r){console.warn("Failed to parse dialog mode from localStorage:",r)}},[]);const qe=r=>{O(r);const w=new URLSearchParams(i);r==="new"?w.delete("view"):w.set("view",r),l(w)},rt=r=>{const w=new URLSearchParams(i);r==="ALL"?(w.delete("workType"),z(null)):(w.set("workType",r),z(r)),w.delete("page"),I(0),l(w)},it=r=>{const w=new URLSearchParams(i);if(r==="ALL")w.delete("isPromptPublic"),Z(null);else{const D=r==="prompt";w.set("isPromptPublic",D?"true":"false"),Z(D)}l(w)},ot=r=>{const w=new URLSearchParams(i);r==="ALL"?(w.delete("sortType"),te(null)):(w.set("sortType",r),te(r)),l(w)},lt=r=>{const w=new URLSearchParams(i);ce(r),r==="ALL"?w.delete("timeRange"):w.set("timeRange",r),l(w)},Ke=c==="home"&&typeof window<"u",Ye=a.awardDateText.split("/"),dt=Number(Ye[0]??"0"),ct=Number(Ye[1]??"0"),mt=Number(Ye[2]??"0"),{data:Je}=J(gn,{skip:!Ke,fetchPolicy:"cache-first"}),{data:oe}=J(jn,{skip:!Ke,fetchPolicy:"cache-first",variables:{where:{isSensitive:!1,page:"work"}}}),[ut]=ts(wn),{data:Y,loading:xt}=J(fn,{skip:!Ke,fetchPolicy:"cache-first",variables:{awardDay:mt,awardMonth:ct,awardYear:dt,awardWorksLimit:Ve.query.homeWorkCount.award}}),ht=async()=>{oe!=null&&oe.randomCustomerAdvertisement&&await ut({variables:{id:oe.randomCustomerAdvertisement.id}})},ae=(bs=Je==null?void 0:Je.viewer)==null?void 0:bs.currentPass,js=(ae==null?void 0:ae.type)==="LITE"||(ae==null?void 0:ae.type)==="STANDARD"||(ae==null?void 0:ae.type)==="PREMIUM",Xe=Array.isArray(Y==null?void 0:Y.newPostedUsers)?Y.newPostedUsers:a.newPostedUsers,Ze=Array.isArray(Y==null?void 0:Y.newComments)?Y.newComments:a.newComments,es=Array.isArray(Y==null?void 0:Y.workAwards)?Y.workAwards:a.workAwards;xn(f);
179const[ws,Nn]=d.useState(!0),[Ns,vn]=d.useState(!1);d.useMemo(()=>[...a.featuredReleaseList,...a.releaseList.contents].filter((w,D,$e)=>$e.findIndex(ve=>ve.id===w.id)===D),[a.featuredReleaseList,a.releaseList.contents]);const vs=d.useMemo(()=>{switch(c){case"home":return gs;case"new":case"follow-user":case"follow-tag":return fs;default:return[]}},[c,gs,fs]),ee=r=>{console.log("Opening work with index:",r);const w=vs.find(D=>D.id===r);if(!w){console.error("Work not found for ID:",r);return}H?(console.log("Opening dialog for work ID:",r),he.openDialog(r)):(console.log("Navigating to:",`/posts/${w.id}`),K(`/posts/${w.id}`))},ge=r=>{at(r)},ft=async()=>{};return a===null?null:e.jsxs(e.Fragment,{children:[a.importantRelease&&e.jsx(Ma,{release:a.importantRelease}),e.jsx(Xa,{}),e.jsxs(bt,{value:c,defaultValue:c,onValueChange:ps,className:"space-y-6",children:[e.jsx("div",{className:"-mx-4 bg-background/98 px-4 py-2",children:e.jsx("div",{className:"flex items-center justify-between gap-x-3 md:gap-x-6",children:e.jsx("div",{className:"min-w-0 flex-1",children:e.jsx(jt,{tabs:[{label:"ホーム",value:"home"},{label:"新着・人気",value:"new"},{label:"フォロー新着",value:"follow-user"},{label:"お気に入りタグ新着",value:"follow-tag"}],value:c,onChange:ps})})})}),e.jsxs(Me,{value:"home",className:"m-0 flex flex-col space-y-4",children:[e.jsx(d.Suspense,{fallback:e.jsx(wt,{}),children:a.dailyTheme&&e.jsx("div",{children:e.jsx(Xt,{themeTitle:a.dailyTheme.title,hotTags:a.hotTags})})}),e.jsxs("div",{className:"block space-y-4 md:flex md:space-x-4 md:space-y-0",children:[e.jsxs("div",{className:"flex w-full min-w-0 flex-col space-y-4 overflow-hidden md:max-w-[calc(100%_-_262px)]",children:[e.jsx(Ja,{events:a.eventPreviews,featuredReleases:a.featuredReleaseList,releaseList:a.releaseList}),e.jsx(ke,{fallback:e.jsx(Pe,{title:t("ユーザからの推薦","Recommended by users")}),children:e.jsx(ca,{works:[],onSelect:H?r=>ee(r):void 0,onWorksLoaded:r=>Ae("recommended",r)})}),e.jsx(ke,{fallback:e.jsx(Pe,{title:t("作品を選んで無料生成","Generate from featured works")}),children:e.jsx(dn,{works:[],dateText:a.awardDateText,onSelect:H?r=>ee(r):void 0,onWorksLoaded:r=>Ae("generated",r)})}),e.jsx(ke,{fallback:e.jsx(Pe,{title:t("新規クリエイターの初投稿作品","New creators' first works"),variant:"cropped"}),children:e.jsx(Da,{works:[],onSelect:H?r=>ee(r):void 0,onWorksLoaded:r=>Ae("newUsers",r)})}),e.jsx(ke,{fallback:e.jsx(Pe,{title:t("前日ランキング","Previous Day Ranking"),variant:"cropped"}),children:e.jsx(Ca,{awardDateText:a.awardDateText,title:t("前日ランキング","Previous Day Ranking"),awards:[],onSelect:H?r=>ee(r):void 0})}),e.jsx(tn,{}),e.jsx(ke,{fallback:e.jsx(Pe,{title:t("タグ作品","Tag Works"),variant:"cropped"}),children:e.jsx(la,{tag:a.firstTag,works:[],secondTag:a.secondTag,secondWorks:[],isCropped:!0,onSelect:H?r=>ee(r):void 0,onWorksLoaded:r=>Ae("tags",r)})}),e.jsx(nn,{title:t("人気タグ","Popular Tags"),tags:a.recommendedTags})]}),e.jsx(vt,{orientation:"vertical",className:"hidden h-[100vh] w-[1px] md:block"}),e.jsx("div",{className:"flex w-full max-w-80 flex-col space-y-4",children:e.jsxs("div",{className:"flex w-full flex-col space-y-4",children:[!js&&oe&&oe.randomCustomerAdvertisement&&e.jsxs("div",{className:"relative border",children:[e.jsx(W,{onClick:ht,target:"_blank",to:oe.randomCustomerAdvertisement.url,children:e.jsx("img",{src:oe.randomCustomerAdvertisement.imageUrl,alt:"Advertisement",loading:"lazy",decoding:"async",fetchPriority:"low",className:"h-auto w-full"})}),e.jsx("div",{className:"absolute top-0 right-0",children:e.jsx(ss,{text:t("提携広告です、広告主様を募集中です。メールまたはDMにてご連絡ください。","This is a partnered advertisement. We are accepting new advertisers. Please contact us via email or DM.")})})]}),!js&&e.jsx(W,{to:"/generation",children:e.jsx("img",{src:"https://assets.aipictors.com/Aipictors_01.webp",alt:"Aipictors Logo",loading:"lazy",decoding:"async",fetchPriority:"low",className:"h-auto w-full"})}),xt&&Xe.length===0&&Ze.length===0&&es.length===0&&e.jsxs("div",{className:"space-y-3",children:[e.jsx(M,{className:"h-6 w-32"}),e.jsx(M,{className:"h-12 w-full"}),e.jsx(M,{className:"h-12 w-full"}),e.jsx(M,{className:"h-6 w-40"}),e.jsx(M,{className:"h-16 w-full"})]}),Xe.length>0&&e.jsx(Oa,{users:Xe}),Ze.length>0&&e.jsx(Qt,{comments:Ze}),es.length>0&&e.jsx(Mt,{works:es})]})})]})]}),e.jsxs(Me,{value:"new",className:"flex flex-col space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(v,{variant:j==="new"?"default":"outline",onClick:()=>qe("new"),size:"sm",className:"font-medium shadow-sm transition-shadow hover:shadow",children:t("新着","New")}),e.jsx(v,{variant:j==="popular"?"default":"outline",onClick:()=>qe("popular"),size:"sm",className:"font-medium shadow-sm transition-shadow hover:shadow",children:e.jsxs("div",{className:"flex items-center space-x-1.5",children:[e.jsx("span",{children:t("人気","Popular")}),e.jsx(ss,{text:t("最近投稿された人気作品が表示されます","Recently popular works")})]})}),e.jsx(v,{variant:j==="new-user"?"default":"outline",onClick:()=>qe("new-user"),size:"sm",className:"font-medium shadow-sm transition-shadow hover:shadow",children:e.jsxs("div",{className:"flex items-center space-x-1.5",children:[e.jsx("span",{className:"hidden sm:inline",children:t("新規ユーザ","New Users")}),e.jsx("span",{className:"inline sm:hidden",children:t("新規","New")}),e.jsx(ss,{text:t("新規登録されたユーザの作品一覧です","List of works by newly registered users")})]})})]}),j==="new"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"rounded-lg bg-muted/30 p-2",children:[e.jsx("div",{className:"flex items-center justify-end",children:e.jsx(v,{type:"button",variant:"ghost",size:"icon",className:"h-7 w-7",onClick:()=>tt(r=>!r),"aria-label":Qe?t("絞り込みを閉じる","Close filters"):t("絞り込みを開く","Open filters"),children:Qe?e.jsx(xa,{
179className:"h-4 w-4"}):e.jsx(Ms,{className:"h-4 w-4"})})}),Qe&&e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[e.jsxs(Ue,{value:_||"",onValueChange:rt,children:[e.jsx(Re,{className:"h-8 w-full min-w-0 font-medium text-xs",children:e.jsx(_e,{placeholder:_?ua({type:_,lang:b}):t("種類","Type")})}),e.jsxs(He,{children:[e.jsx(Q,{value:"ALL",children:t("種類","Type")}),e.jsx(Q,{value:"WORK",children:t("画像","Image")}),e.jsx(Q,{value:"VIDEO",children:t("動画","Video")}),e.jsx(Q,{value:"NOVEL",children:t("小説","Novel")}),e.jsx(Q,{value:"COLUMN",children:t("コラム","Column")})]})]}),e.jsxs(Ue,{value:E===null?"ALL":E?"prompt":"no-prompt",onValueChange:it,children:[e.jsx(Re,{className:"h-8 w-full min-w-0 font-medium text-xs",children:e.jsx(_e,{placeholder:E===null?t("プロンプト","Prompt"):E?t("あり","Yes"):t("なし","No")})}),e.jsxs(He,{children:[e.jsx(Q,{value:"ALL",children:t("プロンプト","Prompt")}),e.jsx(Q,{value:"prompt",children:t("あり","Yes")}
179),e.jsx(Q,{value:"no-prompt",children:t("なし","No")})]})]}),e.jsxs(Ue,{value:R||"",onValueChange:ot,children:[e.jsxs(Re,{className:"h-8 w-full min-w-0 font-medium text-xs",children:[e.jsx(zt,{className:"h-3.5 w-3.5"}),e.jsx(_e,{placeholder:R||t("最新","Latest")})]}),e.jsxs(He,{children:[e.jsx(Q,{value:"DATE_CREATED",children:t("最新","Latest")}),e.jsx(Q,{value:"LIKES_COUNT",children:t("人気","Popular")}),e.jsx(Q,{value:"COMMENTS_COUNT",children:t("コメント","Comments")})]})]})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsxs(Ue,{value:q,onValueChange:lt,children:[e.jsx(Re,{className:"h-8 w-full font-medium text-xs sm:w-auto sm:min-w-[130px]",children:e.jsx(_e,{placeholder:q==="ALL"?t("全期間","All time"):q})}),e.jsxs(He,{children:[e.jsx(Q,{value:"ALL",children:t("全期間","All time")}),e.jsx(Q,{value:"TODAY",children:t("本日","Today")}),e.jsx(Q,{value:"YESTERDAY",children:t("昨日","Yesterday")}),e.jsx(Q,{value:"WEEK",children:t("週間","Week")})]})]}),e.jsxs("div",{className:"flex items-center gap-2 rounded-md border bg-background px-2 py-1.5",children:[e.jsx(Nt,{id:n,checked:L,onCheckedChange:r=>{const w=r===!0;U(w);const D=new URLSearchParams(i);w?D.set("isOneWorkPerUser","true"):D.delete("isOneWorkPerUser"),l(D)}}),e.jsx("label",{htmlFor:n,className:"cursor-pointer font-medium text-xs leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",children:t("ユーザー毎に1作品","One work per user")})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 md:ml-auto",children:[e.jsxs("div",{className:"flex rounded-md bg-muted/50 p-1",children:[e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>{B(!1);const r=new URLSearchParams(i);r.set("isPagination","false"),l(r)},className:`flex items-center space-x-1.5 rounded-md px-2 py-1 font-medium text-xs transition-all ${P?"text-muted-foreground hover:bg-muted hover:text-foreground":"bg-background text-foreground shadow-sm"} `,children:[e.jsx(Oe,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("フィード","Feed")})]}),e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>{B(!0);const r=new URLSearchParams(i);r.set("isPagination","true"),l(r)},className:`flex items-center space-x-1.5 rounded-md px-2 py-1 font-medium text-xs transition-all ${P?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"} `,children:[e.jsx(Ee,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("ページ","Pages")})]})]}),e.jsxs("div",{className:"flex rounded-md bg-muted/50 p-1",children:[e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>fe(!1),className:`flex items-center space-x-1.5 rounded-md px-2 py-1 font-medium text-xs transition-all ${H?"text-muted-foreground hover:bg-muted hover:text-foreground":"bg-background text-foreground shadow-sm"} `,children:[e.jsx(ye,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden lg:inline",children:t("リンク遷移","Open page")})]}),e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>fe(!0),className:`flex items-center space-x-1.5 rounded-md px-2 py-1 font-medium text-xs transition-all ${H?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"} `,children:[e.jsx(be,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden lg:inline",children:t("ダイアログ","Dialog")})]})]})]})]})]})]}),e.jsx(d.Suspense,{fallback:e.jsx(We,{view:"new",isPagination:P}),children:P?e.jsx(qa,{initialWorks:a.initialNewWorks,page:$,setPage:I,workType:_,isPromptPublic:E,sortType:R,timeRange:q,isOneWorkPerUser:L,autoPlayVideoPreview:!0,onSelect:H?r=>ee(r):void 0,updateWorks:ge}):e.jsx(da,{page:$,setPage:I,workType:_,isPromptPublic:E,sortType:R,timeRange:q,isOneWorkPerUser:L,isPagination:!1,onPaginationModeChange:B,autoPlayVideoPreview:!0,onSelect:H?r=>ee(r):void 0,updateWorks:ge})})]}),j==="popular"&&e.jsxs("div",{className:"space-y-4",children:[e.jsx("div",{className:"flex justify-end",children:e.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-1 shadow-sm",children:[e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>xe(!1),className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${H?"text-muted-foreground hover:bg-muted hover:text-foreground":"bg-background text-foreground shadow-sm"} `,children:[e.jsx(ye,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("リンク遷移","Open page")})]}),e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>xe(!0),className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${H?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"} `,children:[e.jsx(be,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("ダイアログ","Dialog")})]})]})}),e.jsx(d.Suspense,{fallback:e.jsx(We,{view:"popular",isPagination:P}),children:e.jsx(Aa,{page:$,setPage:I,workType:_,isPromptPublic:E,sortType:R,isPagination:P,onPaginationModeChange:B,onSelect:H?r=>ee(r):void 0,updateWorks:ge})})]}),j==="new-user"&&e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[e.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-1 shadow-sm",children:[e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>{B(!1);
179const r=new URLSearchParams(i);r.set("isPagination","false"),l(r)},className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${P?"text-muted-foreground hover:bg-muted hover:text-foreground":"bg-background text-foreground shadow-sm"}`,children:[e.jsx(Oe,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("フィード","Feed")})]}),e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>{B(!0);const r=new URLSearchParams(i);r.set("isPagination","true"),l(r)},className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${P?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[e.jsx(Ee,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("ページ","Pages")})]})]}),e.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-1 shadow-sm",children:[e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>fe(!1),className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${H?"text-muted-foreground hover:bg-muted hover:text-foreground":"bg-background text-foreground shadow-sm"} `,children:[e.jsx(ye,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("リンク遷移","Open page")})]}),e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>fe(!0),className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${H?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"} `,children:[e.jsx(be,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("ダイアログ","Dialog")})]})]})]}),e.jsx(d.Suspense,{fallback:e.jsx(We,{view:"new-user",isPagination:P}),children:e.jsx(Fa,{workType:_,isPromptPublic:E,sortType:R,isOneWorkPerUser:L,onSelect:H?r=>ee(r):void 0,updateWorks:ge})})]})]}),e.jsxs(Me,{value:"follow-user",className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[e.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-1 shadow-sm",children:[e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>{B(!1);const r=new URLSearchParams(i);r.set("isPagination","false"),l(r)},className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${P?"text-muted-foreground hover:bg-muted hover:text-foreground":"bg-background text-foreground shadow-sm"}`,children:[e.jsx(Oe,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("フィード","Feed")})]}),e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>{B(!0);const r=new URLSearchParams(i);r.set("isPagination","true"),l(r)},className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${P?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[e.jsx(Ee,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("ページ","Pages")})]})]}),e.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-1 shadow-sm",children:[e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>xe(!1),className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${H?"text-muted-foreground hover:bg-muted hover:text-foreground":"bg-background text-foreground shadow-sm"} `,children:[e.jsx(ye,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("リンク遷移","Open page")})]}),e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>xe(!0),className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${H?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"} `,children:[e.jsx(be,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("ダイアログ","Dialog")})]})]})]}),e.jsx(d.Suspense,{fallback:e.jsx(We,{view:"new",isPagination:P}),children:e.jsx(ya,{tab:c,page:S,setPage:G,isPagination:P,onPaginationModeChange:B,onSelect:H?r=>ee(r):void 0,updateWorks:ge},`follow-user-${S}-${c}`)})]}),e.jsxs(Me,{value:"follow-tag",className:"space-y-4",children:[e.jsxs("div",{className:"flex flex-wrap justify-end gap-2",children:[e.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-1 shadow-sm",children:[e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>{B(!1);
179const r=new URLSearchParams(i);r.set("isPagination","false"),l(r)},className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${P?"text-muted-foreground hover:bg-muted hover:text-foreground":"bg-background text-foreground shadow-sm"}`,children:[e.jsx(Oe,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("フィード","Feed")})]}),e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>{B(!0);const r=new URLSearchParams(i);r.set("isPagination","true"),l(r)},className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${P?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"}`,children:[e.jsx(Ee,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("ページ","Pages")})]})]}),e.jsxs("div",{className:"flex rounded-lg bg-muted/50 p-1 shadow-sm",children:[e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>fe(!1),className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${H?"text-muted-foreground hover:bg-muted hover:text-foreground":"bg-background text-foreground shadow-sm"} `,children:[e.jsx(ye,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("リンク遷移","Open page")})]}),e.jsxs(v,{variant:"ghost",size:"sm",onClick:()=>fe(!0),className:`flex items-center space-x-1.5 rounded-md px-3 py-2 font-medium text-xs transition-all ${H?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:bg-muted hover:text-foreground"} `,children:[e.jsx(be,{className:"h-3.5 w-3.5"}),e.jsx("span",{className:"hidden sm:inline",children:t("ダイアログ","Dialog")})]})]})]}),e.jsx(d.Suspense,{fallback:e.jsx(We,{view:"new",isPagination:P}),children:e.jsx(ja,{_tab:c,page:F,setPage:T,isPagination:P,onSelect:H?r=>ee(r):void 0,updateWorks:ge},`follow-tag-${F}-${c}`)})]})]}),he.isOpen&&he.workId&&e.jsx(kt,{works:vs,startWorkId:he.workId,onClose:he.closeDialog,loadMore:P?void 0:ft,hasNextPage:ws,isLoadingMore:Ns})]})}function Dr(){return e.jsx(hn,{forcedTab:"new"})}const fn=A(`query HomeSidebarQuery(
180    $awardYear: Int!
181    $awardMonth: Int!
182    $awardDay: Int!
183    $awardWorksLimit: Int!
184  ) {
185    workAwards(
186      offset: 0
187      limit: $awardWorksLimit
188      where: {
189        year: $awardYear
190        month: $awardMonth
191        day: $awardDay
192        isSensitive: false
193      }
194    ) {
195      ...HomeAwardWorks
196    }
197    newPostedUsers: newPostedUsers(
198      offset: 0
199      limit: 8
200    ) {
201      ...HomeNewPostedUsers
202    }
203    newComments: newComments(
204      offset: 0
205      limit: 8
206      where: {
207        isSensitive: false
208        isTextOnly: true
209        ratings: [G, R15]
210      }
211    ) {
212      ...HomeNewComments
213    }
214  }`,[Ht,za,Bt]),gn=A(`
215  query ViewerCurrentPass {
216    viewer {
217      id
218      currentPass {
219        id
220        type
221      }
222    }
223  }
224`),pn=A(`
225  fragment SideMenuAdvertisementsFields on CustomerAdvertisementNode @_unmask {
226    id
227    imageUrl
228    url
229    displayProbability
230    clickCount
231    impressionCount
232    isSensitive
233    createdAt
234    page
235    startAt
236    endAt
237    isActive
238  }
239`),jn=A(`query RandomCustomerAdvertisement($where: RandomCustomerAdvertisementWhereInput!) {
240    randomCustomerAdvertisement(where: $where) {
241      ...SideMenuAdvertisementsFields
242    }
243  }`,[pn]),wn=A(`
244  mutation UpdateClickedCountCustomerAdvertisement($id: ID!) {
245    updateClickedCountCustomerAdvertisement(id: $id) {
246      id
247    }
248  }
249`);export{hn as H,Dr as I,zr as m};

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.