PageSourceSearch

https://politikvonunten.org/assets/ReportView-D-TNQ5T9.js

js politikvonunten.org collected 2026-10-03 00:54:23 UTC 15,467 bytes, 2 lines download raw bytes

1import{a as R,b as Oe,U as Se}from"./report-Cjy1Ms7P.js";import{d9 as Ne,ag as xe,e as Ae,a8 as Pe,da as Ue,a as Ie,f as Me,a7 as z,Y as w,Z as Ve,d8 as E,bz as Le,R as f,bf as qe,ba as $e,az as ze,j as u,h as b,k as t,o as v,a4 as h,av as V,w as d,v as c,t as o,i,ai as L,s as m,cs as A,b1 as Q,b0 as Qe,m as Fe,cT as Be,aw as je,c as T,an as W,db as Z,bd as J,F as C,x as n,G as Ge}from"./main-BvDl5GqJ.js";import{u as He}from"./head-BvuADw2P.js";import{_ as Ye}from"./EmptyContent.vue_vue_type_script_setup_true_lang-DRIfsPeC.js";import{_ as We}from"./EventComment.vue_vue_type_style_index_0_lang-BsY3dYpS.js";import{D as K}from"./DiscussionComment-DKSlPt0T.js";import"./PopoverActorCard.vue_vue_type_script_setup_true_lang-Cd6oVk1B.js";import"./ActorCard-JHgcHEP9.js";import"./Email-B8Fn8Z-w.js";import"./Delete-CfBDNVyK.js";import"./Alert-QBQ9cyGD.js";import"./ChevronUp-DDBoMxd7.js";import"./ChevronDown-C_5cLCaP.js";import"./DotsHorizontal-a88yyyj1.js";import"./Reply-Cr0lwqlb.js";import"./report-qQ-FEk20.js";import"./formatDistanceToNow-BembWcBD.js";import"./getRoundingMethod-C3_jS3SP.js";import"./endOfMonth-D2RWMi3E.js";var F,X;function Ze(){if(X)return F;X=1;var q=Ne();function g(O){return O&&O.length?q(O):[]}return F=g,F}var Je=Ze();const Ke=xe(Je),Xe={key:1,class:"container mx-auto"},et={class:"flex flex-wrap gap-2 my-2"},tt={class:"w-full"},rt={class:"table w-full"},nt={key:0},ot=["src"],at={key:1},st={class:"flex items-center justify-between pr-6"},lt=["src"],ut={key:2},it={key:0},dt={key:1},ct=["src"],pt={key:2},vt={key:3},mt={key:0},_t={key:1},ft={key:2},yt={key:3},ht={class:"bg-white dark:bg-zinc-700 rounded px-2 pt-1 pb-2 my-3"},bt={class:"mb-1"},kt={class:""},Et={class:"flex gap-1"},Rt={key:0,class:""},gt=["src"],Ct={key:2,class:""},Dt={key:0,class:""},wt={class:""},Tt={key:3},Ot={key:0,class:"prose dark:prose-invert"},St={key:1},Nt={key:0,class:"bg-white dark:bg-zinc-700 rounded px-2 pt-1 pb-2 my-3"},xt={class:"mb-1"},At={key:1,class:"bg-white dark:bg-zinc-700 rounded px-2 pt-1 pb-2 my-3"},Pt={class:"mb-1"},Ut={key:2,class:"bg-white dark:bg-zinc-700 rounded px-2 pt-1 pb-2 my-3"},It={class:"bg-white dark:bg-zinc-700 rounded px-2 pt-1 pb-2 my-3"},Mt={class:"mb-1"},Vt=["id"],Lt=["src"],qt=["href"],$t=Ae({__name:"ReportView",props:{reportId:{}},setup(q){const g=je(),O=q,{currentActor:P}=Pe(),{features:ee}=Ue(),B=T(()=>ee.value?.antispam),{result:te,onError:re}=Ie(R,()=>({id:O.reportId})),e=T(()=>te.value?.report);re(({graphQLErrors:s})=>{j.value=Ke(s.map(({message:l})=>l))});const{t:r}=Me({useScope:"global"});He({title:T(()=>r("Report"))});const D=W("notifier"),j=z([]),U=z(""),$=T(()=>[...e.value?.events??[],...e.value?.comments??[]]),S=T(()=>$.value.length===1),{mutate:ne,onDone:oe,onError:ae}=w(Oe,()=>({update:(s,{data:l})=>{if(l==null)return;const y=s.readQuery({query:R,variables:{id:e.value?.id}});if(y==null)return;const{report:_}=y;if(_===null){console.error("Cannot update event notes cache, because of null value.");return}const p=l.createReportNote;p.moderator=P.value,_.notes=_.notes.concat([p]),s.writeQuery({query:R,variables:{id:e.value?.id},data:{report:e}})}}));oe(()=>{U.value=""}),ae(s=>{console.error(s)});const N=W("dialog"),G=T(()=>S.value?"<p>"+r("This will also resolve the report.")+"</p>":""),se=s=>{N?.confirm({title:r("Deleting event"),message:r("Are you sure you want to <b>delete</b> this event? <b>This action cannot be undone</b>. You may want to engage the discussion with the event creator and ask them to edit their event instead.")+G.value,confirmText:S.value?r("Delete event and resolve report"):r("Delete event"),variant:"danger",hasIcon:!0,onConfirm:()=>ce(s)})},le=s=>{N?.confirm({title:r("Deleting comment"),message:r("Are you sure you want to <b>delete</b> this comment? <b>This action cannot be undone</b>.")+G.value,confirmText:S.value?r("Delete comment and resolve report"):r("Delete comment"),variant:"danger",hasIcon:!0,onConfirm:()=>pe({commentId:s.id})})},{mutate:ue,onDone:ie,onError:de}=w(Ve,()=>({update:(s,{data:l})=>{if(l==null)return;const y=s.readQuery({query:R,variables:{id:e.value?.id}});if(y==null)return;const{report:_}=y;if(_===null){console.error("Cannot update report events cache, be
1cause of null value.");return}const p={..._,events:_.events?.filter(k=>k.id!==l.deleteEvent.id)};s.writeQuery({query:R,variables:{id:e.value?.id},data:{report:p}})}}));ie(async()=>{$.value.length===0?(await x(E.RESOLVED),D?.success(r("Event deleted and report resolved"))):D?.success(r("Event deleted"))}),de(s=>{console.error(s)});const ce=async s=>{s?.id&&ue({eventId:s.id},{context:{eventTitle:s.title}})},{mutate:pe,onDone:ve,onError:me}=w(Le,()=>({update:(s,{data:l})=>{if(l==null)return;const y=s.readQuery({query:R,variables:{id:e.value?.id}});if(y==null)return;const{report:_}=y;if(_===null){console.error("Cannot update report comments cache, because of null value.");return}const p={..._,comments:_.comments.filter(k=>k.id!==l.deleteComment.id)};s.writeQuery({query:R,variables:{id:e.value?.id},data:{report:p}})}}));ve(async()=>{$.value.length===0?(await x(E.RESOLVED),D?.success(r("Comment deleted and report resolved"))):D?.success(r("Comment deleted"))}),me(s=>{console.error(s)});const{mutate:H,onDone:_e,onError:fe}=w(Se,()=>({update:(s,{data:l})=>{if(l==null)return;const y=s.readQuery({query:R,variables:{id:e.value?.id}});if(y==null)return;const{report:_}=y;if(_===null){console.error("Cannot update event notes cache, because of null value.");return}const p={..._,status:l.updateReportStatus.status};s.writeQuery({query:R,variables:{id:e.value?.id},data:{report:p}})}}));_e(async()=>{await g.push({name:f.REPORTS})}),fe(s=>{console.error(s)});const x=async s=>{e.value&&H({reportId:e.value?.id,status:s})},Y=s=>{N?.confirm({title:r(s?"Report as undetected spam":"Report as ham"),message:r("The report contents (eventual comments and event) and the reported profile details will be transmitted to Akismet."),confirmText:r("Submit to Akismet"),variant:"warning",hasIcon:!0,onConfirm:()=>{e.value&&H({reportId:e.value.id,status:e.value.status,antispamFeedback:s?Z.SPAM:Z.HAM})}})},{mutate:ye,onDone:he}=w(qe),{mutate:be,onDone:ke}=w($e),{load:Ee}=ze(J),Re=async s=>{N?.confirm({title:r("Suspend the profile?"),message:r("Do you really want to suspend this profile? All of the profiles content will be deleted.")+"<p><b>"+r("There will be no way to restore the profile's data!")+"</b></p>",confirmText:r("Suspend the profile"),cancelText:r("Cancel"),variant:"danger",onConfirm:async()=>(ye({id:s}),g.push({name:f.USERS}))})},ge=s=>r("The following user's profiles will be deleted, with all their data:")+'<ul class="list-disc pl-3">'+s.actors.map(l=>`<li>${A(l)}</li>`).join("")+"</ul><b>",I=z(),Ce=async s=>{try{if(!I.value)try{const l=await Ee(J,{id:s.id});if(!l)return;I.value=l.user}catch{return}N?.confirm({title:r("Ban the account?"),message:r("Do you really want to ban the account « {emailAccount} » ?",{emailAccount:I.value.email})+" "+ge(I.value)+"<b>"+r("There will be no way to restore the user's data!")+"</b>",confirmText:r("Ban the account"),cancelText:r("Cancel"),variant:"danger",onConfirm:async()=>(be({userId:s.id}),g.push({name:f.USERS}))})}catch(l){console.error(l)}};return ke(async()=>{await g.push({name:f.REPORTS}),D?.success(r("User suspended and report resolved"))}),he(async()=>{await g.push({name:f.REPORTS}),D?.success(r("Profile suspended and report resolved"))}),(s,l)=>{const y=C("breadcrumbs-nav"),_=C("o-notification"),p=C("o-button"),k=C("router-link"),M=C("i18n-t"),De=C("o-input"),we=C("o-field");return n(),u(h,null,[e.value?(n(),b(y,{key:0,links:[{name:t(f).MODERATION,text:t(r)("Moderation")},{name:t(f).REPORTS,text:t(r)("Reports")},{name:t(f).REPORT,params:{id:e.value.id},text:t(r)("Report #{reportNumber}",{reportNumber:e.value.id})}]},null,8,["links"])):v("",!0),(n(!0),u(h,null,V(j.value,a=>(n(),b(_,{title:"Error",variant:"danger",key:a},{default:d(()=>[c(o(a),1)]),_:2},1024))),128)),e.value?(n(),u("div",Xe,[i("div",et,[e.value.status!==t(E).RESOLVED?(n(),b(p,{key:0,onClick:l[0]||(l[0]=a=>x(t(E).RESOLVED)),variant:"primary"},{default:d(()=>[c(o(t(r)("Mark as resolved")),1)]),_:1})):v("",!0),e.value.status!==t(E).OPEN?(n(),b(p,{key:1,onClick:l[1]||(l[1]=a=>x(t(E).OPEN)),variant:"success"},{default:d(()=>[c(o(t(r)("Reopen")),1)]),_:1})):v("",!0),e.value.status!==t(E).CLOSED?(n(),b(p,{key:2,onClick:l[2]||(l[2]=a=>x(t(E).CLOSED)),variant:"danger"},{default:d(()=>[c(o(t(r)("Close")),1)]),_:1})):v("",!0),B.value?(n(),b(p,{key:3,outlined:"",onClick:l[3]||(l[3]=a=>Y(!0)),variant:"text",class:"!text-mbz-danger"},{default:d(()=>[c(o(t(r)("Report as spam")),1)]),_:1})):v("",!0),B.value?(n(),b(p,{key:4,outlined:"",onClick:l[4]||(l[4]=a=>Y(!1)),variant:"text",class:"!text-mbz-success"},{default:d(()=>[c(o(t(r)("Report as ham")),1)]),_:1})):v("",!0)]),i("section",tt,[i("table",rt,[i("tbody",null,[e.value.reported?.type===t(L).GROUP?(n(),u("tr",nt,[i("td",null,o(t(r)("Reported group")),1),i("td",null,[m(k,{to:{name:t(f).ADMIN_GROUP_PROFILE,params:{id:e.value.reported.id}}},{default:d(()=>[e.value.reported.avatar?(n(),u("img",{key:0,class:"image",src:e.value.reported.avatar.url,alt:""},null,8,ot)):v("",!0),c(" "+o(t(A)(e.value.reported)),1)]),_:1},8,["to"])])])):e.value.reported?.type===t(L).PERSON?(n(),u("tr",at,[i("td",null,o(t(r)("Reported identity")),1),i("td",st,[m(k,{to:{name:t(f).ADMIN_PROFILE,params:{id:e.value.reported.id}},class:"inline-flex gap-1"},{default:d(()=>[e.value.reported.avatar?(n(),u("img",{key:0,class:"image rounded-full",src:e.value.reported.avatar.url,alt:""},null,8,lt)):v("",!0),e.value.reported.suspended?(n(),b(M,{key:1,keypath:"{profileName} (suspended)"},{profileName:d(()=>[c(o(t(A)(e.value.reported)),1)]),_:1})):(n(),u(h,{key:2},[c(o(t(A)(e.value.reported)),1)],64))]),_:1},8,["to"]),e.value.reported.domain&&!e.value.reported.suspended?(n(),b(p,{key:0,variant:"danger",onClick:l[5]||(l[5]=a=>Re(e.value.reported.id)),"icon-left":"delete",size:"small"},{default:d(()=>[c(o(t(r)("Suspend the profile")),1)]),_:1})):e.value.reported.user&&!e.value.reported.user.disabled?(n(),b(p,{key:1,variant:"danger",onClick:l[6]||(l[6]=a=>Ce(e.value.reported.user)),"icon-left":"delete",size:"small"},{default:d(()=>[c(o(t(r)("Ban the account")),1)]),_:1})):v("",!0)])])):(n(),u("tr",ut,[i("td",null,o(t(r)("Reported identity")),1),i("td",null,o(t(r)("Unknown actor")),1)])),i("tr",null,[i("td",null,o(t(r)("Reported by")),1),e.value.reporter?.type===t(L).APPLICATION?(n(),u("td",it,o(e.value.reporter.domain),1)):e.value.reporter?.type===t(L).PERSON?(n(),u("td",dt,[m(k,{to:{name:t(f).ADMIN_PROFILE,params:{id:e.value.reporter.id}}},{default:d(()=>[e.value.reporter.avatar?(n(),u("img",{key:0,class:"image rounded-full",src:e.value.reporter.avatar.url,alt:""},null,8,ct)):v("",!0),c(" "+o(t(A)(e.value.reporter)),1)]),_:1},8,["to"])])):(n(),u("td",pt,o(t(r)("Unknown actor")),1))]),i("tr",null,[i("td",null,o(t(r)("Reported at")),1),i("td",null,o(t(Q)(e.value.insertedAt)),1)]),e.value.updatedAt!==e.value.insertedAt?(n(),u("tr",vt,[i("td",null,o(t(r)("Updated at")),1),i("td",null,o(t(Q)(e.value.updatedAt)),1)])):v("",!0),i("tr",null,[i("td",null,o(t(r)("Status")),1),i("td",null,[e.value.status===t(E).OPEN?(n(),u("span",mt,o(t(r)("Open")),1)):e.value.status===t(E).CLOSED?(n(),u("span",_t,o(t(r)("Closed")),1
1)):e.value.status===t(E).RESOLVED?(n(),u("span",ft,o(t(r)("Resolved")),1)):(n(),u("span",yt,o(t(r)("Unknown")),1))])])])])]),i("section",ht,[i("h2",bt,o(t(r)("Report reason")),1),i("div",kt,[i("div",Et,[e.value.reported?.avatar?(n(),u("figure",Rt,[i("img",{alt:"",src:e.value.reported.avatar.url,class:"rounded-full",width:"36",height:"36"},null,8,gt)])):(n(),b(Qe,{key:1,size:36})),e.value.reported?(n(),u("div",Ct,[e.value.reported?.name?(n(),u("p",Dt,o(e.value.reported.name),1)):v("",!0),i("p",wt,"@"+o(t(Fe)(e.value.reported)),1)])):(n(),u("p",Tt,o(t(r)("Unknown actor")),1))]),e.value.content?(n(),u("div",Ot,o(e.value.content),1)):(n(),u("p",St,o(t(r)("No comment")),1))])]),e.value.events&&e.value.events?.length>0&&e.value.comments.length===0?(n(),u("section",Nt,[i("h2",xt,o(t(r)("Reported content")),1),i("ul",null,[(n(!0),u(h,null,V(e.value.events,a=>(n(),u("li",{key:a.id},[m(Be,{event:a,mode:"row",class:"my-2 max-w-4xl"},null,8,["event"]),m(p,{variant:"danger",onClick:Te=>se(a),"icon-left":"delete"},{default:d(()=>[S.value?(n(),u(h,{key:0},[c(o(t(r)("Delete event and resolve report")),1)],64)):(n(),u(h,{key:1},[c(o(t(r)("Delete event")),1)],64))]),_:1},8,["onClick"])]))),128))])])):v("",!0),e.value.comments.length>0?(n(),u("section",At,[i("h2",Pt,o(t(r)("Reported content")),1),(n(!0),u(h,null,V(e.value.comments,a=>(n(),u("ul",{key:a.id},[i("li",null,[a.conversation&&a.event?(n(),u(h,{key:0},[m(M,{keypath:"Comment from an event announcement",tag:"p"},{eventTitle:d(()=>[m(k,{to:{name:t(f).EVENT,params:{uuid:a.event?.uuid}}},{default:d(()=>[i("b",null,o(a.event?.title),1)]),_:2},1032,["to"])]),_:2},1024),m(K,{modelValue:a,"current-actor":t(P),readOnly:!0},null,8,["modelValue","current-actor"])],64)):a.conversation?(n(),u(h,{key:1},[m(M,{keypath:"Comment from a private conversation",tag:"p"},{eventTitle:d(()=>[m(k,{to:{name:t(f).EVENT,params:{uuid:a.event?.uuid}}},{default:d(()=>[i("b",null,o(a.event?.title),1)]),_:2},1032,["to"])]),_:2},1024),m(K,{modelValue:a,"current-actor":t(P),readOnly:!0},null,8,["modelValue","current-actor"])],64)):(n(),u(h,{key:2},[m(M,{keypath:"Comment under event {eventTitle}",tag:"p"},{eventTitle:d(()=>[m(k,{to:{name:t(f).EVENT,params:{uuid:a.event?.uuid}}},{default:d(()=>[i("b",null,o(a.event?.title),1)]),_:2},1032,["to"])]),_:2},1024),m(We,{"root-comment":!0,comment:a,event:a.event,"current-actor":t(P),readOnly:!0},null,8,["comment","event","current-actor"])],64)),a.deletedAt?v("",!0):(n(),b(p,{key:3,variant:"danger",onClick:Te=>le(a),"icon-left":"delete"},{default:d(()=>[S.value?(n(),u(h,{key:0},[c(o(t(r)("Delete comment and resolve report")),1)],64)):(n(),u(h,{key:1},[c(o(t(r)("Delete comment")),1)],64))]),_:1},8,["onClick"]))])]))),128))])):v("",!0),e.value.events&&e.value.events?.length===0&&e.value.comments.length===0?(n(),u("section",Ut,[m(Ye,{inline:"",center:"",icon:"alert-circle"},{desc:d(()=>[c(o(t(r)("Maybe the content was removed by the author or a moderator")),1)]),default:d(()=>[c(o(t(r)("No content found"))+" ",1)]),_:1})])):v("",!0),i("section",It,[i("h2",Mt,o(t(r)("Notes")),1),(n(!0),u(h,null,V(e.value.notes,a=>(n(),u("div",{class:"",id:`note-${a.id}`,key:a.id},[i("p",null,o(a.content),1),m(k,{to:{name:t(f).ADMIN_PROFILE,params:{id:a.moderator.id}}},{default:d(()=>[a.moderator.avatar?(n(),u("img",{key:0,alt:"",class:"rounded-full",src:a.moderator.avatar.url},null,8,Lt)):v("",!0),c(" @"+o(a.moderator.preferredUsername),1)]),_:2},1032,["to"]),l[9]||(l[9]=i("br",null,null,-1)),i("small",null,[a.insertedAt?(n(),u("a",{key:0,href:`#note-${a.id}`},o(t(Q)(a.insertedAt)),9,qt)):v("",!0)])],8,Vt))),128)),i("form",{onSubmit:l[8]||(l[8]=a=>t(ne)({reportId:e.value?.id,content:U.value}))},[m(we,{label:t(r)("New note"),"label-for":"newNoteInput"},{default:d(()=>[m(De,{type:"textarea",modelValue:U.value,"onUpdate:modelValue":l[7]||(l[7]=a=>U.value=a),expanded:"",id:"newNoteInput"},null,8,["modelValue"])]),_:1},8,["label"]),m(p,{class:"mt-2",type:"submit"},{default:d(()=>[c(o(t(r)("Add a note")),1)]),_:1})],32)])])):v("",!0)],64)}}}),sr=Ge($t,[["__scopeId","data-v-cf433749"]]);export{sr as default};
2//# sourceMappingURL=ReportView-D-TNQ5T9.js.map

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.