phanpy-cz/assets/main-1wKRS81d.js

26 lines
250 KiB
JavaScript
Raw Permalink Normal View History

2024-06-16 18:14:43 +00:00
import{s as T,a as Q,b as qe,c as be,g as ct,d as ds,e as St,p as ht,u as Ks,L as $e,f as jt,h as us,i as Zs,C as Js,j as Ke,k as Xs,l as hn,m as He,n as hs,t as Qs,o as ei,q as $n,r as ti,v as An,w as Rn}from"./useTitle-dCp14HlU.js";import{F as z,_ as G,p as $,u as _e,x as Je,a as Me,b as e,k as _,y as mt,c as pn,M as de,d as ze,e as Tt,q as pe,f as xt,g as Qe,I as rt,A as lt,h as fn,l as _n,s as ps,i as fs,j as it,T as ni,m as si,n as ii,P as oi,J as ai,C as ms,o as ci,r as gt,t as ri,v as li,w as gs,z as di,B as ui,D as hi,E as pi,G as Et,H as bs,K as Ln,L as fi,R as mn,N as Ue,O as mi,Q as gi}from"./vendor-GrW-f9CX.js";import{u as gn,s as se,o as En,a as bi,I as w,M as Ae,A as st,N as It,b as Ze,c as et,L as oe,g as ys,l as yi,t as Mn,R as bt,d as je,e as Xe,f as Re,h as ws,i as on,E as vs,j as Ge,n as ot,k as wi,S as Wt,m as Pn,T as ks,p as nt,q as bn,r as Be,v as Dn,w as vi,x as ki,y as Ss,C as Si,z as Ii,F as Is,B as Mt,D as Ci,G as $t,H as yn,J as Cs,K as Ti,O as Nt}from"./status-FORkhePO.js";function Ct(t=()=>{},n=[]){const i=z(t);G(()=>{i.current=t},[n]),G(()=>{const s=()=>{const o=document.hidden||document.visibilityState==="hidden";i.current(!o)};return document.addEventListener("visibilitychange",s),()=>document.removeEventListener("visibilitychange",s)},[])}const xi=1e3*3,$i=15e3,Ai=Je(function({isLoggedIn:n}){const[i,s]=$(!0);Ct(s);const o=async(d,r,u)=>{var f;if(T.notificationsLast){const c=d.v1.notifications.list({limit:1,sinceId:T.notificationsLast.id}),{value:p}=await c.next();if(p!=null&&p.length)if(u)T.notificationsShowNew=!0;else{let l;try{const b=await d.v1.markers.fetch({timeline:"notifications"});l=(f=b==null?void 0:b.notifications)==null?void 0:f.lastReadId}catch{}l?T.notificationsShowNew=p[0].id!==l:T.notificationsShowNew=!0}}};G(()=>{let d,r;if(n&&i){const{masto:u,streaming:f,instance:c}=Q();(async()=>{await o(u,c);let p=!1;f&&(r=setTimeout(()=>{(async()=>{try{p=!0,d=f.user.notification.subscribe();for await(const l of d){if(!d||!i)break;l.event==="notification"&&qe(l.payload,c,{skipThreading:!0}),T.notificationsShowNew=!0}}catch{p=!1}p||(r=setInterval(()=>{o(u,c,!0)},$i))})()},xi))})()}return()=>{var u;(u=d==null?void 0:d.unsubscribe)==null||u.call(d),d=null,clearTimeout(r),clearInterval(r)}},[i,n]);const a=z(),h=()=>{a.current=Date.now(),fetch("./version.json").then(d=>d.json()).then(d=>{d&&(T.appVersion=d)}).catch(d=>{})};return gn(h,i&&1e3*60*30),Ct(d=>{d&&(a.current?Date.now()-a.current>1e3*60*60&&h():h())}),_e("shift+alt+k",()=>{const d=T.settings.cloakMode;T.settings.cloakMode=!d,se({text:`Cloak mode ${d?"disabled":"enabled"}`})}),null});function Ri(){const t=Me(T);function n(i){if(t.composerState.minimized){T.composerState.minimized=!1,En();return}i.shiftKey?bi()||(T.showCompose=!0):(En(),T.showCompose=!0)}return _e("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(w,{icon:"quill",size:"xl",alt:"Compose"})})}const _i=Je(function(){const n=Me(T);function i(){T.showKeyboardShortcutsHelp=!1}return _e("?, shift+?, shift+slash",s=>{T.showKeyboardShortcutsHelp=!0},{ignoreEventWhen:s=>!!document.querySelector("#modal-container > *")}),!!n.showKeyboardShortcutsHelp&&e(Ae,{onClose:i,children:e("div",{id:"keyboard-shortcuts-help-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:i,children:e(w,{icon:"x"})}),e("header",{children:e("h2",{children:"Keyboard shortcuts"})}),e("main",{children:e("table",{children:[{action:"Keyboard shortcuts help",keys:e("kbd",{children:"?"})},{action:"Next post",keys:e("kbd",{children:"j"})},{action:"Previous post",keys:e("kbd",{children:"k"})},{action:"Skip carousel to next post",keys:e(_,{children:[e("kbd",{children:"Shift"})," + ",e("kbd",{children:"j"})]})},{action:"Skip carousel to previous post",keys:e(_,{children:[e("kbd",{children:"Shift"})," + ",e("kbd",{children:"k"})]})}
${F.daysSinceLastPost} day${F.daysSinceLastPost>1?"s":""}`:`
Last ${F.total} posts in the past year(s)
`}),e("div",{class:"posting-stats-bar",style:{"--originals-percentage":`${F.originals/F.total*100}%`,"--replies-percentage":`${(F.originals+F.replies)/F.total*100}%`}}),e("div",{class:"posting-stats-legends",children:[e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-originals"})," ","Original"]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-replies"})," ","Replies"]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-boosts"})," ","Boosts"]})]})]}):e("div",{class:"posting-stats",children:"Post stats unavailable."})})})}),!V&&e("div",{class:"account-metadata-box",children:e("div",{class:"shazam-container no-animation",hidden:!!F,children:e("div",{class:"shazam-container-inner",children:e("button",{type:"button",class:"posting-stats-button",disabled:D==="loading",onClick:()=>{Z()},children:[e("div",{class:`posting-stats-bar posting-stats-icon ${D==="loading"?"loading":""}`,style:{"--originals-percentage":"33%","--replies-percentage":"66%"}}),"View post stats"," "]})})})})]}),e("footer",{children:e(to,{info:c,instance:s,standalone:i,authenticated:o,onRelationshipChange:ce,onProfileUpdate:De})})]})]})}const eo=3;function to({info:t,instance:n,standalone:i,authenticated:s,onRelationshipChange:o=()=>{},onProfileUpdate:a=()=>{}}){var Ie;if(!t)return null;const{masto:h,instance:d,authenticated:r}=Q(),u=n===d,[f,c]=$("default"),[p,l]=$(null),{id:b,acct:m,url:k,username:g,locked:y,lastStatusAt:C,note:v,fields:I,moved:x}=t,L=z(b),{following:Y,showingReblogs:j,notifying:M,followedBy:ee,blocking:X,blockedBy:A,muting:P,mutingNotifications:E,requested:U,domainBlocking:V,endorsed:ye,note:ve}=p||{},[fe,ne]=$(null),[me,ue]=$(!1);G(()=>{if(t){const F=ct();let re;(async()=>{if(u&&s)re=b;else if(!u&&r){const W=t.acct.includes("@");try{const R=await h.v2.search.fetch({q:W?t.acct:`${t.username}@${n}`,type:"accounts",limit:1,resolve:!0});R.accounts.length&&(re=R.accounts[0].id,ne(R.accounts[0]))}catch{}}if(!re)return;if(F===re){ue(!0);return}L.current=re,c("loading");const D=h.v1.accounts.relationships.fetch({id:[re]});try{const W=await D;if(c("default"),W.length){const R=W[0];l(R),o({relationship:R,currentID:re})}}catch{c("error")}})()}},[t,s]),G(()=>{t&&me&&Ks(t)},[t,me]);const he=f==="loading",[ke,Le]=$(!1),[Te,Pe]=$(!1),[Fe,xe]=$(!1),[J,ae]=$(!1),[te,Se]=$([]);return e(_,{children:[e("div",{class:"actions",children:[e("span",{children:[ee?e("span",{class:"tag",children:"Follows you"}):C?e("small",{class:"insignificant",children:["Last post:"," ",e("span",{class:"ib",children:ot(C,{hideTime:!0})})]}):e("span",{}),P&&e("span",{class:"tag danger",children:"Muted"}),X&&e("span",{class:"tag danger",children:"Blocked"})]})," ",e("span",{class:"buttons",children:[!!ve&&e("button",{type:"button",class:"private-note-tag",title:"Private note",onClick:()=>{xe(!0)},dir:"auto",children:e("span",{children:ve})}),e(Ze,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",title:"More",class:"plain",disabled:he,children:e(w,{icon:"more",size:"l",alt:"More"})}),onMenuChange:F=>{Y&&F.open&&(async()=>{try{const re=await h.v1.accounts.$select(L.current).lists.list();Se(re)}catch{}})()},children:[r&&!me&&e(_,{children:[e(de,{onClick:()=>{wi({draftStatus:{status:`@${(fe==null?void 0:fe.acct)||m} `}})},children:[e(w,{icon:"at"}),e("span",{children:["Mention @",g]})]}),e(de,{onClick:()=>{Le(!0)},children:[e(w,{icon:"translate"}),e("span",{children:"Translate bio"})]}),je("@mastodon/profile-private-note")&&e(de,{onClick:()=>{xe(!0)},children:[e(w,{icon:"pencil"}),e("span",{children:ve?"Edit private note":"Add private note"})]}),Y&&!!p&&e(_,{children:[e(de,{onClick:()=>{c("loading"),(async()=>{try{const F=await h.v1.accounts.$select(L.current).follow({notify:!M});F&&l(F),c("default"),se(F.notifying?`Notifications enabled for @${g}'s posts.`:` Notifications disabled for @${g}'s posts.`)
${Pn(h)}`).join(`
`))||"",o=Pn(t)+(s?`
${s}`:"");return e("div",{class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(w,{icon:"x"})}),e("header",{children:e("h2",{children:"Translated Bio"})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:o}),e(ks,{forceTranslate:!0,text:o})]})]})}function oo({accountID:t,onClose:n}){const{masto:i}=Q(),[s,o]=$("default"),[a,h]=$([]),[d,r]=$([]),[u,f]=mt(l=>l+1,0);G(()=>{o("loading"),(async()=>{try{const l=await Pt();h(l);const b=await i.v1.accounts.$select(t).lists.list();r(b),o("default")}catch{o("error")}})()},[u]);const[c,p]=$(!1);return e("div",{class:"sheet",id:"list-add-remove-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(w,{icon:"x"})}),e("header",{children:e("h2",{children:"Add/Remove from Lists"})}),e("main",{children:[a.length>0?e("ul",{class:"list-add-remove",children:a.map(l=>{const b=d.some(m=>m.id===l.id);return e("li",{children:e("button",{type:"button",class:`light ${b?"checked":""}`,disabled:s==="loading",onClick:()=>{o("loading"),(async()=>{try{b?await i.v1.lists.$select(l.id).accounts.remove({accountIds:[t]}):await i.v1.lists.$select(l.id).accounts.create({accountIds:[t]}),f()}catch{o("error"),alert(b?"Unable to remove from list.":"Unable to add to list.")}})()},children:[e(w,{icon:"check-circle"}),e("span",{children:l.title})]})})})}):s==="loading"?e("p",{class:"ui-state",children:e($e,{abrupt:!0})}):s==="error"?e("p",{class:"ui-state",children:"Unable to load lists."}):e("p",{class:"ui-state",children:"No lists."}),e("button",{type:"button",class:"plain2",onClick:()=>p(!0),disabled:s!=="default",children:[e(w,{icon:"plus",size:"l"})," ",e("span",{children:"New list"})]})]}),c&&e(Ae,{onClick:l=>{l.target===l.currentTarget&&p(!1)},children:e(kn,{list:c==null?void 0:c.list,onClose:l=>{l.state==="success"&&f(),p(!1)}})})]})}function ao({account:t,note:n,onRelationshipChange:i=()=>{},onClose:s=()=>{}}){const{masto:o}=Q(),[a,h]=$("default"),d=z(null);return G(()=>{let r;return d.current&&!n&&(r=setTimeout(()=>{var u,f;(f=(u=d.current).focus)==null||f.call(u)},100)),()=>{clearTimeout(r)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(w,{icon:"x"})}),e("header",{children:e("b",{children:["Private note about @",(t==null?void 0:t.username)||(t==null?void 0:t.acct)]})}),e("main",{children:e("form",{onSubmit:r=>{r.preventDefault();const f=new FormData(r.target).get("note");(f==null?void 0:f.trim())!==(n==null?void 0:n.trim())&&(h("loading"),(async()=>{try{const c=await o.v1.accounts.$select(t==null?void 0:t.id).note.create({comment:f});h("default"),i(c),s()}catch(c){h("error"),alert((c==null?void 0:c.message)||"Unable to update private note.")}})())},children:[e("textarea",{ref:d,name:"note",disabled:a==="loading",children:n}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:a==="loading",onClick:()=>{s==null||s()},children:"Cancel"}),e("span",{children:[e($e,{abrupt:!0,hidden:a!=="loading"}),e("button",{disabled:a==="loading",type:"submit",children:"Save & close"})]})]})]})})]})}function co({onClose:t=()=>{}}){const{masto:n}=Q(),[i,s]=$("loading"),[o,a]=$(null);G(()=>{(async()=>{try{const c=await n.v1.accounts.verifyCredentials();a(c),s("default")}catch{s("error")}})()},[]);const{displayName:h,source:d}=o||{},{note:r,fields:u}=d||{},f=z(null);return e("div",{class:"sheet",id:"edit-profile-container",children:[!!t&&e("button",{type:"button",class:"sheet-close",onClick:t,children:e(w,{icon:"x"})}),e("header",{children:e("b",{children:"Edit profile"})}),e("main",{children:i==="loading"?e("p",{class:"ui-state",children:e($e,{abrupt:!0})}):e("form",{onSubmit:c=>{c.preventDefault();const p=new FormData(c.target),l=p.get("display_name"),b=p.get("note"),m=f.current.querySelectorAll('input[name^="fields_attributes"]'),k=[];m.forEach(g=>{const y=g.name,[C,v,I]=y.match(/fields_attributes\[(\d+)\]\[(.+)\]/)||[],x=g.value?g.value.trim():"";v&&I&&x&&(k[v]||(k[v]={}),k[v][I]=x)}),k.forEach(g=>{g.name&&!g.value&
rgba(${L==null?void 0:L.join(",")}, 0.4) ${j}%,
rgba(${L==null?void 0:L.join(",")}, 0.4) ${M}%
`:`
transparent ${j}%,
transparent ${M}%
`}))==null?void 0:x.join(", "))||"transparent"},[m]);let g=z(null);return G(()=>()=>{var v,I;(I=(v=g.current)==null?void 0:v.hideToast)==null||I.call(v)},[]),e("div",{class:`media-modal-container media-modal-count-${t==null?void 0:t.length}`,children:[e("div",{ref:r,tabIndex:"0","data-swipe-threshold":"44",class:"carousel",onClick:v=>{(v.target.classList.contains("carousel-item")||v.target.classList.contains("media")||v.target.classList.contains("media-zoom"))&&a()},style:t.length>1?{backgroundAttachment:"local",backgroundImage:`linear-gradient(
to right, ${k})`}:{},children:t==null?void 0:t.map((v,I)=>{const x=t.length===1?m[I]:null;return e("div",{class:"carousel-item",style:x?{"--accent-color":`rgb(${x==null?void 0:x.join(",")})`,"--accent-alpha-color":`rgba(${x==null?void 0:x.join(",")}, 0.4)`}:{},tabindex:"0",ref:I===u?c:null,onClick:L=>{L.target.classList.contains("media")||b(!l)},children:[!!v.description&&e("button",{type:"button",class:"media-alt",hidden:!l,onClick:()=>{T.showMediaAlt={alt:v.description,lang:s}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:s,dir:"auto",children:v.description})]}),e(Ss,{media:v,showOriginal:!0,lang:s})]},v.id)})}),e("div",{class:"carousel-top-controls",hidden:!l,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>a(),children:e(w,{icon:"x"})})}),(t==null?void 0:t.length)>1?e("span",{class:"carousel-dots",children:t==null?void 0:t.map((v,I)=>e("button",{type:"button",disabled:I===u,class:`carousel-dot ${I===u?"active":""}`,onClick:x=>{x.preventDefault(),x.stopPropagation(),r.current.scrollTo({left:r.current.clientWidth*I,behavior:"smooth"}),r.current.focus()},children:e(w,{icon:"round",size:"s"})},v.id))}):e("span",{}),e("span",{children:[e(Ze,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(w,{icon:"more",alt:"More"})}),children:[e(Re,{href:((y=t[u])==null?void 0:y.remoteUrl)||((C=t[u])==null?void 0:C.url),class:"carousel-button",target:"_blank",title:"Open original media in new window",children:[e(w,{icon:"popout"}),e("span",{children:"Open original media"})]}),!1]})," ",e(oe,{to:`${i?`/${i}`:""}/s/${n}${window.matchMedia("(min-width: calc(40em + 350px))").matches?`?media=${u+1}`:""}`,class:"button carousel-button media-post-link",children:[e("span",{class:"button-label",children:"View post "}),"»"]})]})]}),(t==null?void 0:t.length)>1&&e("div",{class:"carousel-controls",hidden:!l,children:[e("button",{type:"button",class:"carousel-button",hidden:u===0,onClick:v=>{v.preventDefault(),v.stopPropagation(),r.current.focus(),r.current.scrollTo({left:r.current.clientWidth*(u-1),behavior:"smooth"})},children:e(w,{icon:"arrow-left"})}),e("button",{type:"button",class:"carousel-button",hidden:u===t.length-1,onClick:v=>{v.preventDefault(),v.stopPropagation(),r.current.focus(),r.current.scrollTo({left:r.current.clientWidth*(u+1),behavior:"smooth"})},children:e(w,{icon:"arrow-right"})})]})]})}const yo=[,"spam","legal","violation","other"],At={spam:{label:"Spam",description:"Malicious links, fake engagement, or repetitive replies"},legal:{label:"Illegal",description:"Violates the law of your or the server's country"},violation:{label:"Server rule violation",description:"Breaks specific server rules",stampLabel:"Violation"},other:{label:"Other",description:"Issue doesn't fit other categories",excludeStamp:!0}};function wo({account:t,post:n,onClose:i}){const{masto:s}=Q(),[o,a]=$("default"),[h,d]=t.acct.split("@"),[r,u]=pe(()=>{const{rules:g,domain:y}=us();return[g||[],y]}),[f,c]=$(null),[p,l]=$(!1),b=z(null),[m,k]=$(!1);return e("div",{class:"report-modal-container",children:[e("div",{class:"top-controls",children:[e("h1",{children:n?"Report Post":`Report @${h}`}),e("button",{type:"button",class:"plain4 small",disabled:o==="loading",onClick:()=>i(),children:e(w,{icon:"x",size:"xl"})})]}),e("main",{children:[e("div",{class:"report-preview",children:n?e(Be,{status:n,size:"s",previewMode:!0}):e(Xe,{account:t,avatarSize:"xxl",useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!f&&!At[f].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[At[f].stampLabel||At[f].label,e("small",{children:"Pending review"})]},f),e("form",{onSubmit:g=>{g.preventDefault();const y=new FormData(g.target),C=Object.fromEntries(y.entries());let{category:v,comment:I,forward:x}=C;I||(I=void 0),x==="on"&&(x=!0);const L=v==="violation"?Object.entries(C).filter(([j])=>j.startsWith("rule_ids")).map(([j,M])=>M):void 0,Y={category:v,comment:I,forw
<phanpy-shortcuts-settings>${settingsJSON}</phanpy-shortcuts-settings>`;se("Saving shortcuts to instance server…"),await i.v1.accounts.$select(p).note.create({comment:k}),d("default"),se("Shortcuts saved")}}catch{d("error"),se("Unable to save shortcuts")}},title:"Sync to instance server",children:[e(w,{icon:"cloud"}),e(w,{icon:"arrow-up"})]})," ",s.length>0&&e("small",{class:"insignificant ib",children:[s.length," characters"]})]}),!!s&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:"Raw Shortcuts JSON"})}),e("textarea",{style:{width:"100%"},rows:10,readOnly:!0,children:JSON.stringify(t.filter(Boolean),null,2)})]})]}),T.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(w,{icon:"cloud"})," Import/export settings from/to instance server (Very experimental)"]})})]})]})}ps(T,t=>{for(const[n,i,s,o]of t)/^show/i.test(i)&&!s&&an()});function Mo(){var s,o,a,h,d,r,u,f;const t=Me(T),n=fs(),i=Tt();return G(()=>{setTimeout(Zs,1e3)},[]),e(_,{children:[!!t.showCompose&&e(Ae,{class:`solid ${t.composerState.minimized?"min":""}`,minimized:!!t.composerState.minimized,children:e(Js,{replyToStatus:typeof t.showCompose!="boolean"?t.showCompose.replyToStatus:((s=window.__COMPOSE__)==null?void 0:s.replyToStatus)||null,editStatus:((o=T.showCompose)==null?void 0:o.editStatus)||((a=window.__COMPOSE__)==null?void 0:a.editStatus)||null,draftStatus:((h=T.showCompose)==null?void 0:h.draftStatus)||((d=window.__COMPOSE__)==null?void 0:d.draftStatus)||null,onClose:c=>{const{newStatus:p,instance:l,type:b}=c||{};T.showCompose=!1,window.__COMPOSE__=null,p&&(T.reloadStatusPage++,se({text:{post:"Post published. Check it out.",reply:"Reply posted. Check it out.",edit:"Post updated. Check it out."}[b||"post"],delay:1e3,duration:1e4,onClick:m=>{m.hideToast(),T.prevLocation=i,n(l?`/${l}/s/${p.id}`:`/s/${p.id}`)}}))}})}),!!t.showSettings&&e(Ae,{onClose:()=>{T.showSettings=!1},children:e(Bi,{onClose:()=>{T.showSettings=!1}})}),!!t.showAccounts&&e(Ae,{onClose:()=>{T.showAccounts=!1},children:e(Li,{onClose:()=>{T.showAccounts=!1}})}),!!t.showAccount&&e(Ae,{onClose:()=>{T.showAccount=!1},children:e(uo,{account:((r=t.showAccount)==null?void 0:r.account)||t.showAccount,instance:(u=t.showAccount)==null?void 0:u.instance,onClose:({destination:c}={})=>{T.showAccount=!1}})}),!!t.showDrafts&&e(Ae,{onClose:()=>{T.showDrafts=!1},children:e(ho,{onClose:()=>T.showDrafts=!1})}),!!t.showMediaModal&&e(Ae,{onClick:c=>{(c.target===c.currentTarget||c.target.classList.contains("media"))&&(T.showMediaModal=!1)},children:e(Ls,{mediaAttachments:t.showMediaModal.mediaAttachments,instance:t.showMediaModal.instance,index:t.showMediaModal.index,statusID:t.showMediaModal.statusID,onClose:()=>{T.showMediaModal=!1}})}),!!t.showShortcutsSettings&&e(Ae,{onClose:()=>{T.showShortcutsSettings=!1},children:e(_o,{onClose:()=>T.showShortcutsSettings=!1})}),!!t.showGenericAccounts&&e(Ae,{onClose:()=>{T.showGenericAccounts=!1},children:e(mo,{instance:t.showGenericAccounts.instance,excludeRelationshipAttrs:t.showGenericAccounts.excludeRelationshipAttrs,postID:t.showGenericAccounts.postID,onClose:()=>T.showGenericAccounts=!1,blankCopy:t.showGenericAccounts.blankCopy})}),!!t.showMediaAlt&&e(Ae,{onClose:c=>{T.showMediaAlt=!1},children:e(go,{alt:t.showMediaAlt.alt||t.showMediaAlt,lang:(f=t.showMediaAlt)==null?void 0:f.lang,onClose:()=>{T.showMediaAlt=!1}})}),!!t.showEmbedModal&&e(Ae,{class:"solid",onClose:()=>{T.showEmbedModal=!1},children:e(fo,{html:t.showEmbedModal.html,url:t.showEmbedModal.url,width:t.showEmbedModal.width,height:t.showEmbedModal.height,onClose:()=>{T.showEmbedModal=!1}})}),!!t.showReportModal&&e(Ae,{onClose:()=>{T.showReportModal=!1},children:e(wo,{account:t.showReportModal.account,post:t.showReportModal.post,onClose:()=>{T.showReportModal=!1}})})]})}function rn({accountID:t,onChange:n}){const{masto:i}=Q(),[s,o]=$("default"),[a,h]=$(null),[d,r]=$(null),u=d!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:s==="loading"||u,onClick:()=>{o("loading"),h("accept"),(async()
media-post
${Se?"filtered":""}
${Ie?"has-spoiler":""}
${re?"show-media":""}
`,children:e(Ss,{class:t,media:W,lang:P,to:`/${s}/s/${y}?media-only=${R+1}`,onClick:a?ce=>a(ce,R,W,i):void 0})},q)})}const Kn=Je(jo);function Wo(t){var I,x,L,Y,j;const n=Me(T),{masto:i,instance:s,authenticated:o}=Q(),[a,h]=pe(()=>{const M=be.local.getJSON("accounts")||[];return[M.find(X=>X.info.id===ct())||M[0],M.length>1]},[]),d=(n.settings.shortcutsViewMode==="multi-column"||!n.settings.shortcutsViewMode&&n.settings.shortcutsColumnsMode)&&!n.shortcuts.find(M=>M.type==="following"),r=ai(()=>{T.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),u=z(),[f,c]=$(void 0),p=Ci([0,0,n.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),l=z();async function b(M){return(M||!l.current)&&(l.current=i.v1.mutes.list({limit:80})),await l.current.next()}const m=z();async function k(M){return(M||!m.current)&&(m.current=i.v1.blocks.list({limit:80})),await m.current.next()}const g=je("@mastodon/lists"),[y,C]=$([]);G(()=>{g&&f==="open"&&Pt().then(C)},[f==="open"]);const v=z();return e(_,{children:[e("button",{ref:u,type:"button",class:`button plain nav-menu-button ${h?"with-avatar":""} ${f==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{v.current=Date.now(),c(M=>M?void 0:"open")},onContextMenu:M=>{M.preventDefault(),T.showAccounts=!0},...r(),children:[h&&e(st,{url:((I=a==null?void 0:a.info)==null?void 0:I.avatar)||((x=a==null?void 0:a.info)==null?void 0:x.avatarStatic),size:"l",squircle:(L=a==null?void 0:a.info)==null?void 0:L.bot}),e(w,{icon:"menu",size:h?"s":"l"})]}),e(ms,{menuClassName:"nav-menu",state:f,anchorRef:u,onClose:()=>{c(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-v.current<300}},portal:{target:document.body},...t,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:p,unmountOnClose:!0,children:[!!((Y=n.appVersion)!=null&&Y.commitHash)&&n.appVersion.commitHash!=="0a6030c"&&e("div",{class:"top-menu",children:[e(de,{onClick:()=>{confirm("Reload page now to update?")&&(async()=>{try{location.reload()}catch{}})()},children:[e(w,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:"New update available…"})]}),e(ze,{})]}),e("section",{children:[e(Re,{to:"/",children:[e(w,{icon:"home",size:"l"})," ",e("span",{children:"Home"})]}),o?e(_,{children:[d&&e(Re,{to:"/following",children:[e(w,{icon:"following",size:"l"})," ",e("span",{children:"Following"})]}),e(Re,{to:"/catchup",children:[e(w,{icon:"history2",size:"l"}),e("span",{children:"Catch-up"})]}),je("@mastodon/mentions")&&e(Re,{to:"/mentions",children:[e(w,{icon:"at",size:"l"})," ",e("span",{children:"Mentions"})]}),e(Re,{to:"/notifications",children:[e(w,{icon:"notification",size:"l"})," ",e("span",{children:"Notifications"}),n.notificationsShowNew&&e("sup",{title:"New",style:{opacity:.5},children:[" ","•"]})]}),e(ze,{}),((j=a==null?void 0:a.info)==null?void 0:j.id)&&e(Re,{to:`/${s}/a/${a.info.id}`,children:[e(w,{icon:"user",size:"l"})," ",e("span",{children:"Profile"})]}),(y==null?void 0:y.length)>0?e(Wt,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(_,{children:[e(w,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:"Lists"}),e(w,{icon:"chevron-right"})]}),children:[e(Re,{to:"/l",children:e("span",{children:"All Lists"})}),(y==null?void 0:y.length)>0&&e(_,{children:[e(ze,{}),y.map(M=>e(Re,{to:`/l/${M.id}`,children:e("span",{children:M.title})},M.id))]})]}):g&&e(Re,{to:"/l",children:[e(w,{icon:"list",size:"l"}),e("span",{children:"Lists"})]}),e(Re,{to:"/b",children:[e(w,{icon:"bookmark",size:"l"})," ",e("span",{children:"Bookmarks"})]}),e(Wt,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(_,{children:[e(w,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:"More…"}),e(w,{icon:"chevron-right"})]}),children:[e(Re,{to:"/f",children:[e(w,{icon:"heart",size:"l"})," ",e("span",{children:"Likes"})]}),e(Re,{to:"/fh",children:[e(w,{icon:"hashtag",size:"l"})," ",e("span",{children:"Followed Hashtags"})]}),e(ze,{}),je("@mastodon/filters")&&e(Re,{to:"/ft",children:[e(w,{icon:"filters",size:"l"}),"Filters"]}),e(de,{onClick:()=
//# sourceMappingURL=main-1wKRS81d.js.map