33 lines
270 KiB
JavaScript
33 lines
270 KiB
JavaScript
|
import{A as q,y as Z,h as A,s as $,a as ie,b as He,x as Je,u as Ne,c as e,k as R,d as we,g as dt,p as kt,e as Pi,f as Rt,i as Pt,j as ft,T as me,q as et,l as Rs,L as $e,m as rn,_ as ut,n as Ui,o as Gc,r as Oi,t as Fi,v as Es,C as Ls,w as Xe,z as Ms,B as ot,F as Ns,D as Ds,E as Ps,G as En,H as St,I as qe,J as zi,K as Us,M as Os,N as qt,O as Fs,P as zs,Q as Zn,R as Jn,S as Bs,U as Qn,V as Ln,W as Fe,X as Hs,Y as qs}from"./useTitle-KlNTnsJV.js";import{u as Mn,s as oe,a as Le,o as ei,b as Vs,I as v,M as _e,A as nt,N as Et,c as Ze,d as pe,e as Be,f as tt,L as re,g as Bi,l as Gs,t as ti,h as Ve,R as It,p as Ut,i as Qe,j as Ee,k as Hi,m as Sn,E as qi,n as je,q as rt,r as js,S as cn,v as ni,T as Vi,w as st,x as Nn,y as Ue,z as ht,B as ii,C as Ys,D as Ws,F as Dn,G as Gi,H as Ks,J as Xs,K as Zs,O as ji,P as Vt,Q as Js,U as Qs,V as Yi,W as eo,X as wt,Y as Pn,Z as to,_ as Wi,$ as no,a0 as Ki,a1 as io,a2 as so,a3 as oo,a4 as si,a5 as ao,a6 as Kt}from"./fuse-eCqHk9H3.js";import"./tinyld-light-PxOyhYWY.js";import"./index-cp67bciK.js";var Xi=ro;function ro(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()},u=function(){if(!n)return t.apply(this,arguments);var r=this,d=arguments,p=s&&!i;if(a(),o=function(){t.apply(r,d)},i=setTimeout(function(){if(i=null,!p){var c=o;return o=null,c()}},n),p)return o()};return u.cancel=a,u.flush=h,u}/*!
|
||
|
* 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,g){g=g||{bubbles:!1,cancelable:!1,detail:void 0};var m=n.createEvent("CustomEvent");return m.initCustomEvent(l,g.bubbles,g.cancelable,g.detail),m},t.CustomEvent.prototype=t.Event.prototype),n.addEventListener("touchstart",p,!1),n.addEventListener("touchmove",c,!1),n.addEventListener("touchend",d,!1);var s=null,i=null,o=null,a=null,h=null,u=null,r=0;function d(l){if(u===l.target){var g=parseInt(f(u,"data-swipe-threshold","20"),10),m=f(u,"data-swipe-unit","px"),k=parseInt(f(u,"data-swipe-timeout","500"),10),b=Date.now()-h,y="",T=l.changedTouches||l.touches||[];if(m==="vh"&&(g=Math.round(g/100*n.documentElement.clientHeight)),m==="vw"&&(g=Math.round(g/100*n.documentElement.clientWidth)),Math.abs(o)>Math.abs(a)?Math.abs(o)>g&&b<k&&(o>0?y="swiped-left":y="swiped-right"):Math.abs(a)>g&&b<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)};u.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:w})),u.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"&&(u=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 g=l.touches[0].clientX,m=l.touches[0].clientY;o=s-g,a=i-m}}function f(l,g,m){for(;l&&l!==n.documentElement;){var k=l.getAttribute(g);if(k)return k;l=l.parentNode}return m}})(window,document);function Lt(t=()=>{},n=[]){const s=q(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 co=1e3*3,lo=15e3,uo=Je(function({isLoggedIn:n}){const[s,i]=A(!0);Lt(i);const o=async(u,r,d)=>{var p;if($.notificationsLast){const c=u.v1.notifications.list({limit:1,sinceId:$.notificationsLast.id}),{value:f}=await c.next();if(f!=null&&f.length)if(d)$.notificationsShowNew=!0;else{let l;try{const g=await u.v1.markers.fetch({timeline:"notifications"});l=(p=g==null?void 0:g.notifications)==null?void 0:p.lastReadId}catch{}l?$.notificationsShowNew=f[0].id!==l:$.notificationsShowNew=!0}}};Z(()=>{let u,r;if(n&&s){const{masto:d,streaming:p,instance:c}=ie();(async()=>{await o(d,c);let f=!1;p&&(r=setTimeout(()=>{(async()=>{try{f=!0,u=p.user.notification.subscribe();for await(const l of u){if(!u||!s)break;l.event==="notification"&&He(l.payload,c,{skipThreading:!0}),$.notificationsShowNew=!0}}catch{f=!1}f||(r=setInterval(()=>{o(d,c,!0)},lo))})()},co))})()}return()=>{var d;(d=u==null?void 0:u.unsubscribe)==null||d.call(u),u=null,clearTimeout(r),clearInterval(r)}},[s,n]);const a=q(),h=()=>{a.current=Date.now(),fetch("./version.json").then(u=>u.json()).then(u=>{u&&($.appVersion=u)}).catch(u=>{})};return Mn(h,s&&1e3*60*30),Lt(u=>{u&&(a.current?Date.now()-a.current>1e3*60*60&&h():h())}),Le("shift+alt+k",()=>{const u=$.settings.cloakMode;$.settings.cloakMode=!u,oe({text:`Cloak mode ${u?"disabled":"enabled"}`})}),null});function ho(){const t=Ne($);function n(s){if(t.composerState.minimized){$.composerState.minimized=!1,ei();return}s.shiftKey?Vs()||($.showCompose=!0):(ei(),$.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 fo=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:s
|
||
|
${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(Jo,{info:c,instance:i,standalone:s,authenticated:o,onRelationshipChange:ue,onProfileUpdate:De})})]})]})}const Zo=3;function Jo({info:t,instance:n,standalone:s,authenticated:i,onRelationshipChange:o=()=>{},onProfileUpdate:a=()=>{}}){var ae;if(!t)return null;const{masto:h,instance:u,authenticated:r}=ie(),d=n===u,[p,c]=A("default"),[f,l]=A(null),{id:g,acct:m,url:k,username:b,locked:y,lastStatusAt:T,note:w,fields:S,moved:I}=t,x=q(g),{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||{},[se,G]=A(null),[de,he]=A(!1),le=m.includes("@")?m:`${m}@${n}`;Z(()=>{if(t){const K=dt();let E;(async()=>{if(d&&i)E=g;else if(!d&&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&&Rs(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:()=>{js({draftStatus:{status:`@${(se==null?void 0:se.acct)||m} `}})},children:[e(v,{icon:"at"}),e("span",{children:["Mention @",b]})]}),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 @${b}'s posts.`:` Notifications disab
|
||
|
${ni(h)}`).join(`
|
||
|
|
||
|
`))||"",o=ni(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(Vi,{forceTranslate:!0,text:o})]})]})}function na({accountID:t,onClose:n}){const{masto:s}=ie(),[i,o]=A("default"),[a,h]=A([]),[u,r]=A([]),[d,p]=kt(l=>l+1,0);Z(()=>{o("loading"),(async()=>{try{const l=await Yt();h(l);const g=await s.v1.accounts.$select(t).lists.list();r(g),o("default")}catch{o("error")}})()},[d]);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 g=u.some(m=>m.id===l.id);return e("li",{children:e("button",{type:"button",class:`light ${g?"checked":""}`,disabled:i==="loading",onClick:()=>{o("loading"),(async()=>{try{g?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(g?"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(Vn,{list:c==null?void 0:c.list,onClose:l=>{l.state==="success"&&p(),f(!1)}})})]})}function ia({account:t,note:n,onRelationshipChange:s=()=>{},onClose:i=()=>{}}){const{masto:o}=ie(),[a,h]=A("default"),u=q(null);return Z(()=>{let r;return u.current&&!n&&(r=setTimeout(()=>{var d,p;(p=(d=u.current).focus)==null||p.call(d)},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:u,name:"note",disabled:a==="loading",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 sa({onClose:t=()=>{}}){const{masto:n}=ie(),[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:u}=o||{},{note:r,fields:d}=u||{},p=q(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"),g=f.get("note"),m=p.current.querySelectorAll('input[name^="fields_attributes"]'),k=[];m.forEach(b=>{const y=b.name,[T,w,S]=y.match(/fields_attributes\[(\d+)\]\[(.+)\]/)||[],I=b.value?b.value.trim():"";w&&S&&I&&(k[w]||(k[w]={}),k[w][S]=I)}),k.forEach(b=>{b.name&&!b.val
|
||
|
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 b=q(null);return Z(()=>()=>{var w,S;(S=(w=b.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 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===d?c:null,onClick:x=>{x.target.classList.contains("media")||g(!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(Gi,{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===d,class:`carousel-dot ${S===d?"active":""}`,onClick:I=>{I.preventDefault(),I.stopPropagation(),r.current.scrollTo({left:r.current.clientWidth*S,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[d])==null?void 0:y.remoteUrl)||((T=t[d])==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=${d+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:d===0,onClick:w=>{w.preventDefault(),w.stopPropagation(),r.current.focus(),r.current.scrollTo({left:r.current.clientWidth*(d-1),behavior:"smooth"})},children:e(v,{icon:"arrow-left"})}),e("button",{type:"button",class:"carousel-button",hidden:d===t.length-1,onClick:w=>{w.preventDefault(),w.stopPropagation(),r.current.focus(),r.current.scrollTo({left:r.current.clientWidth*(d+1),behavior:"smooth"})},children:e(v,{icon:"arrow-right"})})]})]})}const pa=[,"spam","legal","violation","other"],Ot={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 ma({account:t,post:n,onClose:s}){const{masto:i}=ie(),[o,a]=A("default"),[h,u]=t.acct.split("@"),[r,d]=me(()=>{const{rules:b,domain:y}=Ui();return[b||[],y]}),[p,c]=A(null),[f,l]=A(!1),g=q(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&&!Ot[p].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[Ot[p].stampLabel||Ot[p].label,e("small",{children:"Pending review"})]},p),e("form",{onSubmit:b=>{b.preventDefault();const y=new FormData(b.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")).map(([M,N])=>N):void 0,U={category:w,comment:S,for
|
||
|
|
||
|
|
||
|
<phanpy-shortcuts-settings>${settingsJSON}</phanpy-shortcuts-settings>`;oe("Saving shortcuts to instance server…"),await s.v1.accounts.$select(f).note.create({comment:k}),u("default"),oe("Shortcuts saved")}}catch{u("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)"]})})]})]})}Oi($,t=>{for(const[n,s,i,o]of t)/^show/i.test(s)&&!i&&Tn()});function _a(){var i,o,a,h,u,r,d,p;const t=Ne($),n=Fi(),s=Pt();return Z(()=>{setTimeout(Es,1e3)},[]),e(R,{children:[!!t.showCompose&&e(_e,{class:`solid ${t.composerState.minimized?"min":""}`,minimized:!!t.composerState.minimized,children:e(Ls,{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)||((u=window.__COMPOSE__)==null?void 0:u.draftStatus)||null,onClose:c=>{const{newStatus:f,instance:l,type:g}=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."}[g||"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(Oo,{onClose:()=>{$.showSettings=!1}})}),!!t.showAccounts&&e(_e,{onClose:()=>{$.showAccounts=!1},children:e(Ao,{onClose:()=>{$.showAccounts=!1}})}),!!t.showAccount&&e(_e,{onClose:()=>{$.showAccount=!1},children:e(ra,{account:((r=t.showAccount)==null?void 0:r.account)||t.showAccount,instance:(d=t.showAccount)==null?void 0:d.instance,onClose:({destination:c}={})=>{$.showAccount=!1}})}),!!t.showDrafts&&e(_e,{onClose:()=>{$.showDrafts=!1},children:e(ca,{onClose:()=>$.showDrafts=!1})}),!!t.showMediaModal&&e(_e,{onClick:c=>{(c.target===c.currentTarget||c.target.classList.contains("media"))&&($.showMediaModal=!1)},children:e(ls,{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(xa,{onClose:()=>$.showShortcutsSettings=!1})}),!!t.showGenericAccounts&&e(_e,{onClose:()=>{$.showGenericAccounts=!1},children:e(ua,{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(ha,{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(da,{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(ma,{account:t.showReportModal.account,post:t.showReportModal.post,onClose:()=>{$.showReportModal=!1}})})]})}function $n({accountID:t,onChange:n}){const{masto:s}=ie(),[i,o]=A("default"),[a,h]=A(null),[u,r]=A(null),d=u!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:i==="loading"||d,onClick:()=>{o("loading"),h("accept"),(async(
|
||
|
media-post
|
||
|
${ee?"filtered":""}
|
||
|
${be?"has-spoiler":""}
|
||
|
${K?"show-media":""}
|
||
|
`,children:e(Gi,{class:t,media:W,lang:P,to:`/${i}/s/${y}?media-only=${_+1}`,onClick:a?ue=>a(ue,_,W,s):void 0})},B)})}const ki=Je(qa);function Va(t){var S,I,x,U,M;const n=Ne($),{masto:s,instance:i,authenticated:o}=ie(),[a,h]=me(()=>{const N=we.local.getJSON("accounts")||[];return[N.find(J=>J.info.id===dt())||N[0],N.length>1]},[]),u=(n.settings.shortcutsViewMode==="multi-column"||!n.settings.shortcutsViewMode&&n.settings.shortcutsColumnsMode)&&!n.shortcuts.find(N=>N.type==="following"),r=Js(()=>{$.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),d=q(),[p,c]=A(void 0),f=Qs([0,0,n.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),l=q();async function g(N){return(N||!l.current)&&(l.current=s.v1.mutes.list({limit:80})),await l.current.next()}const m=q();async function k(N){return(N||!m.current)&&(m.current=s.v1.blocks.list({limit:80})),await m.current.next()}const b=Ve("@mastodon/lists"),[y,T]=A([]);Z(()=>{b&&p==="open"&&Yt().then(T)},[p==="open"]);const w=q();return e(R,{children:[e("button",{ref:d,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(Yi,{menuClassName:"nav-menu",state:p,anchorRef:d,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!=="81e330d"&&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:[u&&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(cn,{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))]})]}):b&&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(cn,{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-FOJmGvRC.js.map
|