phanpy-cz/assets/main-DaGMLi0n.js

30 lines
280 KiB
JavaScript
Raw Permalink Normal View History

2024-10-08 17:16:36 +00:00
import{A as q,y as ee,h as L,s as A,a as oe,b as Ke,i as g,C as it,u as He,c as e,T as u,d as ge,g as vt,p as $t,e as gn,f as B,j as Je,k as En,L as Xs,l as ke,D as Js,m as Qs,o as Fn,q as Yt,r as kt,t as ot,v as eo,w as Ne,x as bn,z as vi,_ as yt,B as Qi,E as Al,F as es,G as ts,H as to,I as no,J as nt,K as io,M as Zn,N as ht,O as so,P as oo,Q as co,R as Xn,S as Mt,U as We,V as ns,W as is,X as ao,Y as Qt,Z as ro,$ as lo,a0 as Rn,a1 as Ln,a2 as uo,a3 as yi,a4 as ho,a5 as fo,a6 as po,a7 as Jn,a8 as Ye,a9 as mo,aa as go,ab as bo,ac as vo}from"./useTitle-6AJYXxJy.js";import{u as Qn,s as he,a as Be,o as wi,b as yo,I as C,M as Fe,A as lt,N as pt,c as ct,d as ye,e as Ue,f as Ve,g as rt,L as fe,l as Ct,h as ss,t as ki,i as Xe,R as Vt,j as et,p as Gt,k as at,m as os,n as Bn,E as cs,q as Ge,r as ut,v as wo,S as vn,w as _i,T as as,x as dt,y as ei,z as qe,B as wt,C as ko,D as _o,F as Et,G as ti,H as rs,J as So,K as Co,O as Io,P as ls,Q as en,U as To,V as xo,W as ds,X as Ao,Y as Rt,Z as ni,_ as Eo,$ as us,a0 as Ro,a1 as hs,a2 as Lo,a3 as $o,a4 as Mo,a5 as Si,a6 as Do,a7 as Ot}from"./fuse-uYeGZ3ik.js";var fs=No;function No(t,n,i){var s=null,o=null,a=function(){s&&(clearTimeout(s),o=null,s=null)},p=function(){var c=o;a(),c&&c()},r=function(){if(!n)return t.apply(this,arguments);var c=this,l=arguments,m=i&&!s;if(a(),o=function(){t.apply(c,l)},s=setTimeout(function(){if(s=null,!m){var h=o;return o=null,h()}},n),m)return o()};return r.cancel=a,r.flush=p,r}/*!
* 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(t,n){"use strict";typeof t.CustomEvent!="function"&&(t.CustomEvent=function(d,v){v=v||{bubbles:!1,cancelable:!1,detail:void 0};var b=n.createEvent("CustomEvent");return b.initCustomEvent(d,v.bubbles,v.cancelable,v.detail),b},t.CustomEvent.prototype=t.Event.prototype),n.addEventListener("touchstart",m,!1),n.addEventListener("touchmove",h,!1),n.addEventListener("touchend",l,!1);var i=null,s=null,o=null,a=null,p=null,r=null,c=0;function l(d){if(r===d.target){var v=parseInt(f(r,"data-swipe-threshold","20"),10),b=f(r,"data-swipe-unit","px"),w=parseInt(f(r,"data-swipe-timeout","500"),10),k=Date.now()-p,y="",S=d.changedTouches||d.touches||[];if(b==="vh"&&(v=Math.round(v/100*n.documentElement.clientHeight)),b==="vw"&&(v=Math.round(v/100*n.documentElement.clientWidth)),Math.abs(o)>Math.abs(a)?Math.abs(o)>v&&k<w&&(o>0?y="swiped-left":y="swiped-right"):Math.abs(a)>v&&k<w&&(a>0?y="swiped-up":y="swiped-down"),y!==""){var _={dir:y.replace(/swiped-/,""),touchType:(S[0]||{}).touchType||"direct",fingers:c,xStart:parseInt(i,10),xEnd:parseInt((S[0]||{}).clientX||-1,10),yStart:parseInt(s,10),yEnd:parseInt((S[0]||{}).clientY||-1,10)};r.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:_})),r.dispatchEvent(new CustomEvent(y,{bubbles:!0,cancelable:!0,detail:_}))}i=null,s=null,p=null}}function m(d){d.target.getAttribute("data-swipe-ignore")!=="true"&&(r=d.target,p=Date.now(),i=d.touches[0].clientX,s=d.touches[0].clientY,o=0,a=0,c=d.touches.length)}function h(d){if(!(!i||!s)){var v=d.touches[0].clientX,b=d.touches[0].clientY;o=i-v,a=s-b}}function f(d,v,b){for(;d&&d!==n.documentElement;){var w=d.getAttribute(v);if(w)return w;d=d.parentNode}return b}})(window,document);function Bt(t=()=>{},n=[]){const i=q(t);ee(()=>{i.current=t},[n]),ee(()=>{const s=()=>{const o=document.hidden||document.visibilityState==="hidden";i.current(!o)};return document.addEventListener("visibilitychange",s),()=>document.removeEventListener("visibilitychange",s)},[])}const Po=1e3*3,Ci=2e4,Oo=it(function({isLoggedIn:n}){const[i,s]=L(!0),o=q();Bt(c=>{clearTimeout(o.current),c?s(!0):o.current=setTimeout(()=>{s(!1)},Ci)});const a=async(c,l,m)=>{var h;if(A.notificationsLast){const f=c.v1.notifications.list({limit:1,sinceId:A.notificationsLast.id}),{value:d}=await f.next();if(d!=null&&d.length)if(m)A.notificationsShowNew=!0;else{let v;try{const b=await c.v1.markers.fetch({timeline:"notifications"});v=(h=b==null?void 0:b.notifications)==null?void 0:h.lastReadId}catch{}v?A.notificationsShowNew=d[0].id!==v:A.notificationsShowNew=!0}}};ee(()=>{let c,l,m;if(n&&i){const{masto:h,streaming:f,instance:d}=oe();(async()=>{await a(h,d);let v=!1;f&&(l=setTimeout(()=>{(async()=>{try{v=!0,c=f.user.notification.subscribe();for await(const b of c){if(!c||!i)break;b.event==="notification"&&Ke(b.payload,d,{skipThreading:!0}),A.notificationsShowNew=!0}}catch{v=!1}v||(m=setInterval(()=>{a(h,d,!0)},Ci))})()},Po))})()}return()=>{var h;(h=c==null?void 0:c.unsubscribe)==null||h.call(c),c=null,clearTimeout(l),clearInterval(m)}},[i,n]);const p=q(),r=()=>{p.current=Date.now(),fetch("./version.json").then(c=>c.json()).then(c=>{c&&(A.appVersion=c)}).catch(c=>{})};return Qn(r,i&&1e3*60*30),Bt(c=>{c&&(p.current?Date.now()-p.current>1e3*60*60&&r():r())}),Be("shift+alt+k",()=>{const c=A.settings.cloakMode;A.settings.cloakMode=!c,he({text:c?g._({id:"oguMwa"}):g._({id:"IXZLPs"})})}),null});function zo(){const t=He(A);function n(i){if(t.composerState.minimized){A.composerState.minimized=!1,wi();return}i.shiftKey?yo()||(A.showCompose=!0):(wi(),A.showCompose=!0)}return Be("c, shift+c",n,{ignoreEventWhen:i=>!!document.querySelector("#modal-container > *")}),e("button",{type:"button",id:"compose-button",onClick:n,class:`${t.composerState.minimized?"min":""} ${t.composerState.publishing?"loading":""} ${t.composerState.publishingError?"error":""}`,children:e(C,{icon:"quill",size:"xl",alt:g._({id:"QOhkyl"})})})}const Uo=it(function(){const n=He(A);function i(){A.showKeyboardShortcutsHelp=!1}return Be("?, shift+?, shift+slash",s=>{A.showKeyboardShortcutsHelp=!0},{ignoreEventWhen:s=>!!doc
${_i(p)}`).join(`
`))||"",o=_i(t)+(s?`
${s}`:"");return e("div",{class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(C,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"9groMz"})})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:o}),e(as,{forceTranslate:!0,text:o})]})]})}function Rc({accountID:t,onClose:n}){const{masto:i}=oe(),[s,o]=L("default"),[a,p]=L([]),[r,c]=L([]),[l,m]=$t(d=>d+1,0);ee(()=>{o("loading"),(async()=>{try{const d=await sn();p(d);const v=await i.v1.accounts.$select(t).lists.list();c(v),o("default")}catch{o("error")}})()},[l]);const[h,f]=L(!1);return e("div",{class:"sheet",id:"list-add-remove-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(C,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(u,{id:"sJ2yQc"})})}),e("main",{children:[a.length>0?e("ul",{class:"list-add-remove",children:a.map(d=>{const v=r.some(b=>b.id===d.id);return e("li",{children:e("button",{type:"button",class:`light ${v?"checked":""}`,disabled:s==="loading",onClick:()=>{o("loading"),(async()=>{try{v?await i.v1.lists.$select(d.id).accounts.remove({accountIds:[t]}):await i.v1.lists.$select(d.id).accounts.create({accountIds:[t]}),m()}catch{o("error"),alert(v?g._({id:"7KnEYa"}):g._({id:"Tba8uO"}))}})()},children:[e(C,{icon:"check-circle",alt:"☑️"}),e("span",{children:d.title})]})})})}):s==="loading"?e("p",{class:"ui-state",children:e(Ne,{abrupt:!0})}):s==="error"?e("p",{class:"ui-state",children:e(u,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(u,{id:"/MJ7gZ"})}),e("button",{type:"button",class:"plain2",onClick:()=>f(!0),disabled:s!=="default",children:[e(C,{icon:"plus",size:"l"})," ",e("span",{children:e(u,{id:"Sb2gYF"})})]})]}),h&&e(Fe,{onClick:d=>{d.target===d.currentTarget&&f(!1)},children:e(ui,{list:h==null?void 0:h.list,onClose:d=>{d.state==="success"&&m(),f(!1)}})})]})}function Lc({account:t,note:n,onRelationshipChange:i=()=>{},onClose:s=()=>{}}){const{masto:o}=oe(),[a,p]=L("default"),r=q(null);return ee(()=>{let c;return r.current&&!n&&(c=setTimeout(()=>{var l,m;(m=(l=r.current).focus)==null||m.call(l)},100)),()=>{clearTimeout(c)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(C,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(u,{id:"DYqYm5",values:{0:(t==null?void 0:t.username)||(t==null?void 0:t.acct)},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:e("form",{onSubmit:c=>{c.preventDefault();const m=new FormData(c.target).get("note");(m==null?void 0:m.trim())!==(n==null?void 0:n.trim())&&(p("loading"),(async()=>{try{const h=await o.v1.accounts.$select(t==null?void 0:t.id).note.create({comment:m});p("default"),i(h),s()}catch(h){p("error"),alert((h==null?void 0:h.message)||g._({id:"ot8LpF"}))}})())},children:[e("textarea",{ref:r,name:"note",disabled:a==="loading",dir:"auto",children:n}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:a==="loading",onClick:()=>{s==null||s()},children:e(u,{id:"dEgA5A"})}),e("span",{children:[e(Ne,{abrupt:!0,hidden:a!=="loading"}),e("button",{disabled:a==="loading",type:"submit",children:e(u,{id:"SrwrEj"})})]})]})]})})]})}function $c({onClose:t=()=>{}}){const{masto:n}=oe(),[i,s]=L("loading"),[o,a]=L(null);ee(()=>{(async()=>{try{const h=await n.v1.accounts.verifyCredentials();a(h),s("default")}catch{s("error")}})()},[]);const{displayName:p,source:r}=o||{},{note:c,fields:l}=r||{},m=q(null);return e("div",{class:"sheet",id:"edit-profile-container",children:[!!t&&e("button",{type:"button",class:"sheet-close",onClick:t,children:e(C,{icon:"x",alt:g._({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(u,{id:"9OpVZg"})})}),e("main",{children:i==="loading"?e("p",{class:"ui-state",children:e(Ne,{abrupt:!0})}):e("form",{onSubmit:h=>{h.preventDefault();const f=new FormData(h.target),d=f.get("display_name"),v=f.get("note"),b=m.current.querySelectorAll('input[name^="fields_attributes"]'),w=[];b.forEach(k=>{co
rgba(${x==null?void 0:x.join(",")}, 0.4) ${P}%,
rgba(${x==null?void 0:x.join(",")}, 0.4) ${$}%
`:`
transparent ${P}%,
transparent ${$}%
`}))==null?void 0:I.join(", "))||"transparent"},[b]);let k=q(null);return ee(()=>()=>{var _,T;(T=(_=k.current)==null?void 0:_.hideToast)==null||T.call(_)},[]),e("div",{class:`media-modal-container media-modal-count-${t==null?void 0:t.length}`,children:[e("div",{ref:c,tabIndex:"0","data-swipe-threshold":"44",class:"carousel",onClick:_=>{(_.target.classList.contains("carousel-item")||_.target.classList.contains("media")||_.target.classList.contains("media-zoom"))&&a()},style:t.length>1?{backgroundAttachment:"local",backgroundImage:`linear-gradient(
to ${Et()?"left":"right"}, ${w})`}:{},children:t==null?void 0:t.map((_,T)=>{const I=t.length===1?b[T]:null;return e("div",{class:"carousel-item",style:I?{"--accent-color":`rgb(${I==null?void 0:I.join(",")})`,"--accent-alpha-color":`rgba(${I==null?void 0:I.join(",")}, 0.4)`}:{},tabindex:"0",ref:T===l?h:null,onClick:x=>{x.target.classList.contains("media")||v(!d)},children:[!!_.description&&e("button",{type:"button",class:"media-alt",hidden:!d,onClick:()=>{A.showMediaAlt={alt:_.description,lang:s}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:s,dir:"auto",children:_.description})]}),e(rs,{media:_,showOriginal:!0,lang:s})]},_.id)})}),e("div",{class:"carousel-top-controls",hidden:!d,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>a(),children:e(C,{icon:"x",alt:g._({id:"yz7wBu"})})})}),(t==null?void 0:t.length)>1?e("span",{class:"carousel-dots",children:t==null?void 0:t.map((_,T)=>e("button",{type:"button",disabled:T===l,class:`carousel-dot ${T===l?"active":""}`,onClick:I=>{I.preventDefault(),I.stopPropagation();const x=c.current.clientWidth*T*(Et()?-1:1);c.current.scrollTo({left:x,behavior:"smooth"}),c.current.focus()},children:e(C,{icon:"round",size:"s",alt:"⸱"})},_.id))}):e("span",{}),e("span",{children:[e(ct,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(C,{icon:"more",alt:g._({id:"2FYpfJ"})})}),children:[e(Ue,{href:((y=t[l])==null?void 0:y.remoteUrl)||((S=t[l])==null?void 0:S.url),class:"carousel-button",target:"_blank",title:g._({id:"5hXGws"}),children:[e(C,{icon:"popout"}),e("span",{children:e(u,{id:"aDr7Vc"})})]}),!1]})," ",e(fe,{to:`${i?`/${i}`:""}/s/${n}${window.matchMedia("(min-width: calc(40em + 350px))").matches?`?media=${l+1}`:""}`,class:"button carousel-button media-post-link",children:[e("span",{class:"button-label",children:[e(u,{id:"ISg5SQ"})," "]}),"»"]})]})]}),(t==null?void 0:t.length)>1&&e("div",{class:"carousel-controls",hidden:!d,children:[e("button",{type:"button",class:"carousel-button",hidden:l===0,onClick:_=>{_.preventDefault(),_.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(l-1)*(Et()?-1:1),behavior:"smooth"})},children:e(C,{icon:"arrow-left",alt:g._({id:"DHhJ7s"})})}),e("button",{type:"button",class:"carousel-button",hidden:l===t.length-1,onClick:_=>{_.preventDefault(),_.stopPropagation(),c.current.focus(),c.current.scrollTo({left:c.current.clientWidth*(l+1)*(Et()?-1:1),behavior:"smooth"})},children:e(C,{icon:"arrow-right",alt:g._({id:"hXzOVo"})})})]})]})}const Hc=[,"spam","legal","violation","other"],Kt={spam:{label:{id:"t8dIOP"},description:{id:"csQin/"}},legal:{label:{id:"IjKdHM"},description:{id:"e6tGFu"}},violation:{label:{id:"KPFHM2"},description:{id:"fpotTF"},stampLabel:{id:"iuLUuH"}},other:{label:{id:"/IX/7x"},description:{id:"kxiG8g"},excludeStamp:!0}};function qc({account:t,post:n,onClose:i}){const{_:s}=Je(),{masto:o}=oe(),[a,p]=L("default"),[r,c]=t.acct.split("@"),[l,m]=ke(()=>{const{rules:y,domain:S}=Qi();return[y||[],S]}),[h,f]=L(null),[d,v]=L(!1),b=q(null),[w,k]=L(!1);return e("div",{class:"report-modal-container",children:[e("div",{class:"top-controls",children:[e("h1",{children:n?g._({id:"muLhL3"}):g._({id:"ACul2G",values:{username:r}})}),e("button",{type:"button",class:"plain4 small",disabled:a==="loading",onClick:()=>i(),children:e(C,{icon:"x",size:"xl",alt:g._({id:"yz7wBu"})})})]}),e("main",{children:[e("div",{class:"report-preview",children:n?e(qe,{status:n,size:"s",previewMode:!0}):e(at,{account:t,avatarSize:"xxl",useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!h&&!Kt[h].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[s(Kt[h].stampLabel||s(Kt[h].label)),e("small",{children:e(u,{id:"2WtL62"})})]},h),e("form",{onSubmit:y=>{y.preventDefault();const S=new FormData(y.target),_=Object.fromEntries(S.entries());let{category:T,comment:I,forward:x}=_;I||(I=void 0),x==="on"&&(x=!0);const O=T==="violation"?Obj
<phanpy-shortcuts-settings>${y}</phanpy-shortcuts-settings>`,he(g._({id:"9ZYiLz"})),await s.v1.accounts.$select(d).note.create({comment:k}),c("default"),he(g._({id:"5w02SH"}))}}catch{c("error"),he(g._({id:"aVsTYo"}))}},title:g._({id:"gWd6Cu"}),children:[e(C,{icon:"cloud"}),e(C,{icon:"arrow-up"})]})," ",o.length>0&&e("small",{class:"insignificant ib",children:e(u,{id:"IPXOXm",values:{0:o.length}})})]}),!!o&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:e(u,{id:"e5E+WH"})})}),e("textarea",{style:{width:"100%"},rows:10,readOnly:!0,children:JSON.stringify(t.filter(Boolean),null,2)})]})]}),A.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(C,{icon:"cloud"})," ",e(u,{id:"C4T6O/"})]})})]})]})}es(A,t=>{for(const[n,i,s,o]of t)/^show/i.test(i)&&!s&&jn()});function ia(){var s,o,a,p,r,c,l,m;const t=He(A),n=ts(),i=Yt();return ee(()=>{setTimeout(to,1e3)},[]),e(B,{children:[!!t.showCompose&&e(Fe,{class:`solid ${t.composerState.minimized?"min":""}`,minimized:!!t.composerState.minimized,children:e(no,{replyToStatus:typeof t.showCompose!="boolean"?t.showCompose.replyToStatus:((s=window.__COMPOSE__)==null?void 0:s.replyToStatus)||null,editStatus:((o=A.showCompose)==null?void 0:o.editStatus)||((a=window.__COMPOSE__)==null?void 0:a.editStatus)||null,draftStatus:((p=A.showCompose)==null?void 0:p.draftStatus)||((r=window.__COMPOSE__)==null?void 0:r.draftStatus)||null,onClose:h=>{const{newStatus:f,instance:d,type:v}=h||{};A.showCompose=!1,window.__COMPOSE__=null,f&&(A.reloadStatusPage++,he({text:{post:g._({id:"aTyHBW"}),reply:g._({id:"lZdBKl"}),edit:g._({id:"a5BN7l"})}[v||"post"],delay:1e3,duration:1e4,onClick:b=>{b.hideToast(),A.prevLocation=i,n(d?`/${d}/s/${f.id}`:`/s/${f.id}`)}}))}})}),!!t.showSettings&&e(Fe,{onClose:()=>{A.showSettings=!1},children:e(hc,{onClose:()=>{A.showSettings=!1}})}),!!t.showAccounts&&e(Fe,{onClose:()=>{A.showAccounts=!1},children:e(tc,{onClose:()=>{A.showAccounts=!1}})}),!!t.showAccount&&e(Fe,{onClose:()=>{A.showAccount=!1},children:e(Nc,{account:((c=t.showAccount)==null?void 0:c.account)||t.showAccount,instance:(l=t.showAccount)==null?void 0:l.instance,onClose:({destination:h}={})=>{A.showAccount=!1}})}),!!t.showDrafts&&e(Fe,{onClose:()=>{A.showDrafts=!1},children:e(Pc,{onClose:()=>A.showDrafts=!1})}),!!t.showMediaModal&&e(Fe,{onClick:h=>{(h.target===h.currentTarget||h.target.classList.contains("media"))&&(A.showMediaModal=!1)},children:e(Ts,{mediaAttachments:t.showMediaModal.mediaAttachments,instance:t.showMediaModal.instance,index:t.showMediaModal.index,statusID:t.showMediaModal.statusID,onClose:()=>{A.showMediaModal=!1}})}),!!t.showShortcutsSettings&&e(Fe,{onClose:()=>{A.showShortcutsSettings=!1},children:e(ea,{onClose:()=>A.showShortcutsSettings=!1})}),!!t.showGenericAccounts&&e(Fe,{onClose:()=>{A.showGenericAccounts=!1},children:e(Uc,{instance:t.showGenericAccounts.instance,excludeRelationshipAttrs:t.showGenericAccounts.excludeRelationshipAttrs,postID:t.showGenericAccounts.postID,onClose:()=>A.showGenericAccounts=!1,blankCopy:t.showGenericAccounts.blankCopy})}),!!t.showMediaAlt&&e(Fe,{onClose:h=>{A.showMediaAlt=!1},children:e(Fc,{alt:t.showMediaAlt.alt||t.showMediaAlt,lang:(m=t.showMediaAlt)==null?void 0:m.lang,onClose:()=>{A.showMediaAlt=!1}})}),!!t.showEmbedModal&&e(Fe,{class:"solid",onClose:()=>{A.showEmbedModal=!1},children:e(zc,{html:t.showEmbedModal.html,url:t.showEmbedModal.url,width:t.showEmbedModal.width,height:t.showEmbedModal.height,onClose:()=>{A.showEmbedModal=!1}})}),!!t.showReportModal&&e(Fe,{onClose:()=>{A.showReportModal=!1},children:e(qc,{account:t.showReportModal.account,post:t.showReportModal.post,onClose:()=>{A.showReportModal=!1}})})]})}function Vn({accountID:t,onChange:n}){const{masto:i}=oe(),[s,o]=L("default"),[a,p]=L(null),[r,c]=L(null),l=r!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:s==="loading"||l,onClick:()=>{o("loading"),p("accept"),(async()=>{try{const m=await i.v1.followRequests.$select(t).authorize();if(!(m!=null&&m.followedBy))throw new Error("Follow
media-post
${X?"filtered":""}
${me?"has-spoiler":""}
${le?"show-media":""}
`,children:e(rs,{class:t,media:pe,lang:N,to:`/${s}/s/${y}?media-only=${D+1}`,onClick:a?ce=>a(ce,D,pe,i):void 0})},E)})}const Fi=it(ba);function va(t){var T,I,x,O,P;const n=He(A),{masto:i,instance:s,authenticated:o}=oe(),[a,p]=ke(()=>{const $=ge.local.getJSON("accounts")||[];return[$.find(Z=>Z.info.id===vt())||$[0],$.length>1]},[]),r=(n.settings.shortcutsViewMode==="multi-column"||!n.settings.shortcutsViewMode&&n.settings.shortcutsColumnsMode)&&!n.shortcuts.find($=>$.type==="following"),c=To(()=>{A.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),l=q(),[m,h]=L(void 0),f=xo([0,0,n.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),d=q();async function v($){return($||!d.current)&&(d.current=i.v1.mutes.list({limit:80})),await d.current.next()}const b=q();async function w($){return($||!b.current)&&(b.current=i.v1.blocks.list({limit:80})),await b.current.next()}const k=Xe("@mastodon/lists"),[y,S]=L([]);ee(()=>{k&&m==="open"&&sn().then(S)},[m==="open"]);const _=q();return e(B,{children:[e("button",{ref:l,type:"button",class:`button plain nav-menu-button ${p?"with-avatar":""} ${m==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{_.current=Date.now(),h($=>$?void 0:"open")},onContextMenu:$=>{$.preventDefault(),A.showAccounts=!0},...c(),children:[p&&e(lt,{url:((T=a==null?void 0:a.info)==null?void 0:T.avatar)||((I=a==null?void 0:a.info)==null?void 0:I.avatarStatic),size:"l",squircle:(x=a==null?void 0:a.info)==null?void 0:x.bot}),e(C,{icon:"menu",size:p?"s":"l",alt:g._({id:"zucql+"})})]}),e(ds,{menuClassName:"nav-menu",state:m,anchorRef:l,onClose:()=>{h(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-_.current<300}},portal:{target:document.body},...t,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:f,unmountOnClose:!0,children:[!!((O=n.appVersion)!=null&&O.commitHash)&&n.appVersion.commitHash!=="0a176e2"&&e("div",{class:"top-menu",children:[e(ye,{onClick:()=>{confirm(g._({id:"Djbaby"}))&&(async()=>{try{location.reload()}catch{}})()},children:[e(C,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:e(u,{id:"95IFnD"})})]}),e(Ve,{})]}),e("section",{children:[e(Ue,{to:"/",children:[e(C,{icon:"home",size:"l"})," ",e("span",{children:e(u,{id:"i0qMbr"})})]}),o?e(B,{children:[r&&e(Ue,{to:"/following",children:[e(C,{icon:"following",size:"l"})," ",e("span",{children:e(u,{id:"y6sq5j"})})]}),e(Ue,{to:"/catchup",children:[e(C,{icon:"history2",size:"l"}),e("span",{children:e(u,{id:"xrl8fj"})})]}),Xe("@mastodon/mentions")&&e(Ue,{to:"/mentions",children:[e(C,{icon:"at",size:"l"})," ",e("span",{children:e(u,{id:"/bZzdR"})})]}),e(Ue,{to:"/notifications",children:[e(C,{icon:"notification",size:"l"})," ",e("span",{children:e(u,{id:"iDNBZe"})}),n.notificationsShowNew&&e("sup",{title:g._({id:"isRobC"}),style:{opacity:.5},children:[" ","•"]})]}),e(Ve,{}),((P=a==null?void 0:a.info)==null?void 0:P.id)&&e(Ue,{to:`/${s}/a/${a.info.id}`,children:[e(C,{icon:"user",size:"l"})," ",e("span",{children:e(u,{id:"vERlcd"})})]}),(y==null?void 0:y.length)>0?e(vn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(B,{children:[e(C,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:e(u,{id:"h16FyT"})}),e(C,{icon:"chevron-right"})]}),children:[e(Ue,{to:"/l",children:e("span",{children:e(u,{id:"BHWx+g"})})}),(y==null?void 0:y.length)>0&&e(B,{children:[e(Ve,{}),y.map($=>e(Ue,{to:`/l/${$.id}`,children:e("span",{children:$.title})},$.id))]})]}):k&&e(Ue,{to:"/l",children:[e(C,{icon:"list",size:"l"}),e("span",{children:e(u,{id:"h16FyT"})})]}),e(Ue,{to:"/b",children:[e(C,{icon:"bookmark",size:"l"})," ",e("span",{children:e(u,{id:"7Ff7ia"})})]}),e(vn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(B,{children:[e(C,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:e(u,{id:"24misb"})}),e(C,{icon:"chevron-right"})]}),children:[e(Ue,{to:"/f",children:[e(C,{icon:"heart",size:"l"})," ",e("span",{children:e(u,{id:"zZOZj7"})})]}),e(Ue,{to:"/fh",children:[e(C,{icon:"hashtag",size:"l"})," ",e("span",{children:e(u,{id:"Xi1/bw"})}
//# sourceMappingURL=main-DaGMLi0n.js.map