phanpy-cz/assets/main-B7dDrG0m.js

35 lines
292 KiB
JavaScript
Raw Normal View History

2024-12-30 07:44:29 +01:00
import{A as j,y as ne,u as ue,h as $,s as A,a as le,b as Je,M as ct,c as Ve,d as e,T as h,e as we,g as St,p as Nt,f as Sn,k as O,C as Pn,L as uo,i as Te,D as ho,j as fo,m as Kn,n as Wt,o as Ct,q as rt,r as he,t as po,v as Be,w as _n,x as Ii,_ as yt,z as ds,B as ad,E as us,F as hs,G as mo,H as go,I as ot,J as bo,K as si,N as gt,O as yo,P as vo,Q as wo,R as oi,S as Et,U as et,V as fs,W as ps,X as ko,Y as sn,Z as So,$ as _o,a0 as On,a1 as zn,a2 as Co,a3 as Ti,a4 as Io,a5 as To,a6 as xo,a7 as ci,a8 as Ge,a9 as Ao,aa as Eo,ab as Ro,ac as Lo}from"./useTitle-jLgT0T3g.js";import{u as ai,s as me,a as He,o as xi,b as $o,I as T,M as Ye,A as ht,N as pt,c as lt,d as Ie,e as qe,f as Ze,g as ut,L as ge,l as xt,h as ms,t as Ai,i as Qe,R as Zt,p as ld,j as it,k as Pt,m as dt,n as gs,q as Gn,E as bs,r as Xe,v as mt,w as Mo,S as Rn,x as Ei,T as ys,y as ft,z as ri,B as Ke,C as _t,D as Do,F as No,G as $t,H as li,J as vs,K as Po,O as Yt,P as Oo,Q as zo,U as ws,V as Uo,W as Bo,X as ks,Y as Fo,Z as Mt,_ as di,$ as Ho,a0 as Ss,a1 as qo,a2 as _s,a3 as Yo,a4 as jo,a5 as Vo,a6 as Ri,a7 as Ko,a8 as Bt}from"./fuse-1Fw6A_G2.js";var Cs=Go;function Go(n,i,s){var o=null,c=null,r=function(){o&&(clearTimeout(o),c=null,o=null)},u=function(){var d=c;r(),d&&d()},l=function(){if(!i)return n.apply(this,arguments);var d=this,a=arguments,m=s&&!o;if(r(),c=function(){n.apply(d,a)},o=setTimeout(function(){if(o=null,!m){var b=c;return c=null,b()}},i),m)return c()};return l.cancel=r,l.flush=u,l}/*!
* swiped-events.js - v@version@
* Pure JavaScript swipe events
* https://github.com/john-doherty/swiped-events
* @inspiration https://stackoverflow.com/questions/16348031/disable-scrolling-when-touch-moving-certain-element
* @author John Doherty <www.johndoherty.info>
* @license MIT
*/(function(n,i){"use strict";typeof n.CustomEvent!="function"&&(n.CustomEvent=function(p,f){f=f||{bubbles:!1,cancelable:!1,detail:void 0};var y=i.createEvent("CustomEvent");return y.initCustomEvent(p,f.bubbles,f.cancelable,f.detail),y},n.CustomEvent.prototype=n.Event.prototype),i.addEventListener("touchstart",m,!1),i.addEventListener("touchmove",b,!1),i.addEventListener("touchend",a,!1);var s=null,o=null,c=null,r=null,u=null,l=null,d=0;function a(p){if(l===p.target){var f=parseInt(g(l,"data-swipe-threshold","20"),10),y=g(l,"data-swipe-unit","px"),v=parseInt(g(l,"data-swipe-timeout","500"),10),w=Date.now()-u,S="",k=p.changedTouches||p.touches||[];if(y==="vh"&&(f=Math.round(f/100*i.documentElement.clientHeight)),y==="vw"&&(f=Math.round(f/100*i.documentElement.clientWidth)),Math.abs(c)>Math.abs(r)?Math.abs(c)>f&&w<v&&(c>0?S="swiped-left":S="swiped-right"):Math.abs(r)>f&&w<v&&(r>0?S="swiped-up":S="swiped-down"),S!==""){var _={dir:S.replace(/swiped-/,""),touchType:(k[0]||{}).touchType||"direct",fingers:d,xStart:parseInt(s,10),xEnd:parseInt((k[0]||{}).clientX||-1,10),yStart:parseInt(o,10),yEnd:parseInt((k[0]||{}).clientY||-1,10)};l.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:_})),l.dispatchEvent(new CustomEvent(S,{bubbles:!0,cancelable:!0,detail:_}))}s=null,o=null,u=null}}function m(p){p.target.getAttribute("data-swipe-ignore")!=="true"&&(l=p.target,u=Date.now(),s=p.touches[0].clientX,o=p.touches[0].clientY,c=0,r=0,d=p.touches.length)}function b(p){if(!(!s||!o)){var f=p.touches[0].clientX,y=p.touches[0].clientY;c=s-f,r=o-y}}function g(p,f,y){for(;p&&p!==i.documentElement;){var v=p.getAttribute(f);if(v)return v;p=p.parentNode}return y}})(window,document);function jt(n=()=>{},i=[]){const s=j(n);ne(()=>{s.current=n},[i]),ne(()=>{const o=()=>{const c=document.hidden||document.visibilityState==="hidden";s.current(!c)};return document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)},[])}const Wo=1e3*3,Li=2e4,Zo=ct(function({isLoggedIn:i}){const{_:s}=ue(),[o,c]=$(!0),r=j();jt(a=>{clearTimeout(r.current),a?c(!0):r.current=setTimeout(()=>{c(!1)},Li)});const u=async(a,m,b)=>{var g;if(A.notificationsLast){const p=a.v1.notifications.list({limit:1,sinceId:A.notificationsLast.id}),{value:f}=await p.next();if(f!=null&&f.length)if(b)A.notificationsShowNew=!0;else{let y;try{const v=await a.v1.markers.fetch({timeline:"notifications"});y=(g=v==null?void 0:v.notifications)==null?void 0:g.lastReadId}catch{}y?A.notificationsShowNew=f[0].id!==y:A.notificationsShowNew=!0}}};ne(()=>{let a,m,b;if(i&&o){const{masto:g,streaming:p,instance:f}=le();(async()=>{await u(g,f);let y=!1;p&&(m=setTimeout(()=>{(async()=>{try{y=!0,a=p.user.notification.subscribe();for await(const v of a){if(!a||!o)break;v.event==="notification"&&Je(v.payload,f,{skipThreading:!0}),A.notificationsShowNew=!0}}catch{y=!1}y||(b=setInterval(()=>{u(g,f,!0)},Li))})()},Wo))})()}return()=>{var g;(g=a==null?void 0:a.unsubscribe)==null||g.call(a),a=null,clearTimeout(m),clearInterval(b)}},[o,i]);const l=j(),d=()=>{l.current=Date.now(),fetch("./version.json").then(a=>a.json()).then(a=>{a&&(A.appVersion=a)}).catch(a=>{})};return ai(d,o&&1e3*60*30),jt(a=>{a&&(l.current?Date.now()-l.current>1e3*60*60&&d():d())}),He("shift+alt+k",()=>{const a=A.settings.cloakMode;A.settings.cloakMode=!a,me({text:s(a?{id:"oguMwa"}:{id:"IXZLPs"})})}),null});function Xo(){const{_:n}=ue(),i=Ve(A);function s(o){if(i.composerState.minimized){A.composerState.minimized=!1,xi();return}o.shiftKey?$o()||(A.showCompose=!0):(xi(),A.showCompose=!0)}return He("c, shift+c",s,{ignoreEventWhen:o=>!!document.querySelector("#modal-container > *")}),e("button",{type:"button",id:"compose-button",onClick:s,class:`${i.composerState.minimized?"min":""} ${i.composerState.publishing?"loading":""} ${i.composerState.publishingError?"error":""}`,children:e(T,{icon:"quill",size:"xl",alt:n({id:"QOhkyl"})})})}const Jo=ct(function(){const{_:i}=ue(),s=Ve(A);function o(){A.showKeyboardShortcutsHelp=!1}return He("?, shift+?, shift+slash",c=>{A.showKeyboardShortcutsHelp=!0},{ig
${Ei(l)}`).join(`
`))||"",r=Ei(n)+(c?`
${c}`:"");return e("div",{class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"9groMz"})})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:r}),e(ys,{forceTranslate:!0,text:r})]})]})}function qc({accountID:n,onClose:i}){const{_:s}=ue(),{masto:o}=le(),[c,r]=$("default"),[u,l]=$([]),[d,a]=$([]),[m,b]=Nt(f=>f+1,0);ne(()=>{r("loading"),(async()=>{try{const f=await rn();l(f);const y=await o.v1.accounts.$select(n).lists.list();a(y),r("default")}catch{r("error")}})()},[m]);const[g,p]=$(!1);return e("div",{class:"sheet",id:"list-add-remove-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"sJ2yQc"})})}),e("main",{children:[u.length>0?e("ul",{class:"list-add-remove",children:u.map(f=>{const y=d.some(v=>v.id===f.id);return e("li",{children:e("button",{type:"button",class:`light ${y?"checked":""}`,disabled:c==="loading",onClick:()=>{r("loading"),(async()=>{try{y?await o.v1.lists.$select(f.id).accounts.remove({accountIds:[n]}):await o.v1.lists.$select(f.id).accounts.create({accountIds:[n]}),b()}catch{r("error"),alert(s(y?{id:"7KnEYa"}:{id:"Tba8uO"}))}})()},children:[e(T,{icon:"check-circle",alt:"☑️"}),e("span",{children:f.title})]})})})}):c==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):c==="error"?e("p",{class:"ui-state",children:e(h,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(h,{id:"/MJ7gZ"})}),e("button",{type:"button",class:"plain2",onClick:()=>p(!0),disabled:c!=="default",children:[e(T,{icon:"plus",size:"l"})," ",e("span",{children:e(h,{id:"Sb2gYF"})})]})]}),g&&e(Ye,{onClick:f=>{f.target===f.currentTarget&&p(!1)},children:e(vi,{list:g==null?void 0:g.list,onClose:f=>{f.state==="success"&&b(),p(!1)}})})]})}function Yc({account:n,note:i,onRelationshipChange:s=()=>{},onClose:o=()=>{}}){const{_:c}=ue(),{masto:r}=le(),[u,l]=$("default"),d=j(null);return ne(()=>{let a;return d.current&&!i&&(a=setTimeout(()=>{var m,b;(b=(m=d.current).focus)==null||b.call(m)},100)),()=>{clearTimeout(a)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!o&&e("button",{type:"button",class:"sheet-close",onClick:o,children:e(T,{icon:"x",alt:c({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(h,{id:"DYqYm5",values:{0:(n==null?void 0:n.username)||(n==null?void 0:n.acct)},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:e("form",{onSubmit:a=>{a.preventDefault();const b=new FormData(a.target).get("note");(b==null?void 0:b.trim())!==(i==null?void 0:i.trim())&&(l("loading"),(async()=>{try{const g=await r.v1.accounts.$select(n==null?void 0:n.id).note.create({comment:b});l("default"),s(g),o()}catch(g){l("error"),alert((g==null?void 0:g.message)||c({id:"ot8LpF"}))}})())},children:[e("textarea",{ref:d,name:"note",disabled:u==="loading",dir:"auto",children:i}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:u==="loading",onClick:()=>{o==null||o()},children:e(h,{id:"dEgA5A"})}),e("span",{children:[e(Be,{abrupt:!0,hidden:u!=="loading"}),e("button",{disabled:u==="loading",type:"submit",children:e(h,{id:"SrwrEj"})})]})]})]})})]})}function jc({onClose:n=()=>{}}){const{_:i}=ue(),{masto:s}=le(),[o,c]=$("loading"),[r,u]=$(null);ne(()=>{(async()=>{try{const g=await s.v1.accounts.verifyCredentials();u(g),c("default")}catch{c("error")}})()},[]);const{displayName:l,source:d}=r||{},{note:a,fields:m}=d||{},b=j(null);return e("div",{class:"sheet",id:"edit-profile-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(h,{id:"9OpVZg"})})}),e("main",{children:o==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("form",{onSubmit:g=>{g.preventDefault();const p=new FormData(g.target),f=p.get("display_name"),y=p.get("note"),v=b.current.querySelectorAll('input[name^="fields_attributes"]'),w=[];
rgb(${(Z=D.light)==null?void 0:Z.join(",")}) ${ee}%,
rgb(${(B=D.light)==null?void 0:B.join(",")}) ${W}%
`,dark:`
rgb(${(Y=D.dark)==null?void 0:Y.join(",")}) ${ee}%,
rgb(${(ce=D.dark)==null?void 0:ce.join(",")}) ${W}%
`}:{light:`
transparent ${ee}%,
transparent ${W}%
`,dark:`
transparent ${ee}%,
transparent ${W}%
`}}),L=E.map(D=>D.light).join(", "),z=E.map(D=>D.dark).join(", ");return{light:L,dark:z}},[w]);let k=j(null);return ne(()=>()=>{var C,I;(I=(C=k.current)==null?void 0:C.hideToast)==null||I.call(C)},[]),yt(()=>{const C=w[m];let I,E;if(C){const L=we.local.get("theme");if(L){const z=`rgb(${C[L].join(",")})`;I=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),I&&(E=I.content,I.content=z)}else{const z=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",D=`rgb(${C[z].join(",")})`;I=document.querySelector(`meta[name="theme-color"][media*="${z}"]`),I&&(E=I.content,I.content=D)}}return()=>{I&&E&&(I.content=E)}},[m,w]),e("div",{class:`media-modal-container media-modal-count-${n==null?void 0:n.length}`,children:[e("div",{ref:a,tabIndex:"0","data-swipe-threshold":"44",class:"carousel",onClick:C=>{(C.target.classList.contains("carousel-item")||C.target.classList.contains("media")||C.target.classList.contains("media-zoom"))&&r()},style:n.length>1?{backgroundAttachment:"local","--accent-gradient-light":S==null?void 0:S.light,"--accent-gradient-dark":S==null?void 0:S.dark}:{},children:n==null?void 0:n.map((C,I)=>{var L,z;const E=n.length===1?w[I]:null;return e("div",{class:"carousel-item",style:E?{"--accent-color":`rgb(${E.default.join(",")})`,"--accent-light-color":`rgb(${(L=E.light)==null?void 0:L.join(",")})`,"--accent-dark-color":`rgb(${(z=E.dark)==null?void 0:z.join(",")})`,"--accent-alpha-color":`rgba(${E.default.join(",")}, 0.4)`}:{},tabindex:"0",ref:I===m?g:null,onClick:D=>{D.target.classList.contains("media")||y(!f)},children:[!!C.description&&e("button",{type:"button",class:"media-alt",hidden:!f,onClick:()=>{A.showMediaAlt={alt:C.description,lang:o}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:o,dir:"auto",children:C.description})]}),e(vs,{media:C,showOriginal:!0,lang:o})]},C.id)})}),e("div",{class:"carousel-top-controls",hidden:!f,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>r(),children:e(T,{icon:"x",alt:u({id:"yz7wBu"})})})}),(n==null?void 0:n.length)>1?e("span",{class:"carousel-dots",children:n==null?void 0:n.map((C,I)=>e("button",{type:"button",disabled:I===m,class:`carousel-dot ${I===m?"active":""}`,onClick:E=>{E.preventDefault(),E.stopPropagation();const L=a.current.clientWidth*I*($t()?-1:1);a.current.focus(),a.current.scrollTo({left:L,behavior:"smooth"})},children:e(T,{icon:"round",size:"s",alt:"⸱"})},C.id))}):e("span",{}),e("span",{children:[e(lt,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(T,{icon:"more",alt:u({id:"2FYpfJ"})})}),children:[e(qe,{href:((_=n[m])==null?void 0:_.remoteUrl)||((x=n[m])==null?void 0:x.url),class:"carousel-button",target:"_blank",title:u({id:"5hXGws"}),children:[e(T,{icon:"popout"}),e("span",{children:e(h,{id:"aDr7Vc"})})]}),!1]})," ",e(ge,{to:`${s?`/${s}`:""}/s/${i}${window.matchMedia("(min-width: calc(40em + 350px))").matches?`?media=${m+1}`:""}`,class:"button carousel-button media-post-link",children:[e("span",{class:"button-label",children:[e(h,{id:"ISg5SQ"})," "]}),"»"]})]})]}),(n==null?void 0:n.length)>1&&e("div",{class:"carousel-controls",hidden:!f,children:[e("button",{type:"button",class:"carousel-button",hidden:m===0,onClick:C=>{C.preventDefault(),C.stopPropagation(),a.current.focus(),a.current.scrollTo({left:a.current.clientWidth*(m-1)*($t()?-1:1),behavior:"smooth"})},children:e(T,{icon:"arrow-left",alt:u({id:"DHhJ7s"})})}),e("button",{type:"button",class:"carousel-button",hidden:m===n.length-1,onClick:C=>{C.preventDefault(),C.stopPropagation(),a.current.focus(),a.current.scrollTo({left:a.current.clientWidth*(m+1)*($t()?-1:1),behavior:"smooth"})},children:e(T,{icon:"arrow-right",alt:u({id:"hXzOVo"})})})]})]})}const ga=[,"spam","legal","violation","other"],Jt={spam:{label:{id:"t8dIOP"},description:{id:"csQin/"}},legal:{label:{id:"IjKdHM"},description:{id:"e6tGFu"}},violation:{label:{id:"KPFHM2"},description:{id:"fpotTF"
<phanpy-shortcuts-settings>${S}</phanpy-shortcuts-settings>`,me(he._({id:"9ZYiLz"})),await o.v1.accounts.$select(p).note.create({comment:w}),d("default"),me(he._({id:"5w02SH"}))}}catch{d("error"),me(he._({id:"aVsTYo"}))}},title:he._({id:"gWd6Cu"}),children:[e(T,{icon:"cloud"}),e(T,{icon:"arrow-up"})]})," ",c.length>0&&e("small",{class:"insignificant ib",children:e(h,{id:"IPXOXm",values:{0:c.length}})})]}),!!c&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:e(h,{id:"e5E+WH"})})}),e("textarea",{style:{width:"100%"},rows:10,readOnly:!0,children:JSON.stringify(n.filter(Boolean),null,2)})]})]}),A.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(T,{icon:"cloud"})," ",e(h,{id:"C4T6O/"})]})})]})]})}us(A,n=>{for(const[i,s,o,c]of n)/^show/i.test(s)&&!o&&Xn()});function $a(){var c,r,u,l,d,a,m,b;const{_:n}=ue(),i=Ve(A),s=hs(),o=Wt();return ne(()=>{setTimeout(mo,1e3)},[]),e(O,{children:[!!i.showCompose&&e(Ye,{class:`solid ${i.composerState.minimized?"min":""}`,minimized:!!i.composerState.minimized,children:e(go,{replyToStatus:typeof i.showCompose!="boolean"?i.showCompose.replyToStatus:((c=window.__COMPOSE__)==null?void 0:c.replyToStatus)||null,editStatus:((r=A.showCompose)==null?void 0:r.editStatus)||((u=window.__COMPOSE__)==null?void 0:u.editStatus)||null,draftStatus:((l=A.showCompose)==null?void 0:l.draftStatus)||((d=window.__COMPOSE__)==null?void 0:d.draftStatus)||null,onClose:g=>{const{newStatus:p,instance:f,type:y}=g||{};A.showCompose=!1,window.__COMPOSE__=null,p&&(A.reloadStatusPage++,me({text:{post:n({id:"aTyHBW"}),reply:n({id:"lZdBKl"}),edit:n({id:"a5BN7l"})}[y||"post"],delay:1e3,duration:1e4,onClick:v=>{v.hideToast(),A.prevLocation=o,s(f?`/${f}/s/${p.id}`:`/s/${p.id}`)}}))}})}),!!i.showSettings&&e(Ye,{onClose:()=>{A.showSettings=!1},children:e(Ic,{onClose:()=>{A.showSettings=!1}})}),!!i.showAccounts&&e(Ye,{onClose:()=>{A.showAccounts=!1},children:e(pc,{onClose:()=>{A.showAccounts=!1}})}),!!i.showAccount&&e(Ye,{onClose:()=>{A.showAccount=!1},children:e(Gc,{account:((a=i.showAccount)==null?void 0:a.account)||i.showAccount,instance:(m=i.showAccount)==null?void 0:m.instance,onClose:({destination:g}={})=>{A.showAccount=!1}})}),!!i.showDrafts&&e(Ye,{onClose:()=>{A.showDrafts=!1},children:e(Wc,{onClose:()=>A.showDrafts=!1})}),!!i.showMediaModal&&e(Ye,{onClick:g=>{(g.target===g.currentTarget||g.target.classList.contains("media"))&&(A.showMediaModal=!1)},children:e(Us,{mediaAttachments:i.showMediaModal.mediaAttachments,instance:i.showMediaModal.instance,index:i.showMediaModal.index,statusID:i.showMediaModal.statusID,onClose:()=>{A.showMediaModal=!1}})}),!!i.showShortcutsSettings&&e(Ye,{onClose:()=>{A.showShortcutsSettings=!1},children:e(Ea,{onClose:()=>A.showShortcutsSettings=!1})}),!!i.showGenericAccounts&&e(Ye,{onClose:()=>{A.showGenericAccounts=!1},children:e(Jc,{instance:i.showGenericAccounts.instance,excludeRelationshipAttrs:i.showGenericAccounts.excludeRelationshipAttrs,postID:i.showGenericAccounts.postID,onClose:()=>A.showGenericAccounts=!1,blankCopy:i.showGenericAccounts.blankCopy})}),!!i.showMediaAlt&&e(Ye,{onClose:g=>{A.showMediaAlt=!1},children:e(Qc,{alt:i.showMediaAlt.alt||i.showMediaAlt,lang:(b=i.showMediaAlt)==null?void 0:b.lang,onClose:()=>{A.showMediaAlt=!1}})}),!!i.showEmbedModal&&e(Ye,{class:"solid",onClose:()=>{A.showEmbedModal=!1},children:e(Xc,{html:i.showEmbedModal.html,url:i.showEmbedModal.url,width:i.showEmbedModal.width,height:i.showEmbedModal.height,onClose:()=>{A.showEmbedModal=!1}})}),!!i.showReportModal&&e(Ye,{onClose:()=>{A.showReportModal=!1},children:e(ba,{account:i.showReportModal.account,post:i.showReportModal.post,onClose:()=>{A.showReportModal=!1}})})]})}function Qn({accountID:n,onChange:i}){const{_:s}=ue(),{masto:o}=le(),[c,r]=$("default"),[u,l]=$(null),[d,a]=$(null),m=d!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:c==="loading"||m,onClick:()=>{r("loading"),l("accept"),(async()=>{try{const b=await o.v1.followRequests.$select(n).authorize();if(!(b!=null&&b.followedBy))thro
media-post
${Q?"filtered":""}
${ke?"has-spoiler":""}
${fe?"show-media":""}
`,children:e(vs,{class:n,media:Se,lang:Z,to:`/${o}/s/${k}?media-only=${P+1}`,onClick:r?N=>r(N,P,Se,s):void 0})},te)})}const Gi=ct(Va);function Ka(n){var k,_,x,C,I;const{_:i}=ue(),s=Ve(A),{masto:o,instance:c,authenticated:r}=le(),[u,l]=Te(()=>{const E=we.local.getJSON("accounts")||[];return[E.find(z=>z.info.id===St())||E[0],E.length>1]},[]),d=(s.settings.shortcutsViewMode==="multi-column"||!s.settings.shortcutsViewMode&&s.settings.shortcutsColumnsMode)&&!s.shortcuts.find(E=>E.type==="following"),a=Uo(()=>{A.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),m=j(),[b,g]=$(void 0),p=Bo([0,0,s.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),f=j();async function y(E){return(E||!f.current)&&(f.current=o.v1.mutes.list({limit:80})),await f.current.next()}const v=j();async function w(E){return(E||!v.current)&&(v.current=o.v1.blocks.list({limit:80})),await v.current.next()}const S=j();return e(O,{children:[e("button",{ref:m,type:"button",class:`button plain nav-menu-button ${l?"with-avatar":""} ${b==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{S.current=Date.now(),g(E=>E?void 0:"open")},onContextMenu:E=>{E.preventDefault(),A.showAccounts=!0},...a(),children:[l&&e(ht,{url:((k=u==null?void 0:u.info)==null?void 0:k.avatar)||((_=u==null?void 0:u.info)==null?void 0:_.avatarStatic),size:"l",squircle:(x=u==null?void 0:u.info)==null?void 0:x.bot}),e(T,{icon:"menu",size:l?"s":"l",alt:i({id:"zucql+"})})]}),e(ks,{menuClassName:"nav-menu",state:b,anchorRef:m,onClose:()=>{g(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-S.current<300}},portal:{target:document.body},...n,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:p,unmountOnClose:!0,children:[!!((C=s.appVersion)!=null&&C.commitHash)&&s.appVersion.commitHash!=="119d4b0"&&e("div",{class:"top-menu",children:[e(Ie,{onClick:()=>{confirm(i({id:"Djbaby"}))&&(async()=>{try{location.reload()}catch{}})()},children:[e(T,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:e(h,{id:"95IFnD"})})]}),e(Ze,{})]}),e("section",{children:[e(qe,{to:"/",children:[e(T,{icon:"home",size:"l"})," ",e("span",{children:e(h,{id:"i0qMbr"})})]}),r?e(O,{children:[d&&e(qe,{to:"/following",children:[e(T,{icon:"following",size:"l"})," ",e("span",{children:e(h,{id:"following.title"})})]}),e(qe,{to:"/catchup",children:[e(T,{icon:"history2",size:"l"}),e("span",{children:e(h,{id:"xrl8fj"})})]}),Qe("@mastodon/mentions")&&e(qe,{to:"/mentions",children:[e(T,{icon:"at",size:"l"})," ",e("span",{children:e(h,{id:"/bZzdR"})})]}),e(qe,{to:"/notifications",children:[e(T,{icon:"notification",size:"l"})," ",e("span",{children:e(h,{id:"iDNBZe"})}),s.notificationsShowNew&&e("sup",{title:i({id:"isRobC"}),style:{opacity:.5},children:[" ","•"]})]}),e(Ze,{}),((I=u==null?void 0:u.info)==null?void 0:I.id)&&e(qe,{to:`/${c}/a/${u.info.id}`,children:[e(T,{icon:"user",size:"l"})," ",e("span",{children:e(h,{id:"vERlcd"})})]}),e(Ga,{menuState:b}),e(qe,{to:"/b",children:[e(T,{icon:"bookmark",size:"l"})," ",e("span",{children:e(h,{id:"7Ff7ia"})})]}),e(Rn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(O,{children:[e(T,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:e(h,{id:"24misb"})}),e(T,{icon:"chevron-right"})]}),children:[e(qe,{to:"/f",children:[e(T,{icon:"heart",size:"l"})," ",e("span",{children:e(h,{id:"zZOZj7"})})]}),e(qe,{to:"/fh",children:[e(T,{icon:"hashtag",size:"l"})," ",e("span",{children:e(h,{id:"Xi1/bw"})})]}),e(Ze,{}),Qe("@mastodon/filters")&&e(qe,{to:"/ft",children:[e(T,{icon:"filters",size:"l"})," ",e("span",{children:e(h,{id:"cSev+j"})})]}),e(Ie,{onClick:()=>{A.showGenericAccounts={id:"mute",heading:i({id:"sOKhEA"}),fetchAccounts:y,excludeRelationshipAttrs:["muting"]}},children:[e(T,{icon:"mute",size:"l"})," ",e("span",{children:e(h,{id:"n1sANU"})})]}),e(Ie,{onClick:()=>{A.showGenericAccounts={id:"block",heading:i({id:"nL8nlr"}),fetchAccounts:w,excludeRelationshipAttrs:["blocking"]}},children:[e(T,{icon:"block",size:"l"})," ",e("span",{children:e(h,{id:"r3RRWo"})})]})," "]}),e(Ze,{})
//# sourceMappingURL=main-B7dDrG0m.js.map