1import{M as q}from"./CqEWJYYc.js";import{a4 as Z,i as n,a5 as O,M as J,x as ae,H as oe,c as ue,ap as ie,aa as de,d as re,a9 as $,at as U,l as D,J as T}from"./app-B8bCG1Di.js";import{b as G,a as I,c as E,w as K,g as c,l as g,C as t,j as e,H as i,A as u,q as l,s as a,z as S,h as H,_ as pe,B as C,M as F,N as L,i as z}from"./cXplQNgf.js";import{_ as ce,p as me}from"./FRpUAMqO.js";import{M as N}from"./C1YFT0Hp.js";import{M as P}from"./Bz2inri9.js";import{M as ge}from"./B3Nol2Ly.js";import"./C6RkJzSU.js";import"./cUf5VLk_.js";const ke={class:"_gaps_m"},be=G({__name:"mute-block.instance-mute",setup(A){const w=Z(),h=I(w.mutedInstances.join(` 2`)),v=E(()=>h.value.trim().split(` 3`).map(r=>r.trim().toLowerCase()).filter(r=>r)),x=I(!1);async function k(){if(!v.value.every(r=>/^\S+$/.test(r))){ae({type:"error",title:n.ts.invalidValue});return}await oe("i/update",{mutedInstances:v.value}),h.value=v.value.join(` 4`),x.value=!1}return K(v,(r,p)=>{(r.length!==p.length||!r.every((b,m)=>b===p[m]))&&(x.value=!0)}),(r,p)=>(c(),g("div",ke,[t(O,null,{default:e(()=>[i(u(l(n).ts._instanceMute.title),1)]),_:1}),t(q,{modelValue:h.value,"onUpdate:modelValue":p[0]||(p[0]=b=>h.value=b)},{label:e(()=>[i(u(l(n).ts._instanceMute.heading),1)]),caption:e(()=>[i(u(l(n).ts._instanceMute.instanceMuteDescription),1),p[2]||(p[2]=a("br",null,null,-1)),i(u(l(n).ts._instanceMute.instanceMuteDescription2),1)]),_:1},8,["modelValue"]),t(J,{primary:"",disabled:!x.value,onClick:p[1]||(p[1]=b=>k())},{default:e(()=>[p[3]||(p[3]=a("i",{class:"ph-floppy-disk ph-bold ph-lg"},null,-1)),i(" "+u(l(n).ts.save),1)]),_:1},8,["disabled"])]))}}),fe={class:"_gaps_m"},Q=G({__name:"mute-block.word-mute",props:{muted:{}},emits:["save"],setup(A,{emit:w}){const h=A,v=w,k=I((b=>b.map(m=>Array.isArray(m)?m.join(" "):m).join(` 5`))(h.muted)),r=I(!1);K(k,()=>{r.value=!0});async function p(){try{const b=me(k.value);v("save",b),r.value=!1}catch{return}}return(b,m)=>(c(),g("div",fe,[a("div",null,[t(q,{modelValue:k.value,"onUpdate:modelValue":m[0]||(m[0]=W=>k.value=W)},{caption:e(()=>[i(u(l(n).ts._wordMute.muteWordsDescription),1),m[2]||(m[2]=a("br",null,null,-1)),i(u(l(n).ts._wordMute.muteWordsDescription2),1)]),default:e(()=>[a("span",null,u(l(n).ts._wordMute.muteWords),1)]),_:1},8,["modelValue"])]),t(ce,{mutedWords:k.value},null,8,["mutedWords"]),t(J,{primary:"",inline:"",disabled:!r.value,onClick:m[1]||(m[1]=W=>p())},{default:e(()=>[m[3]||(m[3]=a("i",{class:"ph-floppy-disk ph-bold ph-lg"},null,-1)),i(" "+u(l(n).ts.save),1)]),_:1},8,["disabled"])]))}}),he={class:"_gaps_m"},ve={class:"_gaps_s"},_e={class:"_gaps_m"},Me={class:"_gaps_m"},ye={class:"_gaps_s"},Ie=["onClick"],we=["onClick"],xe={class:"_gaps_s"},Se=["onClick"],Pe=["onClick"],Te={key:0},Oe={key:1},We={class:"_gaps_s"},Ce=["onClick"],Ae=["onClick"],Be={key:0},Ve={key:1},He=G({__name:"mute-block",setup(A){const w=Z(),h={endpoint:"renote-mute/list",limit:10},v={endpoint:"mute/list",limit:10},x={endpoint:"blocking/list",limit:10},k=I([]),r=I([]),p=I([]),b=ue.model("showSoftWordMutedWord");async function m(d,s){D([{text:n.ts.renoteUnmute,icon:"ph-x ph-bold ph-lg",action:async()=>{await T("renote-mute/delete",{userId:d.id})}}],s.currentTarget??s.target)}async function W(d,s){D([{text:n.ts.unmute,icon:"ph-x ph-bold ph-lg",action:async()=>{await T("mute/delete",{userId:d.id})}}],s.currentTarget??s.target)}async function R(d,s){D([{text:n.ts.unblock,icon:"ph-x ph-bold ph-lg",action:async()=>{await T("blocking/delete",{userId:d.id})}}],s.currentTarget??s.target)}async function Y(d){k.value.includes(d.id)?k.value=k.value.filter(s=>s!==d.id):k.value.push(d.id)}async function X(d){r.value.includes(d.id)?r.value=r.value.filter(s=>s!==d.id):r.value.push(d.id)}async function ee(d){p.value.includes(d.id)?p.value=p.value.filter(s=>s!==d.id):p.value.push(d.id)}async function te(d){await T("i/update",{mutedWords:d})}async function se(d){await T("i/update",{hardMutedWords:d})}return E(()=>[]),E(()=>[]),ie(()=>({title:n.ts.muteAndBlock,icon:"ph-prohibit ph-bold ph-lg"})),(d,s)=>{const le=S("SearchKeyword"),_=S("SearchMarker"),ne=S("SearchLabel"),B=S("MkResult"),V=S("MkA"),j=S("MkTime");return c(),H(_,{path:"/settings/mute-block",label:l(n).ts.muteAndBlock,icon:"ph-prohibit ph-bold ph-lg",keywords:["mute","block"],markerId:"3icEvyv2D","data-in-app-search-marker-id":"3icEvyv2D",children:["lO3uFTkPN","jwx2zjzw2","1ZT7S9FZd","fAWaSKaYG","gPL7vnhah","oxhl1eSAS"]},{default:e(()=>[a("div",he,[t(ge,{icon:"/client-assets/prohibited_3d.png",color:"#ff2600"},{default:e(()=>[t(le,null,{default:e(()=>[i(u(l(n).ts._settings.muteAndBlockBanner),1)]),_:1})]),_:1}),a("div",ve,[t(_,{label:l(n).ts.wordMute,keywords:["note","word","soft","mute","hide"],markerId:"lO3uFTkPN","data-in-app-search-marker-id":"lO3uFTkPN",children:["yQbl6kpFP"]},{default:e(f=>[t(P,{defaultOpen:f.isParentOfTarget},{icon:e(()=>[...s[1]||(s[1]=[a("i",{class:"ph-envelope ph-bold ph-lg"},null,-1)])]),label:e(()=>[i(u(l(n).ts.wordMute),1)]),default:e(()=>[a("div",_e,[t(O,null,{default:e(()=>[i(u(l(n).ts.wordMuteDescription),1)]),_:1}),t(O,{warn:""},{default:e(()=>[i(u(l(n).ts.wordMuteWarning),1)]),_:1}),t(_,{label:l(n).ts.showMutedWord,keywords:["show"],markerId:"yQbl6kpFP","data-in-app-search-marker-id":"yQbl6kpFP"},{default:e(()=>[t(de,{modelValue:l(b),"onUpdate:modelValue":s[0]||(s[0]=y=>pe(b)?b.value=y:null)},{default:e(()=>[i(u(l(n).ts.showMutedWord),1)]),_:1},8,["modelValue"])]),_:1},8,["label"]),t(Q,{muted:l(w).mutedWords,onSave:te},null,8,["muted"])])]),_:1},8,["defaultOpen"])]),_:1},8,["label"]),t(_,{label:l(n).ts.hardWordMute,keywords:["note","word","hard","mute","hide"],markerId:"jwx2zjzw2","data-in-app-search-marker-id":"jwx2zjzw2"},{default:e(f=>[t(P,{defaultOpen:f.isParentOfTarget},{icon:e(()=>[...s[2]||(s[2]=[a("i",{class:"ph-x-square ph-bold ph-lg"},null,-1)])]),label:e(()=>[i(u(l(n).ts.hardWordMute),1)]),default:e(()=>[a("div",Me,[t(O,null,{default:e(()=>[i(u(l(n).ts.hardWordMuteDescription),1)]),_:1}),t(O,{warn:""},{default:e(()=>[i(u(l(n).ts.wordMuteWarning),1)]),_:1}),t(Q,{muted:l(w).hardMutedWords,onSave:se},null,8,["muted"])])]),_:1},8,["defaultOpen"])]),_:1},8,["label"]),t(_,{label:l(n).ts.instanceMute,keywords:["note","server","instance","host","federation","mute","hide"],markerId:"1ZT7S9FZd","data-in-app-search-marker-id":"1ZT7S9FZd"},{default:e(f=>[l(re).federation!=="none"?(c(),H(P,{key:0,defaultOpen:f.isParentOfTarget},{icon:e(()=>[...s[3]||(s[3]=[a("i",{class:"ph-globe-simple ph-bold ph-lg"},null,-1)])]),label:e(()=>[i(u(l(n).ts.instanceMute),1)]),default:e(()=>[t(be)]),_:1},8,["defaultOpen"])):C("",!0)]),_:1},8,["label"]),t(_,{keywords:["renote","mute","hide","user"],markerId:"fAWaSKaYG","data-in-app-search-marker-id":"fAWaSKaYG"},{default:e(f=>[t(P,{defaultOpen:f.isParentOfTarget},{icon:e(()=>[...s[4]||(s[4]=[a("i",{class:"ph-repeat ph-bold ph-lg"},null,-1)])]),label:e(()=>[t(ne,null,{default:e(()=>[i(u(l(n).ts.mutedUsers)+" ("+u(l(n).ts.renote)+")",1)]),_:1})]),default:e(()=>[t($,{pagination:h},{empty:e(()=>[t(B,{type:"empty",text:l(n).ts.noUsers},null,8,["text"])]),default:e(({items:y})=>[a("div",ye,[(c(!0),g(F,null,L(y,o=>(c(),g("div",{key:o.mutee.id,class:z(["pages-settings-mute-block-userItem-7TV5",{"pages-settings-mute-block-userItemOpend-3Q9d":k.value.includes(o.id)}])},[a("div",{class:"pages-settings-mute-block-userItemMain-mdJf"},[t(V,{class:"pages-settings-mute-block-userItemMainBody-1veP",to:l(U)(o.mutee)},{default:e(()=>[t(N,{user:o.mutee},null,8,["user"])]),_:2},1032,["class","to"]),a("button",{class:"_button pages-settings-mute-block-userToggle-1Ij3",onClick:M=>Y(o)},[a("i",{class:"pages-settings-mute-block-chevron-xGgI ph-caret-down ph-bold ph-lg"},null,2)],10,Ie),a("button",{class:"_button pages-settings-mute-block-remove-pHxb",onClick:M=>m(o.mutee,M)},[...s[5]||(s[5]=[a("i",{class:"ph-x ph-bold ph-lg"},null,-1)])],10,we)],2),k.value.includes(o.id)?(c(),g("div",{key:0,class:"pages-settings-mute-block-userItemSub-1qE4"},[a("div",null,[s[6]||(s[6]=i("Muted at: ",-1)),t(j,{time:o.createdAt,mode:"detail"},null,8,["time"])])],2)):C("",!0)],2))),128))])]),_:1})]),_:1},8,["defaultOpen"])]),_:1}),t(_,{label:l(n).ts.mutedUsers,keywords:["note","mute","hide","user"],markerId:"gPL7vnhah","data-in-app-search-marker-id":"gPL7vnhah"},{default:e(f=>[t(P,{defaultOpen:f.isParentOfTarget},{icon:e(()=>[...s[7]||(s[7]=[a("i",{class:"ph-eye-slash ph-bold ph-lg"},null,-1)])]),label:e(()=>[i(u(l(n).ts.mutedUsers),1)]),default:e(()=>[t($,{pagination:v},{empty:e(()=>[t(B,{type:"empty",text:l(n).ts.noUsers},null,8,["text"])]),default:e(({items:y})=>[a("div",xe,[(c(!0),g(F,null,L(y,o=>(c(),g("div",{key:o.mutee.id,class:z(["pages-settings-mute-block-userItem-7TV5",{"pages-settings-mute-block-userItemOpend-3Q9d":r.value.includes(o.id)}])},[a("div",{class:"pages-settings-mute-block-userItemMain-mdJf"},[t(V,{class:"pages-settings-mute-block-userItemMainBody-1veP",to:l(U)(o.mutee)},{default:e(()=>[t(N,{user:o.mutee},null,8,["user"])]),_:2},1032,["class","to"]),a("button",{class:"_button pages-settings-mute-block-userToggle-1Ij3",onClick:M=>X(o)},[a("i",{class:"pages-settings-mute-block-chevron-xGgI ph-caret-down ph-bold ph-lg"},null,2)],10,Se),a("button",{class:"_button pages-settings-mute-block-remove-pHxb",onClick:M=>W(o.mutee,M)},[...s[8]||(s[8]=[a("i",{class:"ph-x ph-bold ph-lg"},null,-1)])],10,Pe)],2),r.value.includes(o.id)?(c(),g("div",{key:0,class:"pages-settings-mute-block-userItemSub-1qE4"},[a("div",null,[s[9]||(s[9]=i("Muted at: ",-1)),t(j,{time:o.createdAt,mode:"detail"}
5,null,8,["time"])]),o.expiresAt?(c(),g("div",Te,"Period: "+u(new Date(o.expiresAt).toLocaleString()),1)):(c(),g("div",Oe,"Period: "+u(l(n).ts.indefinitely),1))],2)):C("",!0)],2))),128))])]),_:1})]),_:1},8,["defaultOpen"])]),_:1},8,["label"]),t(_,{label:l(n).ts.blockedUsers,keywords:["block","user"],markerId:"oxhl1eSAS","data-in-app-search-marker-id":"oxhl1eSAS"},{default:e(f=>[t(P,{defaultOpen:f.isParentOfTarget},{icon:e(()=>[...s[10]||(s[10]=[a("i",{class:"ph-prohibit ph-bold ph-lg"},null,-1)])]),label:e(()=>[i(u(l(n).ts.blockedUsers),1)]),default:e(()=>[t($,{pagination:x},{empty:e(()=>[t(B,{type:"empty",text:l(n).ts.noUsers},null,8,["text"])]),default:e(({items:y})=>[a("div",We,[(c(!0),g(F,null,L(y,o=>(c(),g("div",{key:o.blockee.id,class:z(["pages-settings-mute-block-userItem-7TV5",{"pages-settings-mute-block-userItemOpend-3Q9d":p.value.includes(o.id)}])},[a("div",{class:"pages-settings-mute-block-userItemMain-mdJf"},[t(V,{class:"pages-settings-mute-block-userItemMainBody-1veP",to:l(U)(o.blockee)},{default:e(()=>[t(N,{user:o.blockee},null,8,["user"])]),_:2},1032,["class","to"]),a("button",{class:"_button pages-settings-mute-block-userToggle-1Ij3",onClick:M=>ee(o)},[a("i",{class:"pages-settings-mute-block-chevron-xGgI ph-caret-down ph-bold ph-lg"},null,2)],10,Ce),a("button",{class:"_button pages-settings-mute-block-remove-pHxb",onClick:M=>R(o.blockee,M)},[...s[11]||(s[11]=[a("i",{class:"ph-x ph-bold ph-lg"},null,-1)])],10,Ae)],2),p.value.includes(o.id)?(c(),g("div",{key:0,class:"pages-settings-mute-block-userItemSub-1qE4"},[a("div",null,[s[12]||(s[12]=i("Blocked at: ",-1)),t(j,{time:o.createdAt,mode:"detail"},null,8,["time"])]),o.expiresAt?(c(),g("div",Be,"Period: "+u(new Date(o.expiresAt).toLocaleString()),1)):(c(),g("div",Ve,"Period: "+u(l(n).ts.indefinitely),1))],2)):C("",!0)],2))),128))])]),_:1})]),_:1},8,["defaultOpen"])]),_:1},8,["label"])])])]),_:1},8,["label"])}}});export{He 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.