PageSourceSearch

https://touhoudb.com/assets/CommentIndex-DXFfIlMM.js

js touhoudb.com collected 2026-09-25 21:50:45 UTC 6,719 bytes, 1 lines download raw bytes

1var N=Object.defineProperty;var T=(t,e,s)=>e in t?N(t,e,{enumerable:!0,configurable:!0,writable:!0,value:s}):t[e]=s;var o=(t,e,s)=>T(t,typeof e!="symbol"?e+"":e,s);import{am as p,s as D,at as w,j as r,F as y,a as l,E as R,ao as u,m as I,b9 as M,d as g,A,cs as C,i as f,p as S,f as U,o as h,k as j,D as L,R as O,h as V,e as _,v as P,ae as b,C as x}from"./index-8plysmrn.js";import{L as F}from"./Layout-C2_GUOk9.js";import{M as k}from"./MomentJsTimeAgo-uV5QInNO.js";import{F as B}from"./FormatMarkdown-PkorK3fa.js";import{P as $}from"./EntryToolTip-ChElqfq7.js";import{U as W}from"./UserLink-CACJVDMm.js";import{C as z}from"./CommentEntryItem-xAoON5wr.js";import{D as G}from"./Dropdown-bItk19e4.js";import{C as J}from"./DropdownList-D_g1EdiA.js";import{U as K}from"./UserLockingAutoComplete-CjZ-kpyI.js";import{m as Q}from"./map-C1l46gJL.js";import{u as q}from"./useLocationStateHandler-DU1fwmRO.js";import"./Markdown-5fKx-mi3.js";import"./QTipToolTip-3ReOZ9p7.js";import"./useWillUnmount-Ctu0o8Dn.js";import"./useEventCallback-CAj94tAM.js";import"./UrlHelper-Bme_q_7B.js";import"./EventCategory-CtpKpyKt.js";import"./useRegionNames-CjzaeXwp.js";import"./UserKnownLanguageContract-BK6rzFDP.js";import"./ContentLanguageSelection-DCp2QIBo.js";import"./SongListFeaturedCategory-D-RNkTj_.js";import"./EntryAutoComplete-92k-oqqy.js";import"./LockingAutoComplete-BsSa99nJ.js";(function(){try{var t=typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};t.__faroBundleId_vocadb_frontend="1774823875286c67e3437a1"}catch{}})();const H=p(({contract:t,allowDelete:e,alwaysAllowDelete:s=!1})=>{var a;const n=D();return w().includes(t.author.id)?r(y,{}):l("div",{className:"comment media comment-large",children:[r(u,{className:"pull-left",to:R.details_user_byName(t.author.name),children:r($,{url:(a=t.author.mainPicture)==null?void 0:a.urlThumb,size:70})}),l("div",{className:"media-body",children:[l("div",{className:"pull-right",children:[r(k,{as:"span",className:"comment-date",children:t.created}),(s||e&&n.canDeleteComment(t))&&r(y,{})]}),r("h3",{className:"media-heading comment-large-header",children:r(W,{indicateUserGroup:!0,user:t.author})}),r(B,{text:t.message})]})]})}),X="http://json-schema.org/draft-07/schema#",Y={entryType:{type:"string"},sort:{enum:["CreateDate","CreateDateDescending"],type:"string"},userId:{type:"number"}},Z="object",ee={$schema:X,properties:Y,type:Z};var te=Object.defineProperty,se=Object.getOwnPropertyDescriptor,d=(t,e,s,n)=>{for(var i=n>1?void 0:n?se(e,s):e,a=t.length-1,c;a>=0;a--)(c=t[a])&&(i=(n?c(e,s,i):c(i))||i);return n&&i&&te(e,s,i),i},E=(t=>(t.CreateDateDescending="CreateDateDescending",t.CreateDate="CreateDate",t))(E||{});const re=["entryType","sort","userId"],ae=new A({coerceTypes:!0}),ne=ae.compile(ee);class m{constructor(e,s,n,i){o(this,"entries",[]);o(this,"entryType",g.Undefined);o(this,"lastEntryDate");o(this,"sort","CreateDateDescending");o(this,"user");o(this,"validateLocationState",e=>ne(e));o(this,"loadMore",async()=>{var i;const e=await this.httpClient.get(this.urlMapper.mapRelative("/api/comments"),{fields:["Entry"].join(","),entryFields:[C.AdditionalNames,C.MainPicture].join(","),lang:this.values.languagePreference,before:this.sort==="CreateDateDescending"&&this.lastEntryDate?this.lastEntryDate.toISOString():void 0,since:this.sort==="CreateDate"&&this.lastEntryDate?this.lastEntryDate.toISOString():void 0,userId:this.user.id,entryType:this.entryType,sortRule:this.sort}),s=Q(e.items.map(a=>{var c,v;return{globalEntryId:`${(c=a.entry)==null?void 0:c.entryType}.${(v=a.entry)==null?void 0:v.id}`,comment:a}}).groupBy(a=>a.globalEntryId),a=>({comments:a.map(({comment:c})=>c),entry:a[0].comment.entry})),n=(i=s.last())==null?void 0:i.comments.last();f(()=>{this.entries.push(...s),this.lastEntryDate=n&&n.created?new Date(n.created):void 0})});o(this,"clear",()=>(this.lastEntryDate=void 0,this.entries=[],this.loadMore()));o(this,"pauseNotifications",!1);o(this,"updateResults",async e=>{this.pauseNotifications||(this.pauseNotifications=!0,await this.clear(),this.pauseNotifications=!1)});o(this,"onLocationStateChange",e=>{const s=S(re,e.keys);this.updateResults(s)});this.values=e,this.httpClient=s,this.urlMapper=n,I(this),this.user=new M(a=>i.getOne({id:a}))}get locationState(){return{entryType:this.entryType,sort:this.sort,userId:this.user.id}}set locationState(e){this.entryType=e.entryType??g.Undefined,this.sort=e.sort??"CreateDateDescending",this.user.id=e.userId}}d([h],m.prototype,"entries",2);d([h],m.prototype,"entryType",2);
1d([h],m.prototype,"lastEntryDate",2);d([h],m.prototype,"sort",2);d([U.struct],m.prototype,"locationState",1);d([j],m.prototype,"clear",2);const ie=p(({commentListStore:t})=>{const{t:e}=b(["Resources","ViewRes","ViewRes.User"]);return l("div",{className:"form-horizontal well well-transparent",children:[r("div",{className:"pull-right",children:l("div",{className:"inline-block",children:[e("ViewRes:EntryIndex.SortBy")," ",r(G,{items:Object.fromEntries(Object.values(E).map(s=>[s,e(`Resources:CommentSortRuleNames.${s}`)])),value:t.sort,onChange:s=>f(()=>{t.sort=s})})]})}),l("div",{className:"control-group",children:[r("div",{className:"control-label",children:e("ViewRes.User:EntryEdits.EntryType")}),r("div",{className:"controls",children:r(J,{value:t.entryType,onChange:s=>f(()=>{t.entryType=s.target.value})})})]}),l("div",{className:"control-group",children:[r("div",{className:"control-label",children:"User"}),r("div",{className:"controls",children:r(K,{basicEntryLinkStore:t.user})})]})]})}),oe=p(({entry:t})=>{const e=w();return t.comments.every(s=>e.includes(s.author.id))?r(y,{}):l("div",{className:"row-fluid comment-with-entry well well-transparent",children:[r("div",{className:"span5",children:t.comments.map(s=>r(H,{contract:s,allowDelete:!1},s.id))}),r("div",{className:"span5 item",children:r(z,{entry:t.entry})})]})}),le=p(({commentListStore:t})=>r(y,{children:t.entries.map((e,s)=>r(oe,{entry:e},s))})),Oe=p(()=>{const t=L(),e=D(),[s]=O.useState(()=>new m(t.values,V,_,P)),{t:n,ready:i}=b(["ViewRes.Comment","VocaDb.Web.Resources.Views.ActivityEntry"]),a=n("ViewRes.Comment:Index.RecentComments");return q(s),l(F,{pageTitle:a,ready:i,title:a,children:[l("ul",{className:"nav nav-pills",children:[r("li",{children:r(u,{to:"/ActivityEntry",children:"All activity"})}),e.isLoggedIn&&r("li",{children:r(u,{to:"/ActivityEntry/FollowedArtistActivity",children:"Only followed artists"})}),r("li",{className:"active",children:r(u,{to:"/Comment",children:"Comments"})})]}),r(ie,{commentListStore:s}),r(le,{commentListStore:s}),r("hr",{}),r("h3",{children:r(x,{onClick:s.loadMore,children:n("VocaDb.Web.Resources.Views.ActivityEntry:Index.ViewMore")})})]})});export{Oe as default};

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.