phanpy-cz/assets/main-q4UThEef.js

33 lines
271 KiB
JavaScript
Raw Permalink Normal View History

import{A as H,y as Z,h as A,s as $,a as se,b as He,x as Je,u as Ne,c as e,k as R,d as we,g as dt,p as St,e as Ui,f as Lt,i as Ot,j as ft,T as me,q as et,l as Ls,L as $e,m as cn,_ as ut,n as Oi,o as Yc,r as Fi,t as zi,v as Ms,C as Ns,w as Xe,z as Ds,B as ot,F as Ps,D as Us,E as Os,G as Ln,H as It,I as qe,J as Bi,K as Fs,M as zs,N as Gt,O as Bs,P as Hs,Q as Jn,R as Qn,S as qs,U as ei,V as Mn,W as Fe,X as Vs,Y as Gs}from"./useTitle-4zhrJw0D.js";import{u as Nn,s as oe,a as Le,o as ti,b as js,I as v,M as _e,A as nt,N as Mt,c as Ze,d as pe,e as Be,f as tt,L as re,g as Hi,l as Ys,t as ni,h as Ve,R as Ct,p as Ft,i as Qe,j as Ee,k as qi,m as In,E as Vi,n as je,q as rt,r as Ws,S as ln,v as ii,T as Gi,w as st,x as Dn,y as Ue,z as ht,B as si,C as Ks,D as Xs,F as wt,G as Pn,H as ji,J as Zs,K as Js,O as Qs,P as Yi,Q as jt,U as eo,V as to,W as Wi,X as no,Y as vt,Z as Un,_ as io,$ as Ki,a0 as so,a1 as Xi,a2 as oo,a3 as ao,a4 as ro,a5 as oi,a6 as co,a7 as At}from"./fuse-7xj_Hrid.js";import"./tinyld-light-PxOyhYWY.js";import"./index-ELVm98zU.js";var Zi=lo;function lo(t,n,s){var i=null,o=null,a=function(){i&&(clearTimeout(i),o=null,i=null)},h=function(){var r=o;a(),r&&r()},d=function(){if(!n)return t.apply(this,arguments);var r=this,u=arguments,p=s&&!i;if(a(),o=function(){t.apply(r,u)},i=setTimeout(function(){if(i=null,!p){var c=o;return o=null,c()}},n),p)return o()};return d.cancel=a,d.flush=h,d}/*!
* 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(l,b){b=b||{bubbles:!1,cancelable:!1,detail:void 0};var m=n.createEvent("CustomEvent");return m.initCustomEvent(l,b.bubbles,b.cancelable,b.detail),m},t.CustomEvent.prototype=t.Event.prototype),n.addEventListener("touchstart",p,!1),n.addEventListener("touchmove",c,!1),n.addEventListener("touchend",u,!1);var s=null,i=null,o=null,a=null,h=null,d=null,r=0;function u(l){if(d===l.target){var b=parseInt(f(d,"data-swipe-threshold","20"),10),m=f(d,"data-swipe-unit","px"),k=parseInt(f(d,"data-swipe-timeout","500"),10),g=Date.now()-h,y="",T=l.changedTouches||l.touches||[];if(m==="vh"&&(b=Math.round(b/100*n.documentElement.clientHeight)),m==="vw"&&(b=Math.round(b/100*n.documentElement.clientWidth)),Math.abs(o)>Math.abs(a)?Math.abs(o)>b&&g<k&&(o>0?y="swiped-left":y="swiped-right"):Math.abs(a)>b&&g<k&&(a>0?y="swiped-up":y="swiped-down"),y!==""){var w={dir:y.replace(/swiped-/,""),touchType:(T[0]||{}).touchType||"direct",fingers:r,xStart:parseInt(s,10),xEnd:parseInt((T[0]||{}).clientX||-1,10),yStart:parseInt(i,10),yEnd:parseInt((T[0]||{}).clientY||-1,10)};d.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:w})),d.dispatchEvent(new CustomEvent(y,{bubbles:!0,cancelable:!0,detail:w}))}s=null,i=null,h=null}}function p(l){l.target.getAttribute("data-swipe-ignore")!=="true"&&(d=l.target,h=Date.now(),s=l.touches[0].clientX,i=l.touches[0].clientY,o=0,a=0,r=l.touches.length)}function c(l){if(!(!s||!i)){var b=l.touches[0].clientX,m=l.touches[0].clientY;o=s-b,a=i-m}}function f(l,b,m){for(;l&&l!==n.documentElement;){var k=l.getAttribute(b);if(k)return k;l=l.parentNode}return m}})(window,document);function Nt(t=()=>{},n=[]){const s=H(t);Z(()=>{s.current=t},[n]),Z(()=>{const i=()=>{const o=document.hidden||document.visibilityState==="hidden";s.current(!o)};return document.addEventListener("visibilitychange",i),()=>document.removeEventListener("visibilitychange",i)},[])}const uo=1e3*3,ho=2e4,fo=Je(function({isLoggedIn:n}){const[s,i]=A(!0);Nt(i);const o=async(d,r,u)=>{var p;if($.notificationsLast){const c=d.v1.notifications.list({limit:1,sinceId:$.notificationsLast.id}),{value:f}=await c.next();if(f!=null&&f.length)if(u)$.notificationsShowNew=!0;else{let l;try{const b=await d.v1.markers.fetch({timeline:"notifications"});l=(p=b==null?void 0:b.notifications)==null?void 0:p.lastReadId}catch{}l?$.notificationsShowNew=f[0].id!==l:$.notificationsShowNew=!0}}};Z(()=>{let d,r,u;if(n&&s){const{masto:p,streaming:c,instance:f}=se();(async()=>{await o(p,f);let l=!1;c&&(r=setTimeout(()=>{(async()=>{try{l=!0,d=c.user.notification.subscribe();for await(const b of d){if(!d||!s)break;b.event==="notification"&&He(b.payload,f,{skipThreading:!0}),$.notificationsShowNew=!0}}catch{l=!1}l||(u=setInterval(()=>{o(p,f,!0)},ho))})()},uo))})()}return()=>{var p;(p=d==null?void 0:d.unsubscribe)==null||p.call(d),d=null,clearTimeout(r),clearInterval(u)}},[s,n]);const a=H(),h=()=>{a.current=Date.now(),fetch("./version.json").then(d=>d.json()).then(d=>{d&&($.appVersion=d)}).catch(d=>{})};return Nn(h,s&&1e3*60*30),Nt(d=>{d&&(a.current?Date.now()-a.current>1e3*60*60&&h():h())}),Le("shift+alt+k",()=>{const d=$.settings.cloakMode;$.settings.cloakMode=!d,oe({text:`Cloak mode ${d?"disabled":"enabled"}`})}),null});function po(){const t=Ne($);function n(s){if(t.composerState.minimized){$.composerState.minimized=!1,ti();return}s.shiftKey?js()||($.showCompose=!0):(ti(),$.showCompose=!0)}return Le("c, shift+c",n,{ignoreEventWhen:s=>!!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(v,{icon:"quill",size:"xl",alt:"Compose"})})}const mo=Je(function(){const n=Ne($);function s(){$.showKeyboardShortcutsHelp=!1}return Le("?, shift+?, shift+slash",i=>{$.showKeyboardShortcutsHelp=!0},{ignoreEventWhen:i=>!!document.querySelector("#modal-container > *")}),!!n.showKeyboardShortcutsHelp&&e(_e,{onClose:
${ae.daysSinceLastPost} day${ae.daysSinceLastPost>1?"s":""}`:`
Last ${ae.total} posts in the past year(s)
`}),e("div",{class:"posting-stats-bar",style:{"--originals-percentage":`${ae.originals/ae.total*100}%`,"--replies-percentage":`${(ae.originals+ae.replies)/ae.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."})})})}),!j&&e("div",{class:"account-metadata-box",children:e("div",{class:"shazam-container no-animation",hidden:!!ae,children:e("div",{class:"shazam-container-inner",children:e("button",{type:"button",class:"posting-stats-button",disabled:E==="loading",onClick:()=>{Q()},children:[e("div",{class:`posting-stats-bar posting-stats-icon ${E==="loading"?"loading":""}`,style:{"--originals-percentage":"33%","--replies-percentage":"66%"}}),"View post stats"," "]})})})})]}),e("footer",{children:e(ea,{info:c,instance:i,standalone:s,authenticated:o,onRelationshipChange:ue,onProfileUpdate:De})})]})]})}const Qo=3;function ea({info:t,instance:n,standalone:s,authenticated:i,onRelationshipChange:o=()=>{},onProfileUpdate:a=()=>{}}){var ae;if(!t)return null;const{masto:h,instance:d,authenticated:r}=se(),u=n===d,[p,c]=A("default"),[f,l]=A(null),{id:b,acct:m,url:k,username:g,locked:y,lastStatusAt:T,note:w,fields:S,moved:I}=t,x=H(b),{following:U,showingReblogs:M,notifying:N,followedBy:te,blocking:J,blockedBy:L,muting:P,mutingNotifications:F,requested:z,domainBlocking:j,endorsed:V,note:D}=f||{},[ie,G]=A(null),[de,he]=A(!1),le=m.includes("@")?m:`${m}@${n}`;Z(()=>{if(t){const K=dt();let E;(async()=>{if(u&&i)E=b;else if(!u&&r){const _=t.acct.includes("@");try{const B=await h.v2.search.fetch({q:_?t.acct:`${t.username}@${n}`,type:"accounts",limit:1,resolve:!0});B.accounts.length&&(E=B.accounts[0].id,G(B.accounts[0]))}catch{}}if(!E)return;if(K===E){he(!0);return}x.current=E,c("loading");const W=h.v1.accounts.relationships.fetch({id:[E]});try{const _=await W;if(c("default"),_.length){const B=_[0];l(B),o({relationship:B,currentID:E})}}catch{c("error")}})()}},[t,i]),Z(()=>{t&&de&&Ls(t)},[t,de]);const ge=p==="loading",[Te,Se]=A(!1),[Pe,Re]=A(!1),[Ae,Ie]=A(!1),[xe,ve]=A(!1),[ee,be]=A([]);return e(R,{children:[e("div",{class:"actions",children:[e("span",{children:[te?e("span",{class:"tag",children:"Follows you"}):T?e("small",{class:"insignificant",children:["Last post:"," ",e("span",{class:"ib",children:rt(T,{hideTime:!0})})]}):e("span",{}),P&&e("span",{class:"tag danger",children:"Muted"}),J&&e("span",{class:"tag danger",children:"Blocked"})]})," ",e("span",{class:"buttons",children:[!!D&&e("button",{type:"button",class:"private-note-tag",title:"Private note",onClick:()=>{Ie(!0)},dir:"auto",children:e("span",{children:D})}),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:ge,children:e(v,{icon:"more",size:"l",alt:"More"})}),onMenuChange:K=>{U&&K.open&&(async()=>{try{const E=await h.v1.accounts.$select(x.current).lists.list();be(E)}catch{}})()},children:[r&&!de&&e(R,{children:[e(pe,{onClick:()=>{Ws({draftStatus:{status:`@${(ie==null?void 0:ie.acct)||m} `}})},children:[e(v,{icon:"at"}),e("span",{children:["Mention @",g]})]}),e(pe,{onClick:()=>{Se(!0)},children:[e(v,{icon:"translate"}),e("span",{children:"Translate bio"})]}),Ve("@mastodon/profile-private-note")&&e(pe,{onClick:()=>{Ie(!0)},children:[e(v,{icon:"pencil"}),e("span",{children:D?"Edit private note":"Add private note"})]}),U&&!!f&&e(R,{children:[e(pe,{onClick:()=>{c("loading"),(async()=>{try{const K=await h.v1.accounts.$select(x.current).follow({notify:!N});K&&l(K),c("default"),oe(K.notifying?`Notifications enabled for @${g}'s posts.`:` Notifications disab
${ii(h)}`).join(`
`))||"",o=ii(t)+(i?`
${i}`:"");return e("div",{class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(v,{icon:"x"})}),e("header",{children:e("h2",{children:"Translated Bio"})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:o}),e(Gi,{forceTranslate:!0,text:o})]})]})}function sa({accountID:t,onClose:n}){const{masto:s}=se(),[i,o]=A("default"),[a,h]=A([]),[d,r]=A([]),[u,p]=St(l=>l+1,0);Z(()=>{o("loading"),(async()=>{try{const l=await Kt();h(l);const b=await s.v1.accounts.$select(t).lists.list();r(b),o("default")}catch{o("error")}})()},[u]);const[c,f]=A(!1);return e("div",{class:"sheet",id:"list-add-remove-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(v,{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:i==="loading",onClick:()=>{o("loading"),(async()=>{try{b?await s.v1.lists.$select(l.id).accounts.remove({accountIds:[t]}):await s.v1.lists.$select(l.id).accounts.create({accountIds:[t]}),p()}catch{o("error"),alert(b?"Unable to remove from list.":"Unable to add to list.")}})()},children:[e(v,{icon:"check-circle"}),e("span",{children:l.title})]})})})}):i==="loading"?e("p",{class:"ui-state",children:e($e,{abrupt:!0})}):i==="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:()=>f(!0),disabled:i!=="default",children:[e(v,{icon:"plus",size:"l"})," ",e("span",{children:"New list"})]})]}),c&&e(_e,{onClick:l=>{l.target===l.currentTarget&&f(!1)},children:e(Gn,{list:c==null?void 0:c.list,onClose:l=>{l.state==="success"&&p(),f(!1)}})})]})}function oa({account:t,note:n,onRelationshipChange:s=()=>{},onClose:i=()=>{}}){const{masto:o}=se(),[a,h]=A("default"),d=H(null);return Z(()=>{let r;return d.current&&!n&&(r=setTimeout(()=>{var u,p;(p=(u=d.current).focus)==null||p.call(u)},100)),()=>{clearTimeout(r)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(v,{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 p=new FormData(r.target).get("note");(p==null?void 0:p.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:p});h("default"),s(c),i()}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",dir:"auto",children:n}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:a==="loading",onClick:()=>{i==null||i()},children:"Cancel"}),e("span",{children:[e($e,{abrupt:!0,hidden:a!=="loading"}),e("button",{disabled:a==="loading",type:"submit",children:"Save & close"})]})]})]})})]})}function aa({onClose:t=()=>{}}){const{masto:n}=se(),[s,i]=A("loading"),[o,a]=A(null);Z(()=>{(async()=>{try{const c=await n.v1.accounts.verifyCredentials();a(c),i("default")}catch{i("error")}})()},[]);const{displayName:h,source:d}=o||{},{note:r,fields:u}=d||{},p=H(null);return e("div",{class:"sheet",id:"edit-profile-container",children:[!!t&&e("button",{type:"button",class:"sheet-close",onClick:t,children:e(v,{icon:"x"})}),e("header",{children:e("b",{children:"Edit profile"})}),e("main",{children:s==="loading"?e("p",{class:"ui-state",children:e($e,{abrupt:!0})}):e("form",{onSubmit:c=>{c.preventDefault();const f=new FormData(c.target),l=f.get("display_name"),b=f.get("note"),m=p.current.querySelectorAll('input[name^="fields_attributes"]'),k=[];m.forEach(g=>{const y=g.name,[T,w,S]=y.match(/fields_attributes\[(\d+)\]\[(.+)\]/)||[],I=g.value?g.value.trim():"";w&&S&&I&&(k[w]||(k[w]={}),k[w][S]=I)}),k.forEach(g=>{g.n
rgba(${x==null?void 0:x.join(",")}, 0.4) ${M}%,
rgba(${x==null?void 0:x.join(",")}, 0.4) ${N}%
`:`
transparent ${M}%,
transparent ${N}%
`}))==null?void 0:I.join(", "))||"transparent"},[m]);let g=H(null);return Z(()=>()=>{var w,S;(S=(w=g.current)==null?void 0:w.hideToast)==null||S.call(w)},[]),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:w=>{(w.target.classList.contains("carousel-item")||w.target.classList.contains("media")||w.target.classList.contains("media-zoom"))&&a()},style:t.length>1?{backgroundAttachment:"local",backgroundImage:`linear-gradient(
to ${wt()?"left":"right"}, ${k})`}:{},children:t==null?void 0:t.map((w,S)=>{const I=t.length===1?m[S]: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:S===u?c:null,onClick:x=>{x.target.classList.contains("media")||b(!l)},children:[!!w.description&&e("button",{type:"button",class:"media-alt",hidden:!l,onClick:()=>{$.showMediaAlt={alt:w.description,lang:i}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:i,dir:"auto",children:w.description})]}),e(ji,{media:w,showOriginal:!0,lang:i})]},w.id)})}),e("div",{class:"carousel-top-controls",hidden:!l,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>a(),children:e(v,{icon:"x"})})}),(t==null?void 0:t.length)>1?e("span",{class:"carousel-dots",children:t==null?void 0:t.map((w,S)=>e("button",{type:"button",disabled:S===u,class:`carousel-dot ${S===u?"active":""}`,onClick:I=>{I.preventDefault(),I.stopPropagation(),r.current.scrollTo({left:r.current.clientWidth*S*(wt()?-1:1),behavior:"smooth"}),r.current.focus()},children:e(v,{icon:"round",size:"s"})},w.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(v,{icon:"more",alt:"More"})}),children:[e(Ee,{href:((y=t[u])==null?void 0:y.remoteUrl)||((T=t[u])==null?void 0:T.url),class:"carousel-button",target:"_blank",title:"Open original media in new window",children:[e(v,{icon:"popout"}),e("span",{children:"Open original media"})]}),!1]})," ",e(re,{to:`${s?`/${s}`:""}/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:w=>{w.preventDefault(),w.stopPropagation(),r.current.focus(),r.current.scrollTo({left:r.current.clientWidth*(u-1)*(wt()?-1:1),behavior:"smooth"})},children:e(v,{icon:"arrow-left"})}),e("button",{type:"button",class:"carousel-button",hidden:u===t.length-1,onClick:w=>{w.preventDefault(),w.stopPropagation(),r.current.focus(),r.current.scrollTo({left:r.current.clientWidth*(u+1)*(wt()?-1:1),behavior:"smooth"})},children:e(v,{icon:"arrow-right"})})]})]})}const ga=[,"spam","legal","violation","other"],zt={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 ba({account:t,post:n,onClose:s}){const{masto:i}=se(),[o,a]=A("default"),[h,d]=t.acct.split("@"),[r,u]=me(()=>{const{rules:g,domain:y}=Oi();return[g||[],y]}),[p,c]=A(null),[f,l]=A(!1),b=H(null),[m,k]=A(!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:()=>s(),children:e(v,{icon:"x",size:"xl"})})]}),e("main",{children:[e("div",{class:"report-preview",children:n?e(Ue,{status:n,size:"s",previewMode:!0}):e(Qe,{account:t,avatarSize:"xxl",useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!p&&!zt[p].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[zt[p].stampLabel||zt[p].label,e("small",{children:"Pending review"})]},p),e("form",{onSubmit:g=>{g.preventDefault();const y=new FormData(g.target),T=Object.fromEntries(y.entries());let{category:w,comment:S,forward:I}=T;S||(S=void 0),I==="on"&&(I=!0);const x=w==="violation"?Object.entries(T).filter(([M])=>M.startsWith("rule_ids"
<phanpy-shortcuts-settings>${g}</phanpy-shortcuts-settings>`,oe("Saving shortcuts to instance server…"),await s.v1.accounts.$select(f).note.create({comment:k}),d("default"),oe("Shortcuts saved")}}catch{d("error"),oe("Unable to save shortcuts")}},title:"Sync to instance server",children:[e(v,{icon:"cloud"}),e(v,{icon:"arrow-up"})]})," ",i.length>0&&e("small",{class:"insignificant ib",children:[i.length," characters"]})]}),!!i&&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)})]})]}),$.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(v,{icon:"cloud"})," Import/export settings from/to instance server (Very experimental)"]})})]})]})}Fi($,t=>{for(const[n,s,i,o]of t)/^show/i.test(s)&&!i&&xn()});function Ea(){var i,o,a,h,d,r,u,p;const t=Ne($),n=zi(),s=Ot();return Z(()=>{setTimeout(Ms,1e3)},[]),e(R,{children:[!!t.showCompose&&e(_e,{class:`solid ${t.composerState.minimized?"min":""}`,minimized:!!t.composerState.minimized,children:e(Ns,{replyToStatus:typeof t.showCompose!="boolean"?t.showCompose.replyToStatus:((i=window.__COMPOSE__)==null?void 0:i.replyToStatus)||null,editStatus:((o=$.showCompose)==null?void 0:o.editStatus)||((a=window.__COMPOSE__)==null?void 0:a.editStatus)||null,draftStatus:((h=$.showCompose)==null?void 0:h.draftStatus)||((d=window.__COMPOSE__)==null?void 0:d.draftStatus)||null,onClose:c=>{const{newStatus:f,instance:l,type:b}=c||{};$.showCompose=!1,window.__COMPOSE__=null,f&&($.reloadStatusPage++,oe({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(),$.prevLocation=s,n(l?`/${l}/s/${f.id}`:`/s/${f.id}`)}}))}})}),!!t.showSettings&&e(_e,{onClose:()=>{$.showSettings=!1},children:e(zo,{onClose:()=>{$.showSettings=!1}})}),!!t.showAccounts&&e(_e,{onClose:()=>{$.showAccounts=!1},children:e(Ro,{onClose:()=>{$.showAccounts=!1}})}),!!t.showAccount&&e(_e,{onClose:()=>{$.showAccount=!1},children:e(la,{account:((r=t.showAccount)==null?void 0:r.account)||t.showAccount,instance:(u=t.showAccount)==null?void 0:u.instance,onClose:({destination:c}={})=>{$.showAccount=!1}})}),!!t.showDrafts&&e(_e,{onClose:()=>{$.showDrafts=!1},children:e(da,{onClose:()=>$.showDrafts=!1})}),!!t.showMediaModal&&e(_e,{onClick:c=>{(c.target===c.currentTarget||c.target.classList.contains("media"))&&($.showMediaModal=!1)},children:e(ds,{mediaAttachments:t.showMediaModal.mediaAttachments,instance:t.showMediaModal.instance,index:t.showMediaModal.index,statusID:t.showMediaModal.statusID,onClose:()=>{$.showMediaModal=!1}})}),!!t.showShortcutsSettings&&e(_e,{onClose:()=>{$.showShortcutsSettings=!1},children:e(Aa,{onClose:()=>$.showShortcutsSettings=!1})}),!!t.showGenericAccounts&&e(_e,{onClose:()=>{$.showGenericAccounts=!1},children:e(fa,{instance:t.showGenericAccounts.instance,excludeRelationshipAttrs:t.showGenericAccounts.excludeRelationshipAttrs,postID:t.showGenericAccounts.postID,onClose:()=>$.showGenericAccounts=!1,blankCopy:t.showGenericAccounts.blankCopy})}),!!t.showMediaAlt&&e(_e,{onClose:c=>{$.showMediaAlt=!1},children:e(pa,{alt:t.showMediaAlt.alt||t.showMediaAlt,lang:(p=t.showMediaAlt)==null?void 0:p.lang,onClose:()=>{$.showMediaAlt=!1}})}),!!t.showEmbedModal&&e(_e,{class:"solid",onClose:()=>{$.showEmbedModal=!1},children:e(ha,{html:t.showEmbedModal.html,url:t.showEmbedModal.url,width:t.showEmbedModal.width,height:t.showEmbedModal.height,onClose:()=>{$.showEmbedModal=!1}})}),!!t.showReportModal&&e(_e,{onClose:()=>{$.showReportModal=!1},children:e(ba,{account:t.showReportModal.account,post:t.showReportModal.post,onClose:()=>{$.showReportModal=!1}})})]})}function An({accountID:t,onChange:n}){const{masto:s}=se(),[i,o]=A("default"),[a,h]=A(null),[d,r]=A(null),u=d!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:i==="loading"||u,onClick:()=>{o("loading"),h("accept"),(async()=>{try{con
media-post
${ee?"filtered":""}
${be?"has-spoiler":""}
${K?"show-media":""}
`,children:e(ji,{class:t,media:W,lang:P,to:`/${i}/s/${y}?media-only=${_+1}`,onClick:a?ue=>a(ue,_,W,s):void 0})},B)})}const Si=Je(Ga);function ja(t){var S,I,x,U,M;const n=Ne($),{masto:s,instance:i,authenticated:o}=se(),[a,h]=me(()=>{const N=we.local.getJSON("accounts")||[];return[N.find(J=>J.info.id===dt())||N[0],N.length>1]},[]),d=(n.settings.shortcutsViewMode==="multi-column"||!n.settings.shortcutsViewMode&&n.settings.shortcutsColumnsMode)&&!n.shortcuts.find(N=>N.type==="following"),r=eo(()=>{$.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),u=H(),[p,c]=A(void 0),f=to([0,0,n.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),l=H();async function b(N){return(N||!l.current)&&(l.current=s.v1.mutes.list({limit:80})),await l.current.next()}const m=H();async function k(N){return(N||!m.current)&&(m.current=s.v1.blocks.list({limit:80})),await m.current.next()}const g=Ve("@mastodon/lists"),[y,T]=A([]);Z(()=>{g&&p==="open"&&Kt().then(T)},[p==="open"]);const w=H();return e(R,{children:[e("button",{ref:u,type:"button",class:`button plain nav-menu-button ${h?"with-avatar":""} ${p==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{w.current=Date.now(),c(N=>N?void 0:"open")},onContextMenu:N=>{N.preventDefault(),$.showAccounts=!0},...r(),children:[h&&e(nt,{url:((S=a==null?void 0:a.info)==null?void 0:S.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(v,{icon:"menu",size:h?"s":"l"})]}),e(Wi,{menuClassName:"nav-menu",state:p,anchorRef:u,onClose:()=>{c(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-w.current<300}},portal:{target:document.body},...t,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:f,unmountOnClose:!0,children:[!!((U=n.appVersion)!=null&&U.commitHash)&&n.appVersion.commitHash!=="16248c4"&&e("div",{class:"top-menu",children:[e(pe,{onClick:()=>{confirm("Reload page now to update?")&&(async()=>{try{location.reload()}catch{}})()},children:[e(v,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:"New update available…"})]}),e(Be,{})]}),e("section",{children:[e(Ee,{to:"/",children:[e(v,{icon:"home",size:"l"})," ",e("span",{children:"Home"})]}),o?e(R,{children:[d&&e(Ee,{to:"/following",children:[e(v,{icon:"following",size:"l"})," ",e("span",{children:"Following"})]}),e(Ee,{to:"/catchup",children:[e(v,{icon:"history2",size:"l"}),e("span",{children:"Catch-up"})]}),Ve("@mastodon/mentions")&&e(Ee,{to:"/mentions",children:[e(v,{icon:"at",size:"l"})," ",e("span",{children:"Mentions"})]}),e(Ee,{to:"/notifications",children:[e(v,{icon:"notification",size:"l"})," ",e("span",{children:"Notifications"}),n.notificationsShowNew&&e("sup",{title:"New",style:{opacity:.5},children:[" ","•"]})]}),e(Be,{}),((M=a==null?void 0:a.info)==null?void 0:M.id)&&e(Ee,{to:`/${i}/a/${a.info.id}`,children:[e(v,{icon:"user",size:"l"})," ",e("span",{children:"Profile"})]}),(y==null?void 0:y.length)>0?e(ln,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(R,{children:[e(v,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:"Lists"}),e(v,{icon:"chevron-right"})]}),children:[e(Ee,{to:"/l",children:e("span",{children:"All Lists"})}),(y==null?void 0:y.length)>0&&e(R,{children:[e(Be,{}),y.map(N=>e(Ee,{to:`/l/${N.id}`,children:e("span",{children:N.title})},N.id))]})]}):g&&e(Ee,{to:"/l",children:[e(v,{icon:"list",size:"l"}),e("span",{children:"Lists"})]}),e(Ee,{to:"/b",children:[e(v,{icon:"bookmark",size:"l"})," ",e("span",{children:"Bookmarks"})]}),e(ln,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(R,{children:[e(v,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:"More…"}),e(v,{icon:"chevron-right"})]}),children:[e(Ee,{to:"/f",children:[e(v,{icon:"heart",size:"l"})," ",e("span",{children:"Likes"})]}),e(Ee,{to:"/fh",children:[e(v,{icon:"hashtag",size:"l"})," ",e("span",{children:"Followed Hashtags"})]}),e(Be,{}),Ve("@mastodon/filters")&&e(Ee,{to:"/ft",children:[e(v,{icon:"filters",size:"l"}),"Filters"]}),e(pe,{onClick:()
//# sourceMappingURL=main-q4UThEef.js.map