35 lines
292 KiB
JavaScript
35 lines
292 KiB
JavaScript
import{A as j,y as ne,u as ue,h as $,s as A,a as le,b as Je,M as ct,c as Ve,d as e,T as h,e as we,g as St,p as Nt,f as Sn,k as O,C as Pn,L as uo,i as Te,D as ho,j as fo,m as Kn,n as Wt,o as Ct,q as rt,r as he,t as po,v as Be,w as _n,x as Ii,_ as yt,z as ds,B as ad,E as us,F as hs,G as mo,H as go,I as ot,J as bo,K as si,N as gt,O as yo,P as vo,Q as wo,R as oi,S as Et,U as et,V as fs,W as ps,X as ko,Y as sn,Z as So,$ as _o,a0 as On,a1 as zn,a2 as Co,a3 as Ti,a4 as Io,a5 as To,a6 as xo,a7 as ci,a8 as Ge,a9 as Ao,aa as Eo,ab as Ro,ac as Lo}from"./useTitle-jLgT0T3g.js";import{u as ai,s as me,a as He,o as xi,b as $o,I as T,M as Ye,A as ht,N as pt,c as lt,d as Ie,e as qe,f as Ze,g as ut,L as ge,l as xt,h as ms,t as Ai,i as Qe,R as Zt,p as ld,j as it,k as Pt,m as dt,n as gs,q as Gn,E as bs,r as Xe,v as mt,w as Mo,S as Rn,x as Ei,T as ys,y as ft,z as ri,B as Ke,C as _t,D as Do,F as No,G as $t,H as li,J as vs,K as Po,O as Yt,P as Oo,Q as zo,U as ws,V as Uo,W as Bo,X as ks,Y as Fo,Z as Mt,_ as di,$ as Ho,a0 as Ss,a1 as qo,a2 as _s,a3 as Yo,a4 as jo,a5 as Vo,a6 as Ri,a7 as Ko,a8 as Bt}from"./fuse-1Fw6A_G2.js";var Cs=Go;function Go(n,i,s){var o=null,c=null,r=function(){o&&(clearTimeout(o),c=null,o=null)},u=function(){var d=c;r(),d&&d()},l=function(){if(!i)return n.apply(this,arguments);var d=this,a=arguments,m=s&&!o;if(r(),c=function(){n.apply(d,a)},o=setTimeout(function(){if(o=null,!m){var b=c;return c=null,b()}},i),m)return c()};return l.cancel=r,l.flush=u,l}/*!
|
||
* swiped-events.js - v@version@
|
||
* Pure JavaScript swipe events
|
||
* https://github.com/john-doherty/swiped-events
|
||
* @inspiration https://stackoverflow.com/questions/16348031/disable-scrolling-when-touch-moving-certain-element
|
||
* @author John Doherty <www.johndoherty.info>
|
||
* @license MIT
|
||
*/(function(n,i){"use strict";typeof n.CustomEvent!="function"&&(n.CustomEvent=function(p,f){f=f||{bubbles:!1,cancelable:!1,detail:void 0};var y=i.createEvent("CustomEvent");return y.initCustomEvent(p,f.bubbles,f.cancelable,f.detail),y},n.CustomEvent.prototype=n.Event.prototype),i.addEventListener("touchstart",m,!1),i.addEventListener("touchmove",b,!1),i.addEventListener("touchend",a,!1);var s=null,o=null,c=null,r=null,u=null,l=null,d=0;function a(p){if(l===p.target){var f=parseInt(g(l,"data-swipe-threshold","20"),10),y=g(l,"data-swipe-unit","px"),v=parseInt(g(l,"data-swipe-timeout","500"),10),w=Date.now()-u,S="",k=p.changedTouches||p.touches||[];if(y==="vh"&&(f=Math.round(f/100*i.documentElement.clientHeight)),y==="vw"&&(f=Math.round(f/100*i.documentElement.clientWidth)),Math.abs(c)>Math.abs(r)?Math.abs(c)>f&&w<v&&(c>0?S="swiped-left":S="swiped-right"):Math.abs(r)>f&&w<v&&(r>0?S="swiped-up":S="swiped-down"),S!==""){var _={dir:S.replace(/swiped-/,""),touchType:(k[0]||{}).touchType||"direct",fingers:d,xStart:parseInt(s,10),xEnd:parseInt((k[0]||{}).clientX||-1,10),yStart:parseInt(o,10),yEnd:parseInt((k[0]||{}).clientY||-1,10)};l.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:_})),l.dispatchEvent(new CustomEvent(S,{bubbles:!0,cancelable:!0,detail:_}))}s=null,o=null,u=null}}function m(p){p.target.getAttribute("data-swipe-ignore")!=="true"&&(l=p.target,u=Date.now(),s=p.touches[0].clientX,o=p.touches[0].clientY,c=0,r=0,d=p.touches.length)}function b(p){if(!(!s||!o)){var f=p.touches[0].clientX,y=p.touches[0].clientY;c=s-f,r=o-y}}function g(p,f,y){for(;p&&p!==i.documentElement;){var v=p.getAttribute(f);if(v)return v;p=p.parentNode}return y}})(window,document);function jt(n=()=>{},i=[]){const s=j(n);ne(()=>{s.current=n},[i]),ne(()=>{const o=()=>{const c=document.hidden||document.visibilityState==="hidden";s.current(!c)};return document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)},[])}const Wo=1e3*3,Li=2e4,Zo=ct(function({isLoggedIn:i}){const{_:s}=ue(),[o,c]=$(!0),r=j();jt(a=>{clearTimeout(r.current),a?c(!0):r.current=setTimeout(()=>{c(!1)},Li)});const u=async(a,m,b)=>{var g;if(A.notificationsLast){const p=a.v1.notifications.list({limit:1,sinceId:A.notificationsLast.id}),{value:f}=await p.next();if(f!=null&&f.length)if(b)A.notificationsShowNew=!0;else{let y;try{const v=await a.v1.markers.fetch({timeline:"notifications"});y=(g=v==null?void 0:v.notifications)==null?void 0:g.lastReadId}catch{}y?A.notificationsShowNew=f[0].id!==y:A.notificationsShowNew=!0}}};ne(()=>{let a,m,b;if(i&&o){const{masto:g,streaming:p,instance:f}=le();(async()=>{await u(g,f);let y=!1;p&&(m=setTimeout(()=>{(async()=>{try{y=!0,a=p.user.notification.subscribe();for await(const v of a){if(!a||!o)break;v.event==="notification"&&Je(v.payload,f,{skipThreading:!0}),A.notificationsShowNew=!0}}catch{y=!1}y||(b=setInterval(()=>{u(g,f,!0)},Li))})()},Wo))})()}return()=>{var g;(g=a==null?void 0:a.unsubscribe)==null||g.call(a),a=null,clearTimeout(m),clearInterval(b)}},[o,i]);const l=j(),d=()=>{l.current=Date.now(),fetch("./version.json").then(a=>a.json()).then(a=>{a&&(A.appVersion=a)}).catch(a=>{})};return ai(d,o&&1e3*60*30),jt(a=>{a&&(l.current?Date.now()-l.current>1e3*60*60&&d():d())}),He("shift+alt+k",()=>{const a=A.settings.cloakMode;A.settings.cloakMode=!a,me({text:s(a?{id:"oguMwa"}:{id:"IXZLPs"})})}),null});function Xo(){const{_:n}=ue(),i=Ve(A);function s(o){if(i.composerState.minimized){A.composerState.minimized=!1,xi();return}o.shiftKey?$o()||(A.showCompose=!0):(xi(),A.showCompose=!0)}return He("c, shift+c",s,{ignoreEventWhen:o=>!!document.querySelector("#modal-container > *")}),e("button",{type:"button",id:"compose-button",onClick:s,class:`${i.composerState.minimized?"min":""} ${i.composerState.publishing?"loading":""} ${i.composerState.publishingError?"error":""}`,children:e(T,{icon:"quill",size:"xl",alt:n({id:"QOhkyl"})})})}const Jo=ct(function(){const{_:i}=ue(),s=Ve(A);function o(){A.showKeyboardShortcutsHelp=!1}return He("?, shift+?, shift+slash",c=>{A.showKeyboardShortcutsHelp=!0},{ignoreEventWhen:c=>!!document.querySelector("#modal-container > *")}),!!s.showKeyboardShortcutsHelp&&e(Ye,{onClose:o,children:e("div",{id:"keyboard-shortcuts-help-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:o,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"77Emn0"})})}),e("main",{children:e("table",{children:e("tbody",{children:[{action:i({id:"ulXSNi"}),keys:e("kbd",{children:"?"})},{action:i({id:"Gy9P9T"}),keys:e("kbd",{children:"j"})},{action:i({id:"6XYpYY"}),keys:e("kbd",{children:"k"})},{action:i({id:"DYowFe"}),keys:e(h,{id:"mzjGX4",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"S5ez7Y"}),keys:e(h,{id:"Fd8FaU",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"VkLESX"}),keys:e("kbd",{children:"."})},{action:i({id:"jsFF8C"}),keys:e(h,{id:"80sOCm",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:e(h,{id:"41gejM",components:{0:e("br",{})}}),keys:e("kbd",{children:"x"})},{action:i({id:"jAj8rv"}),keys:e(h,{id:"evz6c6",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"duF1lx"}),keys:e(h,{id:"nhpsIN",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"YrR3Co"}),keys:e("kbd",{children:"]"})},{action:i({id:"noxAFR"}),keys:e("kbd",{children:"["})},{action:i({id:"AIa/f7"}),keys:e("kbd",{children:"c"})},{action:i({id:"snPx8X"}),className:"insignificant",keys:e(h,{id:"+Cxvld",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"1pKapz"}),keys:e(h,{id:"py67WT",components:{0:e("kbd",{}),1:e("kbd",{}),2:e("kbd",{}),3:e("kbd",{})}})},{action:i({id:"A1taO8"}),keys:e("kbd",{children:"/"})},{action:i({id:"ImOQa9"}),keys:e("kbd",{children:"r"})},{action:i({id:"KFs8c6"}),className:"insignificant",keys:e(h,{id:"XpQLJF",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"cqi4Mx"}),keys:e(h,{id:"84WuL2",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"kulphB"}),keys:e(h,{id:"yrz6Ck",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"PZlHt8"}),keys:e("kbd",{children:"d"})},{action:i({id:"C7ujRh"}),keys:e(h,{id:"v4TbMP",components:{0:e("kbd",{}),1:e("kbd",{}),2:e("kbd",{})}})}].map(({action:c,className:r,keys:u})=>e("tr",{children:[e("th",{class:r,children:c}),e("td",{children:u})]},c))})})})]})})}),Is=new Set,st=new WeakMap,Vt=new WeakMap,Dt=new WeakMap,Wn=new WeakMap,Qo=new WeakMap,Kt=new WeakMap,Cn=new WeakMap,tn=new WeakSet;let At,ui=0,hi=0;const wt="__aa_tgt",on="__aa_del",In="__aa_new",ec=n=>{const i=cc(n);i&&i.forEach(s=>ac(s))},tc=n=>{n.forEach(i=>{i.target===At&&ic(),st.has(i.target)&&Ot(i.target)})};function nc(n){const i=Wn.get(n);i==null||i.disconnect();let s=st.get(n),o=0;const c=5;s||(s=Gt(n),st.set(n,s));const{offsetWidth:r,offsetHeight:u}=At,d=[s.top-c,r-(s.left+c+s.width),u-(s.top+c+s.height),s.left-c].map(m=>`${-1*Math.floor(m)}px`).join(" "),a=new IntersectionObserver(()=>{++o>1&&Ot(n)},{root:At,threshold:1,rootMargin:d});a.observe(n),Wn.set(n,a)}function Ot(n){clearTimeout(Cn.get(n));const i=Ln(n),s=cn(i)?500:i.duration;Cn.set(n,setTimeout(async()=>{const o=Dt.get(n);try{await(o==null?void 0:o.finished),st.set(n,Gt(n)),nc(n)}catch{}},s))}function ic(){clearTimeout(Cn.get(At)),Cn.set(At,setTimeout(()=>{Is.forEach(n=>Es(n,i=>Ts(()=>Ot(i))))},100))}function sc(n){setTimeout(()=>{Qo.set(n,setInterval(()=>Ts(Ot.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function Ts(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let Zn,qt;const oc=typeof window<"u"&&"ResizeObserver"in window;oc&&(At=document.documentElement,Zn=new MutationObserver(ec),qt=new ResizeObserver(tc),window.addEventListener("scroll",()=>{hi=window.scrollY,ui=window.scrollX}),qt.observe(At));function cc(n){return n.reduce((o,c)=>[...o,...Array.from(c.addedNodes),...Array.from(c.removedNodes)],[]).every(o=>o.nodeName==="#comment")?!1:n.reduce((o,c)=>{if(o===!1)return!1;if(c.target instanceof Element){if(Un(c.target),!o.has(c.target)){o.add(c.target);for(let r=0;r<c.target.children.length;r++){const u=c.target.children.item(r);if(u){if(on in u)return!1;Un(c.target,u),o.add(u)}}}if(c.removedNodes.length)for(let r=0;r<c.removedNodes.length;r++){const u=c.removedNodes[r];if(on in u)return!1;u instanceof Element&&(o.add(u),Un(c.target,u),Vt.set(u,[c.previousSibling,c.nextSibling]))}}return o},new Set)}function Un(n,i){!i&&!(wt in n)?Object.defineProperty(n,wt,{value:n}):i&&!(wt in i)&&Object.defineProperty(i,wt,{value:n})}function ac(n){var i;const s=n.isConnected,o=st.has(n);s&&Vt.has(n)&&Vt.delete(n),Dt.has(n)&&((i=Dt.get(n))===null||i===void 0||i.cancel()),In in n?$i(n):o&&s?lc(n):o&&!s?dc(n):$i(n)}function bt(n){return Number(n.replace(/[^0-9.\-]/g,""))}function rc(n){let i=n.parentElement;for(;i;){if(i.scrollLeft||i.scrollTop)return{x:i.scrollLeft,y:i.scrollTop};i=i.parentElement}return{x:0,y:0}}function Gt(n){const i=n.getBoundingClientRect(),{x:s,y:o}=rc(n);return{top:i.top+o,left:i.left+s,width:i.width,height:i.height}}function xs(n,i,s){let o=i.width,c=i.height,r=s.width,u=s.height;const l=getComputedStyle(n);if(l.getPropertyValue("box-sizing")==="content-box"){const a=bt(l.paddingTop)+bt(l.paddingBottom)+bt(l.borderTopWidth)+bt(l.borderBottomWidth),m=bt(l.paddingLeft)+bt(l.paddingRight)+bt(l.borderRightWidth)+bt(l.borderLeftWidth);o-=m,r-=m,c-=a,u-=a}return[o,r,c,u].map(Math.round)}function Ln(n){return wt in n&&Kt.has(n[wt])?Kt.get(n[wt]):{duration:250,easing:"ease-in-out"}}function As(n){if(wt in n)return n[wt]}function fi(n){const i=As(n);return i?tn.has(i):!1}function Es(n,...i){i.forEach(s=>s(n,Kt.has(n)));for(let s=0;s<n.children.length;s++){const o=n.children.item(s);o&&i.forEach(c=>c(o,Kt.has(o)))}}function pi(n){return Array.isArray(n)?n:[n]}function cn(n){return typeof n=="function"}function lc(n){const i=st.get(n),s=Gt(n);if(!fi(n))return st.set(n,s);let o;if(!i)return;const c=Ln(n);if(typeof c!="function"){const r=i.left-s.left,u=i.top-s.top,[l,d,a,m]=xs(n,i,s),b={transform:`translate(${r}px, ${u}px)`},g={transform:"translate(0, 0)"};l!==d&&(b.width=`${l}px`,g.width=`${d}px`),a!==m&&(b.height=`${a}px`,g.height=`${m}px`),o=n.animate([b,g],{duration:c.duration,easing:c.easing})}else{const[r]=pi(c(n,"remain",i,s));o=new Animation(r),o.play()}Dt.set(n,o),st.set(n,s),o.addEventListener("finish",Ot.bind(null,n))}function $i(n){In in n&&delete n[In];const i=Gt(n);st.set(n,i);const s=Ln(n);if(!fi(n))return;let o;if(typeof s!="function")o=n.animate([{transform:"scale(.98)",opacity:0},{transform:"scale(0.98)",opacity:0,offset:.5},{transform:"scale(1)",opacity:1}],{duration:s.duration*1.5,easing:"ease-in"});else{const[c]=pi(s(n,"add",i));o=new Animation(c),o.play()}Dt.set(n,o),o.addEventListener("finish",Ot.bind(null,n))}function Mi(n,i){var s;n.remove(),st.delete(n),Vt.delete(n),Dt.delete(n),(s=Wn.get(n))===null||s===void 0||s.disconnect(),setTimeout(()=>{if(on in n&&delete n[on],Object.defineProperty(n,In,{value:!0,configurable:!0}),i&&n instanceof HTMLElement)for(const o in i)n.style[o]=""},0)}function dc(n){var i;if(!Vt.has(n)||!st.has(n))return;const[s,o]=Vt.get(n);Object.defineProperty(n,on,{value:!0,configurable:!0});const c=window.scrollX,r=window.scrollY;if(o&&o.parentNode&&o.parentNode instanceof Element?o.parentNode.insertBefore(n,o):s&&s.parentNode?s.parentNode.appendChild(n):(i=As(n))===null||i===void 0||i.appendChild(n),!fi(n))return Mi(n);const[u,l,d,a]=hc(n),m=Ln(n),b=st.get(n);(c!==ui||r!==hi)&&uc(n,c,r,m);let g,p={position:"absolute",top:`${u}px`,left:`${l}px`,width:`${d}px`,height:`${a}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!cn(m))Object.assign(n.style,p),g=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:m.duration,easing:"ease-out"});else{const[f,y]=pi(m(n,"remove",b));(y==null?void 0:y.styleReset)!==!1&&(p=(y==null?void 0:y.styleReset)||p,Object.assign(n.style,p)),g=new Animation(f),g.play()}Dt.set(n,g),g.addEventListener("finish",Mi.bind(null,n,p))}function uc(n,i,s,o){const c=ui-i,r=hi-s,u=document.documentElement.style.scrollBehavior;if(getComputedStyle(At).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+c,window.scrollY+r),!n.parentElement)return;const d=n.parentElement;let a=d.clientHeight,m=d.clientWidth;const b=performance.now();function g(){requestAnimationFrame(()=>{if(!cn(o)){const p=a-d.clientHeight,f=m-d.clientWidth;b+o.duration>performance.now()?(window.scrollTo({left:window.scrollX-f,top:window.scrollY-p}),a=d.clientHeight,m=d.clientWidth,g()):document.documentElement.style.scrollBehavior=u}})}g()}function hc(n){const i=st.get(n),[s,,o]=xs(n,i,Gt(n));let c=n.parentElement;for(;c&&(getComputedStyle(c).position==="static"||c instanceof HTMLBodyElement);)c=c.parentElement;c||(c=document.body);const r=getComputedStyle(c),u=st.get(c)||Gt(c),l=Math.round(i.top-u.top)-bt(r.borderTopWidth),d=Math.round(i.left-u.left)-bt(r.borderLeftWidth);return[l,d,s,o]}function Rs(n,i={}){return Zn&&qt&&(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!cn(i)&&!i.disrespectUserMotionPreference||(tn.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),Es(n,Ot,sc,c=>qt==null?void 0:qt.observe(c)),cn(i)?Kt.set(n,i):Kt.set(n,{duration:250,easing:"ease-in-out",...i}),Zn.observe(n,{childList:!0}),Is.add(n))),Object.freeze({parent:n,enable:()=>{tn.add(n)},disable:()=>{tn.delete(n)},isEnabled:()=>tn.has(n)})}function mi(n){const i=j(null),[s,o]=$(),c=r=>{s&&(r?s.enable():s.disable())};return ne(()=>{i.current instanceof HTMLElement&&o(Rs(i.current,n||{}))},[]),[i,c]}const fc=window.matchMedia("(display-mode: standalone)").matches;function pc({onClose:n}){const{_:i}=ue(),{masto:s}=le(),o=we.local.getJSON("accounts"),c=St(),r=o.length>1,[u,l]=Nt(a=>a+1,0),[d]=mi();return e("div",{id:"accounts-container",class:"sheet",tabIndex:"-1",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:e("h2",{children:e(h,{id:"bPwFdf"})})}),e("main",{children:e("section",{children:[e("ul",{class:"accounts-list",ref:d,children:o.map((a,m)=>{const b=a.info.id===c,g=m===0;return e("li",{children:[e("div",{children:[r&&e("span",{class:`current ${b?"is-current":""}`,children:e(T,{icon:"check-circle",alt:i({id:"Hp1l6f"})})}),e(ht,{url:a.info.avatarStatic,size:"xxl",onDblClick:async()=>{if(b)try{const p=await s.v1.accounts.$select(a.info.id).fetch();a.info=p,we.local.setJSON("accounts",o),l()}catch{}}}),e(pt,{account:r?{...a.info,acct:/@/.test(a.info.acct)?a.info.acct:`${a.info.acct}@${a.instanceURL}`}:a.info,showAcct:!0,onClick:()=>{b?A.showAccount=`${a.info.username}@${a.instanceURL}`:(Sn(a.info.id),location.reload())}})]}),e("div",{class:"actions",children:[g&&r&&e(O,{children:[e("span",{class:"tag",children:e(h,{id:"ovBPCi"})})," "]}),e(lt,{align:"end",menuButton:e("button",{type:"button",class:"plain more-button",children:e(T,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[r&&e(O,{children:[e(Ie,{disabled:b,onClick:()=>{Sn(a.info.id),location.reload()},children:[e(T,{icon:"transfer"})," ",e(h,{id:"3t/Nrv"})]}),!fc&&!b&&e(qe,{href:`./?account=${a.info.id}`,target:"_blank",children:[e(T,{icon:"external"}),e("span",{children:e(h,{id:"PZgZtY"})})]}),e(Ze,{})]}),e(Ie,{onClick:()=>{A.showAccount=`${a.info.username}@${a.instanceURL}`},children:[e(T,{icon:"user"}),e("span",{children:e(h,{id:"40z2Fm"})})]}),e(Ze,{}),r&&e(Ie,{disabled:g,onClick:()=>{o.splice(m,1),o.unshift(a),we.local.setJSON("accounts",o),l()},children:[e(T,{icon:"check-circle"}),e("span",{children:e(h,{id:"PPcets"})})]}),e(ut,{subMenu:!0,confirmLabel:e(O,{children:[e(T,{icon:"exit"}),e("span",{children:e(h,{id:"k08LxG",values:{0:a.info.acct},components:{0:e("span",{class:"bidi-isolate"})}})})]}),disabled:!b,menuItemClassName:"danger",onClick:()=>{o.splice(m,1),we.local.setJSON("accounts",o),location.href=location.pathname||"/"},children:[e(T,{icon:"exit"}),e("span",{children:e(h,{id:"CXk1bI"})})]})]})]})]},a.info.id)})}),e("p",{children:e(ge,{to:"/login",class:"button plain2",onClick:n,children:[e(T,{icon:"plus"})," ",e("span",{children:e(h,{id:"Is7/PB"})})]})}),r&&e("p",{children:e("small",{children:e(h,{id:"52x24e",components:{0:e("i",{})}})})})]})})]})}const gi="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%2064%2064'%3e%3cpath%20fill='none'%20d='M0%200h63.994v63.994H0z'/%3e%3cpath%20fill='%23a4bff7'%20d='M37.774%2011.471c14.639%203.752%2019.034%2016.557%2015.889%2031.304-.696%203.261-2.563%206.661-6.356%208.693-3.204%201.717-8.07%202.537-15.338.55l-9.634-2.404C11.651%2046.992%208.378%2038.733%2010.027%2031.823c3.627-15.201%2015.543-23.48%2027.747-20.352Z'/%3e%3cpath%20fill='%23d8e7fe'%20d='M36.76%2015.429c12.289%203.15%2015.547%2014.114%2012.907%2026.493-.947%204.44-4.937%209.365-16.664%206.143l-9.684-2.417c-7.854-1.923-10.53-7.8-9.318-12.877%203.016-12.639%2012.611-19.943%2022.759-17.342Z'/%3e%3cpath%20fill='%236081e6'%20d='M27.471%2024.991c-1.457-.698-7.229%203.213-7.663%208.926-.182%202.39%204.55%203.237%205.071-.169.725-4.743%203.715-8.218%202.592-8.757Zm10.746%202.005c-2.083.327-.382%205.901-.595%2010.727-.123%202.8%204.388%203.464%204.703%202.011%201.098-5.073-2.066-13.058-4.108-12.738Z'/%3e%3c/svg%3e",mc={"zh-CN":"zh-Hans","zh-TW":"zh-Hant","pt-BR":"pt-BR"};function bi(){const{i18n:n}=ue(),i=Te(()=>uo.map(s=>{var u,l;const o=mc[s]||s.replace(/-[a-z]+$/i,""),c=xt({code:o,locale:s,fallback:(u=Pn.find(d=>d.code===s))==null?void 0:u.nativeName}),r=xt({code:o,locale:n.locale,fallback:(l=Pn.find(d=>d.code===s))==null?void 0:l.name});return{code:s,regionlessCode:o,_common:r,native:c}}).sort((s,o)=>{const c=s._common.localeCompare(o._common,n.locale);return c!==0?c:s.code<o.code?-1:s.code>o.code?1:0}),[]);return e("label",{class:"lang-selector",children:["🌐"," ",e("select",{class:"small",value:n.locale||ho,onChange:s=>{we.local.set("lang",s.target.value),fo(s.target.value)},children:[i.map(({code:s,regionlessCode:o,native:c})=>{var l;const r=xt({code:o,locale:n.locale,fallback:(l=Pn.find(d=>d.code===s))==null?void 0:l.name});return e("option",{value:s,"data-regionless-code":o,children:!!r&&r!==c?`${c} - ${r}`:c},s)}),void 0]})]})}function Di(n){const{masto:i}=le();return i.v1.push.subscription.create(n)}function gc(){const{masto:n}=le();return n.v1.push.subscription.fetch()}function bc(n){const{masto:i}=le();return i.v1.push.subscription.update(n)}function yc(){const{masto:n}=le();return n.v1.push.subscription.remove()}function $n(){return"serviceWorker"in navigator&&"PushManager"in window}function vc(){return navigator.serviceWorker.getRegistration()}async function yi(){const n=await vc(),i=n?await n.pushManager.getSubscription():void 0;return{registration:n,subscription:i}}function Ls(n){const i="=".repeat((4-n.length%4)%4),s=`${n}${i}`.replace(/-/g,"+").replace(/_/g,"/"),o=window.atob(s),c=new Uint8Array(o.length);for(let r=0;r<o.length;++r)c[r]=o.charCodeAt(r);return c}async function wc(){if(!$n())return;const{subscription:n}=await yi();let i=null;try{i=await gc()}catch(s){if(!/(not found|unknown)/i.test(s.message))throw s}if(i&&n){const s=i.endpoint===n.endpoint,o=Kn(),c=i.serverKey===o;if(!s)throw new Error("Backend subscription endpoint changed");if(!c)throw new Error("Backend subscription key and vapid key changed")}if(n&&!i){const s=Kn();if(s){const{applicationServerKey:o}=n.options,c=Ls(s).toString(),r=new Uint8Array(o).toString();if(!(c===r))throw await n.unsubscribe(),new Error("Subscription key and vapid key changed")}}return{subscription:n,backendSubscription:i}}async function Ni({data:n,policy:i}){if(!$n())return;let{registration:s,subscription:o}=await yi(),c=null;if(o)try{c=await bc({data:n,policy:i})}catch{c=await Di({subscription:o,data:n,policy:i})}else{const r=Kn();if(!r)throw new Error("No server key found");o=await s.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:Ls(r)}),c=await Di({subscription:o,data:n,policy:i})}return{subscription:o,backendSubscription:c}}async function Pi(){if(!$n())return;const{subscription:n}=await yi();n&&(await yc(),await n.unsubscribe())}const kc={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},Oi=16,Lt=[14,15,16,17,18,19,20],{PHANPY_WEBSITE:zi,PHANPY_PRIVACY_POLICY_URL:Sc,PHANPY_IMG_ALT_API_URL:_c,PHANPY_GIPHY_API_KEY:Cc}=kc;function Ic({onClose:n}){const{_:i}=ue(),s=Ve(A),o=we.local.get("theme")||"auto",c=j(),r=s.settings.contentTranslationTargetLanguage||null,u=ms(),l=xt(u),d=we.local.get("textSize")||Oi,[a,m]=$(we.account.get("preferences")||{}),{masto:b,authenticated:g,instance:p}=le();return e("div",{id:"settings-container",class:"sheet",tabIndex:"-1",style:{"--current-text-size":`${d}px`},children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"Tz0i8g"})})}),e("main",{children:[e("section",{children:e("ul",{children:[e("li",{children:[e("div",{children:e("label",{children:e(h,{id:"aAIQg2"})})}),e("div",{children:e("form",{ref:c,onInput:f=>{f.preventDefault();const v=new FormData(c.current).get("theme"),w=document.documentElement;if(v==="auto"){w.classList.remove("is-light","is-dark");const S=document.querySelector('meta[data-theme-setting="manual"]');S&&(S.name=""),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(_=>{_.name="theme-color"})}else{w.classList.toggle("is-light",v==="light"),w.classList.toggle("is-dark",v==="dark");const S=document.querySelector('meta[data-theme-setting="manual"]');S&&(S.name="theme-color",S.content=v==="light"?S.dataset.themeLightColor:S.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(_=>{_.name=""})}document.querySelector('meta[name="color-scheme"]').setAttribute("content",v==="auto"?"dark light":v),v==="auto"?we.local.del("theme"):we.local.set("theme",v)},children:e("div",{class:"radio-group",children:[e("label",{children:[e("input",{type:"radio",name:"theme",value:"light",defaultChecked:o==="light"}),e("span",{children:e(h,{id:"1njn7W"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"dark",defaultChecked:o==="dark"}),e("span",{children:e(h,{id:"pvnfJD"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"auto",defaultChecked:o!=="light"&&o!=="dark"}),e("span",{children:e(h,{id:"R9Khdg"})})]})]})})})]}),e("li",{children:[e("div",{children:e("label",{children:e(h,{id:"7r6sCa"})})}),e("div",{class:"range-group",children:[e("span",{style:{fontSize:Lt[0]},children:e(h,{id:"J6ypuD"})})," ",e("input",{type:"range",min:Lt[0],max:Lt[Lt.length-1],step:"1",value:d,list:"sizes",onChange:f=>{const y=parseInt(f.target.value,10);document.documentElement.style.setProperty("--text-size",`${y}px`),y===Oi?we.local.del("textSize"):we.local.set("textSize",f.target.value)}})," ",e("span",{style:{fontSize:Lt[Lt.length-1]},children:e(h,{id:"J6ypuD"})}),e("datalist",{id:"sizes",children:Lt.map(f=>e("option",{value:f}))})]})]}),e("li",{children:[e("span",{children:[e("label",{children:e(h,{id:"CeJHfb"})}),e("br",{}),e("small",{children:e("a",{href:"https://crowdin.com/project/phanpy",target:"_blank",rel:"noopener noreferrer",children:e(h,{id:"FFmj1D"})})})]}),e(bi,{})]})]})}),g&&e(O,{children:[e("h3",{children:e(h,{id:"PcoS3v"})}),e("section",{children:e("ul",{children:e("li",{children:[e("div",{children:e("label",{for:"posting-privacy-field",children:[e(h,{id:"NAjVvt"})," ",e(T,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})]})}),e("div",{children:e("select",{id:"posting-privacy-field",value:a["posting:default:visibility"]||"public",onChange:f=>{const{value:y}=f.target;(async()=>{try{await b.v1.accounts.updateCredentials({source:{privacy:y}}),m({...a,"posting:default:visibility":y}),we.account.set("preferences",{...a,"posting:default:visibility":y})}catch{alert(i({id:"Oa+KBY"}))}})()},children:[e("option",{value:"public",children:e(h,{id:"7d1a0d"})}),e("option",{value:"unlisted",children:e(h,{id:"WDcQq9"})}),e("option",{value:"private",children:e(h,{id:"o34OrG"})})]})})]})})}),e("p",{class:"section-postnote",children:[e(T,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})," ",e("small",{children:e(h,{id:"xlsg7n",values:{instance:p},components:{0:e("a",{href:`https://${p}/`,target:"_blank",rel:"noopener noreferrer"})}})})]})]}),e("h3",{children:e(h,{id:"ivdhsq"})}),e("section",{children:e("ul",{children:[e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:s.settings.autoRefresh,onChange:f=>{A.settings.autoRefresh=f.target.checked}})," ",e(h,{id:"0mC0SF"})]})}),e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:s.settings.boostsCarousel,onChange:f=>{A.settings.boostsCarousel=f.target.checked}})," ",e(h,{id:"TSbnoW"})]})}),e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.contentTranslation,onChange:f=>{const{checked:y}=f.target;A.settings.contentTranslation=y,y||(A.settings.contentTranslationTargetLanguage=null)}})," ",e(h,{id:"0SdaOt"})]}),e("div",{class:`sub-section ${s.settings.contentTranslation?"":"more-insignificant"}`,children:[e("div",{children:e("label",{children:[e(h,{id:"zXCa9e"})," ",e("select",{value:r||"",disabled:!s.settings.contentTranslation,style:{width:"10em"},onChange:f=>{A.settings.contentTranslationTargetLanguage=f.target.value||null},children:[e("option",{value:"",children:e(h,{id:"jNCSyx",values:{systemTargetLanguageText:l}})}),e("option",{disabled:!0,children:"──────────"}),Ai.map(f=>{const y=xt({code:f.code,fallback:f.name}),v=xt({code:f.code,locale:f.code}),w=y!==v;return e("option",{value:f.code,children:w?`${v} - ${y}`:y})})]})]})}),e("hr",{}),e("div",{class:"checkbox-fieldset",children:[e(h,{id:"cc0NrU",values:{0:s.settings.contentTranslationHideLanguages.length}}),e("div",{class:"checkbox-fields",children:Ai.map(f=>{const y=xt({code:f.code,fallback:f.name}),v=xt({code:f.code,locale:f.code}),w=y!==v;return e("label",{children:[e("input",{type:"checkbox",checked:s.settings.contentTranslationHideLanguages.includes(f.code),onChange:S=>{const{checked:k}=S.target;k?A.settings.contentTranslationHideLanguages.push(f.code):A.settings.contentTranslationHideLanguages=s.settings.contentTranslationHideLanguages.filter(_=>_!==f.code)}})," ",w?e("span",{children:[v," ",e("span",{class:"insignificant",children:["- ",y]})]}):y]})})})]}),e("p",{class:"insignificant",children:e("small",{children:e(h,{id:"xpF+wU",components:{0:e("a",{href:"https://github.com/cheeaun/lingva-api",target:"_blank",rel:"noopener noreferrer"}),1:e("a",{href:"https://github.com/thedaviddelta/lingva-translate",target:"_blank",rel:"noopener noreferrer"})}})})}),e("hr",{}),e("div",{children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.contentTranslationAutoInline,disabled:!s.settings.contentTranslation,onChange:f=>{A.settings.contentTranslationAutoInline=f.target.checked}})," ",e(h,{id:"gURvmk"})]}),e("p",{class:"insignificant",children:e("small",{children:e(h,{id:"PbHARL",components:{0:e("b",{})}})})})]})]})]}),!!Cc&&g&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.composerGIFPicker,onChange:f=>{A.settings.composerGIFPicker=f.target.checked}})," ",e(h,{id:"D7/2jB"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"/CLBTL",components:{0:e("a",{href:"https://developers.giphy.com/",target:"_blank",rel:"noopener noreferrer"})}})})})]}),!!_c&&g&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.mediaAltGenerator,onChange:f=>{A.settings.mediaAltGenerator=f.target.checked}})," ",e(h,{id:"9q5uor"})," ",e(T,{icon:"sparkles2",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"faZ9RI"})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"fHZgvt",components:{0:e("a",{href:"https://github.com/cheeaun/img-alt-api",target:"_blank",rel:"noopener noreferrer"})}})})})]}),g&&Qe("@mastodon/grouped-notifications")&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.groupedNotificationsAlpha,onChange:f=>{A.settings.groupedNotificationsAlpha=f.target.checked}})," ",e(h,{id:"aGziA/"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"X17jCM"})})})]}),g&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.shortcutSettingsCloudImportExport,onChange:f=>{A.settings.shortcutSettingsCloudImportExport=f.target.checked}})," ",e(h,{id:"570qTm"})," ",e(T,{icon:"cloud",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"0tZAhT",components:{0:e("br",{})}})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"fHf1v/"})})})]}),e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.cloakMode,onChange:f=>{A.settings.cloakMode=f.target.checked}})," ",e(h,{id:"lxYe+I",components:{0:e("span",{class:"insignificant"}),1:e("samp",{}),2:e("samp",{})}})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(h,{id:"T/hglb"})})})]}),g&&e("li",{children:e("button",{type:"button",class:"light",onClick:()=>{A.showDrafts=!0,A.showSettings=!1},children:e(h,{id:"krk5ws"})})})]})}),g&&e(Tc,{onClose:n}),e("h3",{children:e(h,{id:"uyJsf6"})}),e("section",{children:[e("div",{style:{display:"flex",flexWrap:"wrap",gap:8,lineHeight:1.25,alignItems:"center",marginTop:8},children:[e("img",{src:gi,alt:"",width:"64",height:"64",style:{aspectRatio:"1/1",verticalAlign:"middle",background:"#b7cdf9",borderRadius:12}}),e("div",{children:[e("b",{children:"Phanpy"})," ",e("a",{href:"https://hachyderm.io/@phanpy",rel:"noopener noreferrer",onClick:f=>{f.preventDefault(),A.showAccount="phanpy@hachyderm.io"},children:"@phanpy"}),e("br",{}),e(h,{id:"AZ2EoP",components:{0:e("a",{href:"https://github.com/cheeaun/phanpy",target:"_blank",rel:"noopener noreferrer"}),1:e("a",{href:"https://mastodon.social/@cheeaun",rel:"noopener noreferrer",onClick:f=>{f.preventDefault(),A.showAccount="cheeaun@mastodon.social"}})}})]})]}),e("p",{children:[e("a",{href:"https://github.com/sponsors/cheeaun",target:"_blank",rel:"noopener noreferrer",children:e(h,{id:"O4cLCR"})})," ","·"," ",e("a",{href:"https://www.buymeacoffee.com/cheeaun",target:"_blank",rel:"noopener noreferrer",children:e(h,{id:"Ng063n"})})," ","·"," ",e("a",{href:"https://patreon.com/cheeaun",target:"_blank",rel:"noopener noreferrer",children:"Patreon"})," ","·"," ",e("a",{href:Sc,target:"_blank",rel:"noopener noreferrer",children:e(h,{id:"LcET2C"})})]}),e("p",{children:[zi&&e(O,{children:[e(h,{id:"pFnMHn",values:{0:zi.replace(/https?:\/\//g,"").replace(/\/$/,"")},components:{0:e("span",{class:"insignificant"})}}),e("br",{})]}),e(h,{id:"6KkH+2",values:{0:e("span",{class:"ib insignificant",children:["(",e("a",{href:"https://github.com/cheeaun/phanpy/commit/119d4b0",target:"_blank",rel:"noopener noreferrer",children:e(Zt,{datetime:new Date("2024-12-28T11:12:09.380Z")})}),")"]})},components:{0:e("span",{class:"insignificant"}),1:e("input",{type:"text",class:"version-string",readOnly:!0,size:"18",value:`${"2024-12-28T11:12:09.380Z".slice(0,10).replace(/-/g,".")}.119d4b0`,onClick:f=>{f.target.select();try{navigator.clipboard.writeText(f.target.value),me(i({id:"PiPfua"}))}catch{me(i({id:"gdxreD"}))}}})}})]})]}),void 0]})]})}function Tc({onClose:n}){const{_:i}=ue();if(!$n())return null;const{instance:s}=le(),[o,c]=$("default"),r=j(),[u,l]=$(!1),[d,a]=$(!1),m=j();ne(()=>{(async()=>{c("loading");try{const{subscription:g,backendSubscription:p}=await wc();if(p!=null&&p.policy&&p.policy!=="none"){l(!0);const{alerts:f,policy:y}=p;m.current=y;const{elements:v}=r.current,w=v.namedItem("policy");w&&(w.value=y),Object.keys(f).forEach(S=>{const k=v.namedItem(S);(k==null?void 0:k.type)==="checkbox"&&(k.checked=!0)})}c("default")}catch(g){/outside.*authorized/i.test(g.message)?a(!0):alert((g==null?void 0:g.message)||g),c("error")}})()},[]);const b=o==="loading";return e("form",{ref:r,onChange:()=>{setTimeout(()=>{const g=Object.fromEntries(new FormData(r.current)),p=!!g["policy-allow"],f={data:{policy:g.policy,alerts:{mention:!!g.mention,favourite:!!g.favourite,reblog:!!g.reblog,follow:!!g.follow,follow_request:!!g.followRequest,poll:!!g.poll,update:!!g.update,status:!!g.status}}};let y=0;Object.keys(f.data.alerts).forEach(w=>{f.data.alerts[w]?y++:delete f.data.alerts[w]});const v=m.current!==f.data.policy;p&&y>0?v?Pi().then(()=>{Ni(f)}).catch(w=>{alert(i({id:"I6pdY3"}))}):Ni(f).catch(w=>{alert(i({id:"I6pdY3"}))}):Pi().catch(w=>{alert(i({id:"q1zFd+"}))})},100)},children:[e("h3",{children:e(h,{id:"WUHLnz"})}),e("section",{children:e("ul",{children:e("li",{children:[e("label",{children:[e("input",{type:"checkbox",disabled:b||d,name:"policy-allow",checked:u,onChange:async g=>{const{checked:p}=g.target;if(p){const f=await Notification.requestPermission();f==="granted"?l(!0):(l(!1),f==="denied"&&alert(i({id:"6LUsk7"})))}else l(!1)}})," ",e(h,{id:"qYNCa1",values:{0:[{value:"all",label:i({id:"+niKJH"})},{value:"followed",label:i({id:"x2NYtp"})},{value:"follower",label:i({id:"PBFNgg"})}].map(g=>e("option",{value:g.value,children:g.label}))},components:{0:e("select",{name:"policy",disabled:b||d||!u})}})]}),e("div",{class:"shazam-container no-animation",style:{width:"100%"},hidden:!u,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"sub-section",children:e("ul",{children:[{value:"mention",label:i({id:"/bZzdR"})},{value:"favourite",label:i({id:"zZOZj7"})},{value:"reblog",label:i({id:"puY2t0"})},{value:"follow",label:i({id:"aaJhcT"})},{value:"followRequest",label:i({id:"6Fs1Ba"})},{value:"poll",label:i({id:"wNExRS"})},{value:"update",label:i({id:"K/EtE6"})},{value:"status",label:i({id:"2yr1/p"})}].map(g=>e("li",{children:e("label",{children:[e("input",{type:"checkbox",name:g.value})," ",g.label]})}))})})})}),d&&e("div",{class:"sub-section",children:e("p",{children:e(h,{id:"8d0b8B",components:{0:e(ge,{to:`/login?instance=${s}`,onClick:n}),1:e("b",{})}})})})]})})}),e("p",{class:"section-postnote",children:e("small",{children:e(h,{id:"z96cOX",components:{0:e("b",{})}})})})]})}const Xn=()=>{let n=setTimeout(()=>{var s,o;const i=document.getElementById("columns");if(i){const c=i.querySelector(".deck-container.focus");if(c)c.focus();else{const r=Array.from(i.querySelectorAll(".deck-container")).find(u=>u.getBoundingClientRect().left>=0);r?r.focus():(o=(s=i.querySelector(".deck-container"))==null?void 0:s.focus)==null||o.call(s)}}else{const c=document.querySelectorAll("#modal-container > *");if(c!=null&&c.length){const d=c[c.length-1],a=d.querySelector('[tabindex="-1"]')||d;if(a){a.focus();return}}if(document.querySelector(".deck-backdrop"))return;const u=document.querySelectorAll(".deck-container"),l=u[u.length-1];l&&l.tabIndex===-1&&l.focus()}},100);return()=>clearTimeout(n)};function $s(n){if(!n)return;const i=Wt(),s=j(i.pathname);ne(()=>{s.current&&i.pathname!==s.current&&(n==null||n())},[i.pathname,n])}const Ms=1e3*60,xc=24*60*60*1e3,Jn=Ct(async()=>{const{masto:n}=le(),i=await n.v1.lists.list();return i.sort((s,o)=>s.title.localeCompare(o.title)),i.length&&setTimeout(()=>{we.account.set("lists",{lists:i,updatedAt:Date.now()})},1),i},{maxAge:Ms});async function rn(){try{const{lists:n,updatedAt:i}=we.account.get("lists")||{};return n!=null&&n.length?(Date.now()-i>xc&&Jn(),n):await Jn()}catch{return[]}}const Ac=Ct(n=>{const{masto:i}=le();return i.v1.lists.$select(n).fetch()},{maxAge:Ms});async function Ds(n){const{lists:i}=we.account.get("lists")||{};if(i!=null&&i.length){const s=i.find(o=>o.id===n);if(s)return s}try{return Ac(n)}catch{return null}}async function Ec(n){const i=await Ds(n);return(i==null?void 0:i.title)||""}function Rc(n){const{lists:i}=we.account.get("lists")||{};i!=null&&i.length&&(i.push(n),i.sort((s,o)=>s.title.localeCompare(o.title)),we.account.set("lists",{lists:i,updatedAt:Date.now()}))}function Lc(n){const{lists:i}=we.account.get("lists")||{};if(i!=null&&i.length){const s=i.findIndex(o=>o.id===n.id);s!==-1&&(i[s]=n,i.sort((o,c)=>o.title.localeCompare(c.title)),we.account.set("lists",{lists:i,updatedAt:Date.now()}))}}function $c(n){const{lists:i}=we.account.get("lists")||{};if(i!=null&&i.length){const s=i.findIndex(o=>o.id===n);s!==-1&&(i.splice(s,1),we.account.set("lists",{lists:i,updatedAt:Date.now()}))}}function vi({list:n,onClose:i}){const{_:s}=ue(),{masto:o}=le(),[c,r]=$("default"),u=!!n,l=j(),d=j(),a=j();ne(()=>{u&&(l.current.value=n.title,d.current.value=n.repliesPolicy,a.current&&(a.current.checked=n.exclusive))},[u]);const m=Qe("@mastodon/list-exclusive")||Qe("@gotosocial/list-exclusive");return e("div",{class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})})," ",e("header",{children:e("h2",{children:s(u?{id:"tuhghE"}:{id:"Sb2gYF"})})}),e("main",{children:e("form",{class:"list-form",onSubmit:b=>{b.preventDefault();const g=new FormData(b.target),p=g.get("title"),f=g.get("replies_policy"),y=g.get("exclusive")==="on";r("loading"),(async()=>{try{let v;u?v=await o.v1.lists.$select(n.id).update({title:p,replies_policy:f,exclusive:y}):v=await o.v1.lists.create({title:p,replies_policy:f,exclusive:y}),r("default"),i==null||i({state:"success",list:v}),setTimeout(()=>{u?Lc(v):Rc(v)},1)}catch{r("error"),alert(s(u?{id:"R7ep1i"}:{id:"KPoj8w"}))}})()},children:[e("div",{class:"list-form-row",children:e("label",{for:"list-title",children:[e(h,{id:"6YtxFj"})," ",e("input",{ref:l,type:"text",id:"list-title",name:"title",required:!0,disabled:c==="loading",dir:"auto"})]})}),e("div",{class:"list-form-row",children:e("select",{ref:d,name:"replies_policy",required:!0,disabled:c==="loading",children:[e("option",{value:"list",children:e(h,{id:"ei6pnR"})}),e("option",{value:"followed",children:e(h,{id:"Mr53YX"})}),e("option",{value:"none",children:e(h,{id:"PM7llw"})})]})}),m&&e("div",{class:"list-form-row",children:e("label",{class:"label-block",children:[e("input",{ref:a,type:"checkbox",name:"exclusive",disabled:c==="loading"})," ",e(h,{id:"jxxYp0"})]})}),e("div",{class:"list-form-footer",children:[e("button",{type:"submit",disabled:c==="loading",children:s(u?{id:"tfDRzk"}:{id:"hYgDIe"})}),u&&e(ut,{disabled:c==="loading",align:"end",menuItemClassName:"danger",confirmLabel:s({id:"+kQ/cY"}),onClick:()=>{r("loading"),(async()=>{try{await o.v1.lists.$select(n.id).remove(),r("default"),i==null||i({state:"deleted"}),setTimeout(()=>{$c(n.id)},1)}catch{r("error"),alert(s({id:"tqUaGL"}))}})()},children:e("button",{type:"button",class:"light danger",disabled:c==="loading",children:e(h,{id:"Jb6/SB"})})})]})]})})]})}const Mc=[60*5,60*30,60*60,60*60*6,60*60*24,60*60*24*3,60*60*24*7,60*60*24*30,0],Ft={0:{id:"9ZP9cc"},300:it(5,"minute"),1800:it(30,"minute"),3600:it(1,"hour"),21600:it(6,"hour"),86400:it(1,"day"),259200:it(3,"day"),604800:it(1,"week"),2592e3:it(30,"day")},Ui=80,Ns=1e3*60*10;function Dc(n,i){return i.v1.accounts.familiarFollowers.fetch({id:[n]})}const Nc=Ct(Dc,{maxAge:Ns});async function Pc(n,i){const s=i.v1.accounts.$select(n).statuses.list({limit:20}).next(),{value:o}=await s,c={total:o.length,originals:0,replies:0,boosts:0};return o.forEach(r=>{r.reblog?c.boosts++:r.inReplyToId&&r.inReplyToAccountId!==r.account.id?c.replies++:c.originals++}),o.length&&(c.daysSinceLastPost=Math.ceil((Date.now()-new Date(o[o.length-1].createdAt))/864e5)),c}const Oc=Ct(Pc,{maxAge:Ns});function Ps({account:n,fetchAccount:i=()=>{},standalone:s,instance:o,authenticated:c}){const{i18n:r,_:u}=ue(),{masto:l}=le({instance:o}),{masto:d,instance:a}=le(),[m,b]=$("default"),g=typeof n=="string",[p,f]=$(g?null:n),y=Te(()=>o===a,[o,a]);ne(()=>{if(!g){f(n);return}b("loading"),(async()=>{try{const F=await i();A.accounts[`${F.id}@${o}`]=F,f(F),b("default")}catch{f(null),b("error")}})()},[g,n,i]);const{acct:v,avatar:w,avatarStatic:S,bot:k,createdAt:_,displayName:x,emojis:C,fields:I,followersCount:E,followingCount:L,group:z,id:D,lastStatusAt:oe,locked:ee,note:W,statusesCount:Z,url:B,username:Y,memorial:ce,moved:M,roles:H,hideCollections:U}=p||{};let K=!1,{header:pe,headerStatic:J}=p||{};(!pe||/missing\.png$/.test(pe))&&w&&!/missing\.png$/.test(w)&&(pe=w,K=!0,S&&!/missing\.png$/.test(S)&&(J=S));const ye=Te(()=>D===St(),[D]);ne(()=>{const F=!!(p!=null&&p.id&&(p!=null&&p.username)&&(p!=null&&p.acct)&&(p!=null&&p.avatar)&&(p!=null&&p.avatarStatic)&&(p!=null&&p.displayName)&&(p!=null&&p.url));if(ye&&o&&F){const be=we.local.getJSON("accounts");let Re=!1;be.forEach(R=>{R.info.id===p.id&&R.instanceURL===o&&(R.info=p,Re=!0)}),Re&&we.local.setJSON("accounts",be)}},[ye,p,o]);const _e=Te(()=>B?Pt.toUnicode(URL.parse(B).hostname):null,[B]),[q,re]=$([]),Ae=j(),De=j([]);async function Ne(F){var V;(F||!Ae.current)&&(Ae.current=l.v1.accounts.$select(D).followers.list({limit:Ui}));const be=await Ae.current.next();if(ye||!y)return be;const{value:Re}=be;let R=[];if(F){let se=[];try{se=await l.v1.accounts.familiarFollowers.fetch({id:[D]})}catch{}De.current=((V=se==null?void 0:se[0])==null?void 0:V.accounts)||[],R=[...De.current,...Re.filter(G=>!De.current.some(ie=>ie.id===G.id))]}else Re!=null&&Re.length&&(R=Re.filter(se=>!De.current.some(G=>G.id===se.id)));return{...be,value:R}}const Pe=j();async function Ue(F){return(F||!Pe.current)&&(Pe.current=l.v1.accounts.$select(D).following.list({limit:Ui})),await Pe.current.next()}const Ce=s?"div":ge,Q=o?`/${o}/a/${D}`:`/a/${D}`,[ke,Le]=$([]),[fe,X]=$(),[Se,P]=$("default"),te=!!(fe!=null&&fe.total),de=async F=>{try{const be=await Nc(F,d);Le(be[0].accounts.slice(0,zc))}catch{}},N=async()=>{if(D){P("loading");try{const F=await Oc(D,l);X(F),P("default")}catch{P("error")}}},ae=rt(({relationship:F,currentID:be})=>{F.following||(de(be),!s&&Z>0&&N())},[s,D,Z]),xe=rt(F=>{F.id===D&&(f(F),A.accounts[`${F.id}@${o}`]=F)},[D,o]);return e("div",{tabIndex:"-1",class:`account-container ${m==="loading"?"skeleton":""}`,style:{"--header-color-1":q[0],"--header-color-2":q[1],"--header-color-3":q[2],"--header-color-4":q[3]},children:[m==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(h,{id:"44hICK"})}),e("p",{children:e("a",{href:g?n:B,target:"_blank",rel:"noopener noreferrer",children:[e(h,{id:"Aadw0+"})," ",e(T,{icon:"external"})]})})]}),m==="loading"?e(O,{children:[e("header",{children:e(dt,{avatarSize:"xxxl",skeleton:!0})}),e("main",{children:[e("div",{class:"note",children:[e("p",{children:"███████ ████ ████"}),e("p",{children:"████ ████████ ██████ █████████ ████ ██"})]}),e("div",{class:"account-metadata-box",children:[e("div",{class:"profile-metadata",children:[e("div",{class:"profile-field",children:[e("b",{class:"more-insignificant",children:"███"}),e("p",{children:"██████"})]}),e("div",{class:"profile-field",children:[e("b",{class:"more-insignificant",children:"████"}),e("p",{children:"███████████"})]})]}),e("div",{class:"stats",children:[e("div",{children:[e("span",{children:"██"})," ",e(h,{id:"x5LEuB"})]}),e("div",{children:[e("span",{children:"██"})," ",e(h,{id:"following.stats"})]}),e("div",{children:[e("span",{children:"██"})," ",e(h,{id:"+owNNn"})]})]})]}),e("div",{class:"actions",children:[e("span",{}),e("span",{class:"buttons",children:e("button",{type:"button",class:"plain",disabled:!0,children:e(T,{icon:"more",size:"l",alt:u({id:"2FYpfJ"})})})})]})]})]}):p&&e(O,{children:[!!M&&e("div",{class:"account-moved",children:[e("p",{children:e(h,{id:"C6cVP/",values:{displayName:x},components:{0:e("b",{})}})}),e(dt,{account:M,instance:o,onClick:F=>{F.stopPropagation(),A.showAccount=M}})]}),!!pe&&!/missing\.png$/.test(pe)&&e("img",{src:pe,alt:"",class:`header-banner ${K?"header-is-avatar":""}`,onError:F=>{F.target.crossOrigin?F.target.src!==J?F.target.src=J:(F.target.removeAttribute("crossorigin"),F.target.src=pe):F.target.src!==J?F.target.src=J:F.target.remove()},crossOrigin:"anonymous",onLoad:F=>{F.target.classList.add("loaded");try{const be=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),Re=be.getContext("2d",{willReadFrequently:!0});be.width=F.target.width,be.height=F.target.height,Re.imageSmoothingEnabled=!1,Re.drawImage(F.target,0,0);const R=10,se=[Re.getImageData(0,0,R,R).data,Re.getImageData(F.target.width-R,0,R,R).data,Re.getImageData(0,F.target.height-R,R,R).data,Re.getImageData(F.target.width-R,F.target.height-R,R,R).data].map(G=>{let ie=0,Oe=0,$e=0,Me=0;for(let je=0;je<G.length;je+=4)ie+=G[je],Oe+=G[je+1],$e+=G[je+2],Me+=G[je+3];const Fe=G.length/4;return[ie/Fe,Oe/Fe,$e/Fe,Me/Fe]}).map(G=>{const[ie,Oe,$e,Me]=Bc(G);return`rgba(${ie}, ${Oe}, ${$e}, ${Me})`});re(se)}catch{}}}),e("header",{children:s?e(lt,{shift:window.matchMedia("(min-width: calc(40em))").matches?114:64,menuButton:e("div",{children:e(dt,{account:p,instance:o,avatarSize:"xxxl",onClick:()=>{}})}),children:[e("div",{class:"szh-menu__header",children:e(Kc,{acct:v,instance:o})}),e(Ie,{onClick:()=>{const F=v.includes("@")?`@${v}`:`@${v}@${o}`;try{navigator.clipboard.writeText(F),me(u({id:"zJoEwS"}))}catch{me(u({id:"BC0lSD"}))}},children:[e(T,{icon:"link"}),e("span",{children:e(h,{id:"27x6gl"})})]}),e(Ie,{href:B,target:"_blank",children:[e(T,{icon:"external"}),e("span",{children:e(h,{id:"Bz5hLl"})})]}),e(Ze,{}),e(qe,{href:p.avatar,target:"_blank",children:[e(T,{icon:"user"}),e("span",{children:e(h,{id:"7WYl2I"})})]}),e(qe,{href:p.header,target:"_blank",children:[e(T,{icon:"media"}),e("span",{children:e(h,{id:"ZNme5R"})})]})]}):e(dt,{account:p,instance:o,avatarSize:"xxxl",internal:!0})}),e("div",{class:"faux-header-bg","aria-hidden":"true"}),e("main",{children:[!!ce&&e("span",{class:"tag",children:e(h,{id:"prdIOK"})}),!!k&&e("span",{class:"tag",children:[e(T,{icon:"bot"})," ",e(h,{id:"9Vdq+j"})]}),!!z&&e("span",{class:"tag",children:[e(T,{icon:"group"})," ",e(h,{id:"L8fEEm"})]}),H==null?void 0:H.map(F=>e("span",{class:"tag",children:[F.name,!!_e&&e(O,{children:[" ",e("span",{class:"more-insignificant",children:_e})]})]})),e("div",{class:"note",dir:"auto",onClick:gs({instance:a}),dangerouslySetInnerHTML:{__html:Gn(W,{emojis:C})}}),e("div",{class:"account-metadata-box",children:[(I==null?void 0:I.length)>0&&e("div",{class:"profile-metadata",children:I.map(({name:F,value:be,verifiedAt:Re},R)=>e("div",{class:`profile-field ${Re?"profile-verified":""}`,dir:"auto",children:[e("b",{children:[e(bs,{text:F,emojis:C})," ",!!Re&&e(T,{icon:"check-circle",size:"s",alt:u({id:"QDEWii"})})]}),e("p",{dangerouslySetInnerHTML:{__html:Gn(be,{emojis:C})}})]},F+R))}),e("div",{class:"stats",children:[e(Ce,{tabIndex:0,to:Q,onClick:()=>{setTimeout(()=>{A.showGenericAccounts={id:"followers",heading:u({id:"x5LEuB"}),fetchAccounts:Ne,instance:o,excludeRelationshipAttrs:ye?["followedBy"]:[],blankCopy:U?u({id:"BRV/wh"}):void 0}},0)},children:[!!ke.length&&e("span",{class:"shazam-container-horizontal",children:e("span",{class:"shazam-container-inner stats-avatars-bunch",children:ke.map(F=>e(ht,{url:F.avatarStatic,size:"s",alt:`${F.displayName} @${F.acct}`,squircle:F==null?void 0:F.bot}))})}),e("span",{title:E,children:Xe(E)})," ",e(h,{id:"x5LEuB"})]}),e(Ce,{class:"insignificant",tabIndex:0,to:Q,onClick:()=>{setTimeout(()=>{A.showGenericAccounts={heading:u({id:"following.stats"}),fetchAccounts:Ue,instance:o,excludeRelationshipAttrs:ye?["following"]:[],blankCopy:U?u({id:"BRV/wh"}):void 0}},0)},children:[e("span",{title:L,children:Xe(L)})," ",e(h,{id:"following.stats"}),e("br",{})]}),e(Ce,{class:"insignificant",to:Q,children:[e("span",{title:Z,children:Xe(Z)})," ",e(h,{id:"+owNNn"})]}),!!_&&e("div",{class:"insignificant",children:e(h,{id:"PCcEFZ",values:{0:mt(_,{hideTime:!0})},components:{0:e("time",{datetime:_})}})})]})]}),!!fe&&e(Ce,{to:Q,class:"account-metadata-box",children:e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:te?e("div",{class:"posting-stats",title:u({id:"wiuWLe",values:{0:(fe.originals/fe.total).toLocaleString(r.locale||void 0,{style:"percent"}),1:(fe.replies/fe.total).toLocaleString(r.locale||void 0,{style:"percent"}),2:(fe.boosts/fe.total).toLocaleString(r.locale||void 0,{style:"percent"})}}),children:[e("div",{children:fe.daysSinceLastPost<365?he._({id:"oZUtTk",values:{0:fe.total,1:fe.daysSinceLastPost,2:fe.daysSinceLastPost,3:fe.daysSinceLastPost,4:fe.total,5:fe.total,6:fe.daysSinceLastPost}}):he._({id:"JvA7Mo",values:{0:fe.total,1:fe.total}})}),e("div",{class:"posting-stats-bar",style:{"--originals-percentage":`${fe.originals/fe.total*100}%`,"--replies-percentage":`${(fe.originals+fe.replies)/fe.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"})," ",e(h,{id:"HxF6Fk"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-replies"})," ",e(h,{id:"N8UzTV"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-legend-item-boosts"})," ",e(h,{id:"puY2t0"})]})]})]}):e("div",{class:"posting-stats",children:e(h,{id:"vl3XTJ"})})})})}),!M&&e("div",{class:"account-metadata-box",children:e("div",{class:"shazam-container no-animation",hidden:!!fe,children:e("div",{class:"shazam-container-inner",children:e("button",{type:"button",class:"posting-stats-button",disabled:Se==="loading",onClick:()=>{N()},children:[e("div",{class:`posting-stats-bar posting-stats-icon ${Se==="loading"?"loading":""}`,style:{"--originals-percentage":"33%","--replies-percentage":"66%"}}),e(h,{id:"PjP87f"})," "]})})})})]}),e("footer",{children:e(Uc,{info:p,instance:o,standalone:s,authenticated:c,onRelationshipChange:ae,onProfileUpdate:xe})})]})]})}const zc=3;function Uc({info:n,instance:i,standalone:s,authenticated:o,onRelationshipChange:c=()=>{},onProfileUpdate:r=()=>{}}){var fe;if(!n)return null;const{_:u,_:l}=ue(),{masto:d,instance:a,authenticated:m}=le(),b=i===a,[g,p]=$("default"),[f,y]=$(null),{id:v,acct:w,url:S,username:k,locked:_,lastStatusAt:x,note:C,fields:I,moved:E}=n,L=j(v),{following:z,showingReblogs:D,notifying:oe,followedBy:ee,blocking:W,blockedBy:Z,muting:B,mutingNotifications:Y,requested:ce,domainBlocking:M,endorsed:H,note:U}=f||{},[K,pe]=$(null),[J,ye]=$(!1),_e=w.includes("@")?w:`${w}@${i}`;ne(()=>{if(n){const X=St();let Se;(async()=>{if(b&&o)Se=v;else if(!b&&m){const te=n.acct.includes("@");try{const de=await d.v2.search.fetch({q:te?n.acct:`${n.username}@${i}`,type:"accounts",limit:1,resolve:!0});de.accounts.length&&(Se=de.accounts[0].id,pe(de.accounts[0]))}catch{}}if(!Se)return;if(X===Se){ye(!0);return}L.current=Se,p("loading");const P=d.v1.accounts.relationships.fetch({id:[Se]});try{const te=await P;if(p("default"),te.length){const de=te[0];y(de),c({relationship:de,currentID:Se})}}catch{p("error")}})()}},[n,o]),ne(()=>{n&&J&&po(n)},[n,J]);const q=g==="loading",[re,Ae]=$(!1),[De,Ne]=$(!1),[Pe,Ue]=$(!1),[Ce,Q]=$(!1),[ke,Le]=$([]);return e(O,{children:[e("div",{class:"actions",children:[e("span",{children:[ee?e("span",{class:"tag",children:e(h,{id:"p3UO/y"})}):x?e("small",{class:"insignificant",children:e(h,{id:"F3cM1G",values:{0:mt(x,{hideTime:!0})},components:{0:e("span",{class:"ib"})}})}):e("span",{}),B&&e("span",{class:"tag danger",children:e(h,{id:"+IJm1Z"})}),W&&e("span",{class:"tag danger",children:e(h,{id:"32TndD"})})]})," ",e("span",{class:"buttons",children:[!!U&&e("button",{type:"button",class:"private-note-tag",title:l({id:"zxFxcH"}),onClick:()=>{Ue(!0)},dir:"auto",children:e("span",{children:U})}),e(lt,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",class:"plain",disabled:q,children:e(T,{icon:"more",size:"l",alt:l({id:"2FYpfJ"})})}),onMenuChange:X=>{z&&X.open&&(async()=>{try{const Se=await d.v1.accounts.$select(L.current).lists.list();Le(Se)}catch{}})()},children:[m&&!J&&e(O,{children:[e(Ie,{onClick:()=>{Mo({draftStatus:{status:`@${(K==null?void 0:K.acct)||w} `}})},children:[e(T,{icon:"at"}),e("span",{children:e(h,{id:"3LkfZu",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}),e(Ie,{onClick:()=>{Ae(!0)},children:[e(T,{icon:"translate"}),e("span",{children:e(h,{id:"R8mSiS"})})]}),Qe("@mastodon/profile-private-note")&&e(Ie,{onClick:()=>{Ue(!0)},children:[e(T,{icon:"pencil"}),e("span",{children:l(U?{id:"U+Gokq"}:{id:"VcQzRi"})})]}),z&&!!f&&e(O,{children:[e(Ie,{onClick:()=>{p("loading"),(async()=>{try{const X=await d.v1.accounts.$select(L.current).follow({notify:!oe});X&&y(X),p("default"),me(X.notifying?l({id:"jL3N0G",values:{username:k}}):l({id:"0h4/9h",values:{username:k}}))}catch(X){alert(X),p("error")}})()},children:[e(T,{icon:"notification"}),e("span",{children:l(oe?{id:"osJmEN"}:{id:"I92Z+b"})})]}),e(Ie,{onClick:()=>{p("loading"),(async()=>{try{const X=await d.v1.accounts.$select(L.current).follow({reblogs:!D});X&&y(X),p("default"),me(X.showingReblogs?l({id:"0X2KC8",values:{username:k}}):l({id:"cXWjH0",values:{username:k}}))}catch(X){alert(X),p("error")}})()},children:[e(T,{icon:"rocket"}),e("span",{children:l(D?{id:"GRUr8d"}:{id:"uREpT3"})})]})]}),z&&e(Ie,{onClick:()=>{Ne(!0)},children:[e(T,{icon:"list"}),ke.length?e(O,{children:[e("small",{class:"menu-grow",children:[e(h,{id:"sJ2yQc"}),e("br",{}),e("span",{class:"more-insignificant",children:ke.map(X=>X.title).join(", ")})]}),e("small",{class:"more-insignificant",children:ke.length})]}):e("span",{children:e(h,{id:"sJ2yQc"})})]}),e(Ze,{})]}),e(Ie,{onClick:()=>{const X=`@${(K==null?void 0:K.acct)||_e}`;try{navigator.clipboard.writeText(X),me(l({id:"zJoEwS"}))}catch{me(l({id:"BC0lSD"}))}},children:[e(T,{icon:"copy"}),e("small",{children:[e(h,{id:"27x6gl"}),e("br",{}),e("span",{class:"more-insignificant bidi-isolate",children:["@",(K==null?void 0:K.acct)||_e]})]})]}),e(Ie,{href:S,target:"_blank",children:[e(T,{icon:"external"}),e("small",{class:"menu-double-lines",children:Fc(S)})]}),e("div",{class:"menu-horizontal",children:[e(Ie,{onClick:()=>{try{navigator.clipboard.writeText(S),me(l({id:"edWbV6"}))}catch{me(l({id:"W1ewR0"}))}},children:[e(T,{icon:"link"}),e("span",{children:e(h,{id:"he3ygx"})})]}),(navigator==null?void 0:navigator.share)&&((fe=navigator==null?void 0:navigator.canShare)==null?void 0:fe.call(navigator,{url:S}))&&e(Ie,{onClick:()=>{try{navigator.share({url:S})}catch{alert(l({id:"TtG3Uh"}))}},children:[e(T,{icon:"share"}),e("span",{children:e(h,{id:"LFKLqp"})})]})]}),!!f&&e(O,{children:[e(Ze,{}),B?e(Ie,{onClick:()=>{p("loading"),(async()=>{try{const X=await d.v1.accounts.$select((K==null?void 0:K.id)||v).unmute();y(X),p("default"),me(l({id:"B4Xkly",values:{username:k}})),A.reloadGenericAccounts.id="mute",A.reloadGenericAccounts.counter++}catch{p("error")}})()},children:[e(T,{icon:"unmute"}),e("span",{children:e(h,{id:"Q/HUhC",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(Rn,{menuClassName:"menu-blur",openTrigger:"clickOnly",direction:"bottom",overflow:"auto",shift:16,label:e(O,{children:[e(T,{icon:"mute"}),e("span",{class:"menu-grow",children:e(h,{id:"xhPEH3",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})}),e("span",{style:{textOverflow:"clip"},children:[e(T,{icon:"time"}),e(T,{icon:"chevron-right"})]})]}),children:e("div",{class:"menu-wrap",children:Mc.map(X=>e(Ie,{onClick:()=>{p("loading"),(async()=>{try{const Se=await d.v1.accounts.$select((K==null?void 0:K.id)||v).mute({duration:X});y(Se),p("default"),me(l({id:"/plB9m",values:{0:typeof Ft[X]=="function"?Ft[X]():u(Ft[X]),username:k}})),A.reloadGenericAccounts.id="mute",A.reloadGenericAccounts.counter++}catch{p("error"),me(l({id:"vWGBjT",values:{username:k}}))}})()},children:typeof Ft[X]=="function"?Ft[X]():u(Ft[X])}))})}),ee&&e(ut,{subMenu:!0,menuItemClassName:"danger",confirmLabel:e(O,{children:[e(T,{icon:"user-x"}),e("span",{children:e(h,{id:"unyq2W",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}),onClick:()=>{p("loading"),(async()=>{try{const X=await d.v1.accounts.$select((K==null?void 0:K.id)||v).removeFromFollowers();y(X),p("default"),me(l({id:"AgkcM/",values:{username:k}})),A.reloadGenericAccounts.id="followers",A.reloadGenericAccounts.counter++}catch{p("error")}})()},children:[e(T,{icon:"user-x"}),e("span",{children:e(h,{id:"VCZ0OT"})})]}),e(ut,{subMenu:!0,confirm:!W,confirmLabel:e(O,{children:[e(T,{icon:"block"}),e("span",{children:e(h,{id:"aforS9",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{p("loading"),(async()=>{try{if(W){const X=await d.v1.accounts.$select((K==null?void 0:K.id)||v).unblock();y(X),p("default"),me(l({id:"sI9N29",values:{username:k}}))}else{const X=await d.v1.accounts.$select((K==null?void 0:K.id)||v).block();y(X),p("default"),me(l({id:"uYcYzu",values:{username:k}}))}A.reloadGenericAccounts.id="block",A.reloadGenericAccounts.counter++}catch{p("error"),W?me(l({id:"0tG4wG",values:{username:k}})):me(l({id:"pA+qEx",values:{username:k}}))}})()},children:W?e(O,{children:[e(T,{icon:"unblock"}),e("span",{children:e(h,{id:"/3LJfX",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(O,{children:[e(T,{icon:"block"}),e("span",{children:e(h,{id:"JRswkR",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]})}),e(Ie,{className:"danger",onClick:()=>{A.showReportModal={account:K||n}},children:[e(T,{icon:"flag"}),e("span",{children:e(h,{id:"qTJgpR",values:{username:k},components:{0:e("span",{class:"bidi-isolate"})}})})]})]}),m&&J&&s&&Qe("@mastodon/profile-edit")&&e(O,{children:[e(Ze,{}),e(Ie,{onClick:()=>{Q(!0)},children:[e(T,{icon:"pencil"}),e("span",{children:e(h,{id:"9OpVZg"})})]})]}),!1]}),!f&&g==="loading"&&e(Be,{abrupt:!0}),!!f&&!E&&e(ut,{confirm:z||ce,confirmLabel:e("span",{children:l(ce?{id:"e7qQIH"}:{id:"q4ucww",values:{1:n.acct||n.username}})}),menuItemClassName:"danger",align:"end",disabled:q,onClick:()=>{p("loading"),(async()=>{try{let X;z||ce?X=await d.v1.accounts.$select(L.current).unfollow():X=await d.v1.accounts.$select(L.current).follow(),X&&y(X),p("default")}catch(X){alert(X),p("error")}})()},children:e("button",{type:"button",class:`${z||ce?"light swap":""}`,"data-swap-state":z||ce?"danger":"",disabled:q,children:z?e(O,{children:[e("span",{children:e(h,{id:"y6sq5j"})}),e("span",{children:e(h,{id:"HKrBPX"})})]}):ce?e(O,{children:[e("span",{children:e(h,{id:"Yx0Ud8"})}),e("span",{children:e(h,{id:"yTVtKs"})})]}):_?e(O,{children:[e(T,{icon:"lock"})," ",e("span",{children:e(h,{id:"MKEPCY"})})]}):l({id:"MKEPCY"})})})]})]}),!!re&&e(Ye,{onClose:()=>{Ae(!1)},children:e(Hc,{note:C,fields:I,onClose:()=>Ae(!1)})}),!!De&&e(Ye,{onClose:()=>{Ne(!1)},children:e(qc,{accountID:L.current,onClose:()=>Ne(!1)})}),!!Pe&&e(Ye,{onClose:()=>{Ue(!1)},children:e(Yc,{account:n,note:U,onRelationshipChange:X=>{y(X)},onClose:()=>Ue(!1)})}),!!Ce&&e(Ye,{onClose:()=>{Q(!1)},children:e(jc,{onClose:({state:X,account:Se}={})=>{Q(!1),X==="success"&&Se&&r(Se)}})})]})}function Bc([n,i,s]){const o=.2126*n+.7152*i+.0722*s;let c;return o>=220?c=1:o<=50?c=.1:c=o/255,c=Math.min(1,c),[n,i,s,c]}function Fc(n){if(!n)return;const i=URL.parse(n),{host:s,pathname:o}=i,c=o.replace(/\/$/,"").replace(/^\//,"");return e(O,{children:[e("span",{class:"more-insignificant",children:[Pt.toUnicode(s),"/"]}),e("wbr",{}),e("span",{children:c})]})}function Hc({note:n,fields:i,onClose:s}){const{_:o}=ue(),c=(i==null?void 0:i.map(({name:u,value:l})=>`${u}
|
||
${Ei(l)}`).join(`
|
||
|
||
`))||"",r=Ei(n)+(c?`
|
||
|
||
${c}`:"");return e("div",{class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"9groMz"})})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:r}),e(ys,{forceTranslate:!0,text:r})]})]})}function qc({accountID:n,onClose:i}){const{_:s}=ue(),{masto:o}=le(),[c,r]=$("default"),[u,l]=$([]),[d,a]=$([]),[m,b]=Nt(f=>f+1,0);ne(()=>{r("loading"),(async()=>{try{const f=await rn();l(f);const y=await o.v1.accounts.$select(n).lists.list();a(y),r("default")}catch{r("error")}})()},[m]);const[g,p]=$(!1);return e("div",{class:"sheet",id:"list-add-remove-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"sJ2yQc"})})}),e("main",{children:[u.length>0?e("ul",{class:"list-add-remove",children:u.map(f=>{const y=d.some(v=>v.id===f.id);return e("li",{children:e("button",{type:"button",class:`light ${y?"checked":""}`,disabled:c==="loading",onClick:()=>{r("loading"),(async()=>{try{y?await o.v1.lists.$select(f.id).accounts.remove({accountIds:[n]}):await o.v1.lists.$select(f.id).accounts.create({accountIds:[n]}),b()}catch{r("error"),alert(s(y?{id:"7KnEYa"}:{id:"Tba8uO"}))}})()},children:[e(T,{icon:"check-circle",alt:"☑️"}),e("span",{children:f.title})]})})})}):c==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):c==="error"?e("p",{class:"ui-state",children:e(h,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(h,{id:"/MJ7gZ"})}),e("button",{type:"button",class:"plain2",onClick:()=>p(!0),disabled:c!=="default",children:[e(T,{icon:"plus",size:"l"})," ",e("span",{children:e(h,{id:"Sb2gYF"})})]})]}),g&&e(Ye,{onClick:f=>{f.target===f.currentTarget&&p(!1)},children:e(vi,{list:g==null?void 0:g.list,onClose:f=>{f.state==="success"&&b(),p(!1)}})})]})}function Yc({account:n,note:i,onRelationshipChange:s=()=>{},onClose:o=()=>{}}){const{_:c}=ue(),{masto:r}=le(),[u,l]=$("default"),d=j(null);return ne(()=>{let a;return d.current&&!i&&(a=setTimeout(()=>{var m,b;(b=(m=d.current).focus)==null||b.call(m)},100)),()=>{clearTimeout(a)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!o&&e("button",{type:"button",class:"sheet-close",onClick:o,children:e(T,{icon:"x",alt:c({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(h,{id:"DYqYm5",values:{0:(n==null?void 0:n.username)||(n==null?void 0:n.acct)},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:e("form",{onSubmit:a=>{a.preventDefault();const b=new FormData(a.target).get("note");(b==null?void 0:b.trim())!==(i==null?void 0:i.trim())&&(l("loading"),(async()=>{try{const g=await r.v1.accounts.$select(n==null?void 0:n.id).note.create({comment:b});l("default"),s(g),o()}catch(g){l("error"),alert((g==null?void 0:g.message)||c({id:"ot8LpF"}))}})())},children:[e("textarea",{ref:d,name:"note",disabled:u==="loading",dir:"auto",children:i}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:u==="loading",onClick:()=>{o==null||o()},children:e(h,{id:"dEgA5A"})}),e("span",{children:[e(Be,{abrupt:!0,hidden:u!=="loading"}),e("button",{disabled:u==="loading",type:"submit",children:e(h,{id:"SrwrEj"})})]})]})]})})]})}function jc({onClose:n=()=>{}}){const{_:i}=ue(),{masto:s}=le(),[o,c]=$("loading"),[r,u]=$(null);ne(()=>{(async()=>{try{const g=await s.v1.accounts.verifyCredentials();u(g),c("default")}catch{c("error")}})()},[]);const{displayName:l,source:d}=r||{},{note:a,fields:m}=d||{},b=j(null);return e("div",{class:"sheet",id:"edit-profile-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(h,{id:"9OpVZg"})})}),e("main",{children:o==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("form",{onSubmit:g=>{g.preventDefault();const p=new FormData(g.target),f=p.get("display_name"),y=p.get("note"),v=b.current.querySelectorAll('input[name^="fields_attributes"]'),w=[];v.forEach(S=>{const k=S.name,[_,x,C]=k.match(/fields_attributes\[(\d+)\]\[(.+)\]/)||[],I=S.value?S.value.trim():"";x&&C&&I&&(w[x]||(w[x]={}),w[x][C]=I)}),w.forEach(S=>{S.name&&!S.value&&(S.value="")}),(async()=>{try{const S=await s.v1.accounts.updateCredentials({displayName:f,note:y,fieldsAttributes:w});n==null||n({state:"success",account:S})}catch(S){alert((S==null?void 0:S.message)||i({id:"FwMMx0"}))}})()},children:[e("p",{children:e("label",{children:[e(h,{id:"6YtxFj"})," ",e("input",{type:"text",name:"display_name",defaultValue:l,maxLength:30,disabled:o==="loading",dir:"auto"})]})}),e("p",{children:e("label",{children:[e(h,{id:"E+oKCO"}),e("textarea",{defaultValue:a,name:"note",maxLength:500,rows:"5",disabled:o==="loading",dir:"auto"})]})}),e("p",{children:e(h,{id:"T4I119"})}),e("table",{ref:b,children:[e("thead",{children:e("tr",{children:[e("th",{children:e(h,{id:"87a/t/"})}),e("th",{children:e(h,{id:"4b3oEV"})})]})}),e("tbody",{children:Array.from({length:Math.max(4,m.length)}).map((g,p)=>{const{name:f="",value:y=""}=m[p]||{};return e(Vc,{name:f,value:y,index:p,disabled:o==="loading"},p)})})]}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:o==="loading",onClick:()=>{n==null||n()},children:e(h,{id:"dEgA5A"})}),e("button",{type:"submit",disabled:o==="loading",children:e(h,{id:"tfDRzk"})})]})]})})]})}function Vc({name:n,value:i,disabled:s,index:o}){const[c,r]=$(!!i);return e("tr",{children:[e("td",{children:e("input",{type:"text",name:`fields_attributes[${o}][name]`,defaultValue:n,disabled:s,maxLength:255,required:c,dir:"auto"})}),e("td",{children:e("input",{type:"text",name:`fields_attributes[${o}][value]`,defaultValue:i,disabled:s,maxLength:255,onChange:u=>r(!!u.currentTarget.value),dir:"auto"})})]})}function Kc({acct:n,instance:i}){let[s,o]=n.split("@");o||(o=i);const c=Pt.toASCII(n);return e("div",{class:"handle-info",children:[e("span",{class:"handle-handle",title:c,children:[e("b",{class:"handle-username",children:s}),e("span",{class:"handle-at",children:"@"}),e("b",{class:"handle-server",children:o})]}),e("div",{class:"handle-legend",children:[e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon username"})," ",e(h,{id:"silO9A"})]})," ",e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon server"})," ",e(h,{id:"rZgCpJ"})]})]})]})}function Gc({account:n,instance:i,onClose:s}){const{_:o}=ue(),{masto:c,instance:r,authenticated:u}=le({instance:i}),l=typeof n=="string";return ne(()=>{l||(A.accounts[`${n.id}@${r}`]=n)},[n]),$s(s),e("div",{class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close outer",onClick:s,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e(Ps,{instance:r,authenticated:u,account:n,fetchAccount:async()=>{if(l)try{return await c.v1.accounts.lookup({acct:n,skip_webfinger:!1})}catch{const a=await c.v2.search.fetch({q:n,type:"accounts",limit:1,resolve:u});if(a.accounts.length)return a.accounts[0];if(/https?:\/\/[^/]+\/@/.test(n)){const m=URL.parse(n),{hostname:b,pathname:g}=m,p=g.replace(/^\//,"").replace(/\/$/,"")+"@"+b,f=await c.v2.search.fetch({q:p,type:"accounts",limit:1,resolve:u});if(f.accounts.length)return f.accounts[0]}}else return n}})]})}function Wc({onClose:n}){const{_:i}=ue(),{masto:s}=le(),[o,c]=$("default"),[r,u]=$([]),[l,d]=Nt(m=>m+1,0);ne(()=>{c("loading"),(async()=>{try{const m=await ft.drafts.keys();if(m.length){const b=_n(),g=m.filter(p=>p.startsWith(b));if(g.length){const p=await ft.drafts.getMany(g);p.sort((f,y)=>new Date(y.updatedAt).getTime()-new Date(f.updatedAt).getTime()),u(p)}else u([])}else u([]);c("default")}catch{c("error")}})()},[l]);const a=(r==null?void 0:r.length)>0;return e("div",{class:"sheet",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:[e("h2",{children:[e(h,{id:"krk5ws"})," ",e(Be,{abrupt:!0,hidden:o!=="loading"})]}),a&&e("div",{class:"insignificant",children:e(h,{id:"Ap/10+"})})]}),e("main",{children:a?e(O,{children:[e("ul",{class:"drafts-list",children:r.map(m=>{const{updatedAt:b,key:g,draftStatus:p,replyTo:f}=m,y=new Date(b);return e("li",{children:[e("div",{class:"mini-draft-meta",children:[e("b",{children:[e(T,{icon:f?"reply":"quill",size:"s"})," ",e("time",{children:[!!f&&e(O,{children:[e("span",{class:"bidi-isolate",children:["@",f.account.acct]}),e("br",{})]}),mt(y)]})]}),e(ut,{confirmLabel:e("span",{children:e(h,{id:"/W5yFF"})}),menuItemClassName:"danger",align:"end",disabled:o==="loading",onClick:()=>{(async()=>{try{await ft.drafts.del(g),d()}catch{alert(i({id:"rEYoku"}))}})()},children:e("button",{type:"button",class:"small light",disabled:o==="loading",children:e(h,{id:"Jb6/SB"})})})]}),e("button",{type:"button",disabled:o==="loading",class:"draft-item",onClick:async()=>{let v;if(f){c("loading");try{v=await s.v1.statuses.$select(f.id).fetch()}catch{alert(i({id:"tMwimH"})),c("default");return}c("default")}window.__COMPOSE__={draftStatus:p,replyToStatus:v},A.showCompose=!0,A.showDrafts=!1},children:e(Zc,{draft:m})})]},b)})}),r.length>1&&e("p",{children:e(ut,{confirmLabel:e("span",{children:e(h,{id:"3IakFR"})}),menuItemClassName:"danger",disabled:o==="loading",onClick:()=>{(async()=>{c("loading");try{await ft.drafts.delMany(r.map(m=>m.key)),c("default"),d()}catch{alert(i({id:"0J4sZq"})),c("error")}})()},children:e("button",{type:"button",class:"light danger",disabled:o==="loading",children:e(h,{id:"hOg+Mt"})})})})]}):e("p",{children:e(h,{id:"8iQ+jk"})})})]})}function Zc({draft:n}){var g;const{_:i}=ue(),{draftStatus:s,replyTo:o}=n,{status:c,spoilerText:r,poll:u,mediaAttachments:l}=s,d=((g=u==null?void 0:u.options)==null?void 0:g.length)>0,a=(l==null?void 0:l.length)>0,m=d||a,b=Te(()=>{if(!a)return;const p=l.find(v=>/image/.test(v.type));if(!p)return;const{file:f}=p;return URL.createObjectURL(f)},[a,l]);return e(O,{children:e("div",{class:"mini-draft",children:[m&&e("div",{class:`mini-draft-aside ${b?"has-image":""}`,style:b?{"--bg-image":`url(${b})`}:{},children:[d&&e(T,{icon:"poll",alt:i({id:"4WUbF1"})}),a&&e("span",{children:[e(T,{icon:"attachment",alt:i({id:"xYilR2"})})," ",e("small",{children:l==null?void 0:l.length})]})]}),e("div",{class:"mini-draft-main",children:[!!r&&e("div",{class:"mini-draft-spoiler",children:r}),!!c&&e("div",{class:"mini-draft-status",children:c})]})]})})}function Xc({html:n,url:i,width:s,height:o,onClose:c=()=>{}}){const{_:r}=ue();return e("div",{class:"embed-modal-container",children:[e("div",{class:"top-controls",children:[e("button",{type:"button",class:"light",onClick:()=>c(),children:e(T,{icon:"x",alt:r({id:"yz7wBu"})})}),i&&e("a",{href:i,target:"_blank",rel:"noopener noreferrer",class:"button plain",children:[e("span",{children:e(h,{id:"4/RpOy"})})," ",e(T,{icon:"external"})]})]}),e("div",{class:"embed-content",dangerouslySetInnerHTML:{__html:n},style:{"--width":s+"px","--height":o+"px","--aspect-ratio":`${s}/${o}`}})]})}function Jc({instance:n,excludeRelationshipAttrs:i=[],postID:s,onClose:o=()=>{},blankCopy:c}){const{_:r}=ue(),{masto:u,instance:l}=le(),d=n?n===l:!0,a=Ve(A),[m,b]=$("default"),[g,p]=$([]),[f,y]=$(!1);if($s(o),!a.showGenericAccounts)return null;const{id:v,heading:w,fetchAccounts:S,accounts:k,showReactions:_}=a.showGenericAccounts,[x,C]=$({}),I=async D=>{if(!(D!=null&&D.length)||!d)return;const oe=await ri(D,x);oe&&C({...x,...oe})},E=D=>{S&&(D&&p([]),b("loading"),(async()=>{try{const{done:oe,value:ee}=await S(D);if(Array.isArray(ee)){if(D){const W=[];for(let Z=0;Z<ee.length;Z++){const B=ee[Z],Y=W.find((ce,M)=>ce.id===B.id&&Z!==M);Y?Y._types.push(...B._types):W.push({_types:[],...B})}p(W)}else p(W=>{const Z=W;for(const B of ee){const Y=Z.find(ce=>ce.id===B.id);Y?Y._types.push(...B._types):Z.push(B)}return Z});y(!oe),I(ee)}else y(!1);b("default")}catch{b("error")}})())},L=j(!0);ne(()=>{(k==null?void 0:k.length)>0?(p(k),I(k)):(E(!0),L.current=!1)},[k,S]),ne(()=>{var D;L.current||((D=a.reloadGenericAccounts)==null?void 0:D.id)===v&&E(!0)},[a.reloadGenericAccounts.counter]);const z=A.statuses[s];return e("div",{id:"generic-accounts-container",class:"sheet",tabindex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:o,children:e(T,{icon:"x",alt:r({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:w||r({id:"bPwFdf"})})}),e("main",{children:[z&&e(ge,{to:`/${n||l}/s/${z.id}`,class:"post-preview",children:e(Ke,{status:z,size:"s",readOnly:!0})}),g.length>0?e(O,{children:[e("ul",{class:"accounts-list",children:g.map(D=>{var W,Z;const oe=x[D.id],ee=`${D.id}-${((W=D._types)==null?void 0:W.length)||""}`;return e("li",{children:[_&&((Z=D._types)==null?void 0:Z.length)>0&&e("div",{class:"reactions-block",children:D._types.map(B=>e(T,{icon:{reblog:"rocket",favourite:"heart"}[B],class:`${B}-icon`}))}),e("div",{class:"account-relationships",children:e(dt,{account:D,showStats:!0,relationship:oe,excludeRelationshipAttrs:i})})]},ee)})}),m==="default"?f?e(_t,{onChange:D=>{D&&E()},children:e("button",{type:"button",class:"plain block",onClick:()=>E(),children:e(h,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(h,{id:"2EYeAZ"})}):m==="loading"&&e("p",{class:"ui-state",children:e(Be,{abrupt:!0})})]}):m==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):m==="error"?e("p",{class:"ui-state",children:e(h,{id:"AThL/k"})}):e("p",{class:"ui-state insignificant",children:c||r({id:"10OlfF"})})]})]})}function Qc({alt:n,lang:i,onClose:s}){const{_:o}=ue(),c=Ve(A),[r,u]=$(!1),l=ms(!0),d=c.settings.contentTranslationHideLanguages||[],a=!!i&&i!==l&&!Ii([i],[l])&&!d.find(m=>i===m||Ii([i],[m]));return e("div",{class:"sheet",tabindex:"-1",children:[!!s&&e("button",{type:"button",class:"sheet-close outer",onClick:s,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:[e("h2",{children:e(h,{id:"5gfDMm"})}),e("div",{class:"header-side",children:e(lt,{align:"end",menuButton:e("button",{type:"button",class:"plain4",children:e(T,{icon:"more",alt:o({id:"2FYpfJ"}),size:"xl"})}),children:[e(Ie,{disabled:r,onClick:()=>{u(!0)},children:[e(T,{icon:"translate"}),e("span",{children:e(h,{id:"pi8x/S"})})]}),Do&&e(Ie,{onClick:()=>{No(n,i)},children:[e(T,{icon:"speak"}),e("span",{children:e(h,{id:"yIBLq8"})})]})]})})]}),e("main",{lang:i,dir:"auto",children:[e("p",{style:{whiteSpace:"pre-wrap",textWrap:"pretty"},children:n}),(a||r)&&e(ys,{forceTranslate:r,sourceLanguage:i,text:n})]})]})}const{min:dd,max:ud}=Math;const Os={};for(let n of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])Os[`[object ${n}]`]=n.toLowerCase();function ea(n){return Os[Object.prototype.toString.call(n)]||"object"}const Xt=(n,i=null)=>n.length>=3?Array.prototype.slice.call(n):ea(n[0])=="object"&&i?i.split("").filter(s=>n[0][s]!==void 0).map(s=>n[0][s]):n[0].slice(0);const{PI:Mn,min:hd,max:fd}=Math;const pd=Mn*2,md=Mn/3,ta=Mn/180,na=180/Mn;function Tn(n,i){let s=n.length;Array.isArray(n[0])||(n=[n]),Array.isArray(i[0])||(i=i.map(u=>[u]));let o=i[0].length,c=i[0].map((u,l)=>i.map(d=>d[l])),r=n.map(u=>c.map(l=>Array.isArray(u)?u.reduce((d,a,m)=>d+a*(l[m]||0),0):l.reduce((d,a)=>d+a*u,0)));return s===1&&(r=r[0]),o===1?r.map(u=>u[0]):r}const zs={Kn:18,labWhitePoint:"d65",Xn:.95047,Yn:1,Zn:1.08883,t0:.137931034,t1:.206896552,t2:.12841855,t3:.008856452,kE:216/24389,kKE:8,kK:24389/27,RefWhiteRGB:{X:.95047,Y:1,Z:1.08883},MtxRGB2XYZ:{m00:.4124564390896922,m01:.21267285140562253,m02:.0193338955823293,m10:.357576077643909,m11:.715152155287818,m12:.11919202588130297,m20:.18043748326639894,m21:.07217499330655958,m22:.9503040785363679},MtxXYZ2RGB:{m00:3.2404541621141045,m01:-.9692660305051868,m02:.055643430959114726,m10:-1.5371385127977166,m11:1.8760108454466942,m12:-.2040259135167538,m20:-.498531409556016,m21:.041556017530349834,m22:1.0572251882231791},As:.9414285350000001,Bs:1.040417467,Cs:1.089532651,MtxAdaptMa:{m00:.8951,m01:-.7502,m02:.0389,m10:.2664,m11:1.7135,m12:-.0685,m20:-.1614,m21:.0367,m22:1.0296},MtxAdaptMaI:{m00:.9869929054667123,m01:.43230526972339456,m02:-.008528664575177328,m10:-.14705425642099013,m11:.5183602715367776,m12:.04004282165408487,m20:.15996265166373125,m21:.0492912282128556,m22:.9684866957875502}};const Bn=n=>{const i=Math.sign(n);return n=Math.abs(n),(n<=.0031308?n*12.92:1.055*Math.pow(n,1/2.4)-.055)*i},ia=(n,i,s)=>{const{MtxAdaptMa:o,MtxAdaptMaI:c,MtxXYZ2RGB:r,RefWhiteRGB:u,Xn:l,Yn:d,Zn:a}=zs,m=l*o.m00+d*o.m10+a*o.m20,b=l*o.m01+d*o.m11+a*o.m21,g=l*o.m02+d*o.m12+a*o.m22,p=u.X*o.m00+u.Y*o.m10+u.Z*o.m20,f=u.X*o.m01+u.Y*o.m11+u.Z*o.m21,y=u.X*o.m02+u.Y*o.m12+u.Z*o.m22,v=(n*o.m00+i*o.m10+s*o.m20)*(p/m),w=(n*o.m01+i*o.m11+s*o.m21)*(f/b),S=(n*o.m02+i*o.m12+s*o.m22)*(y/g),k=v*c.m00+w*c.m10+S*c.m20,_=v*c.m01+w*c.m11+S*c.m21,x=v*c.m02+w*c.m12+S*c.m22,C=Bn(k*r.m00+_*r.m10+x*r.m20),I=Bn(k*r.m01+_*r.m11+x*r.m21),E=Bn(k*r.m02+_*r.m12+x*r.m22);return[C*255,I*255,E*255]},wi=(...n)=>{n=Xt(n,"lab");const[i,s,o,...c]=n,[r,u,l]=sa([i,s,o]),[d,a,m]=ia(r,u,l);return[d,a,m,...c.length>0&&c[0]<1?[c[0]]:[]]};function sa(n){var i=[[1.2268798758459243,-.5578149944602171,.2813910456659647],[-.0405757452148008,1.112286803280317,-.0717110580655164],[-.0763729366746601,-.4214933324022432,1.5869240198367816]],s=[[1,.3963377773761749,.2158037573099136],[1,-.1055613458156586,-.0638541728258133],[1,-.0894841775298119,-1.2914855480194092]],o=Tn(s,n);return Tn(i,o.map(c=>c**3))}function Fn(n){const i=Math.sign(n);return n=Math.abs(n),(n<=.04045?n/12.92:Math.pow((n+.055)/1.055,2.4))*i}const oa=(n,i,s)=>{n=Fn(n/255),i=Fn(i/255),s=Fn(s/255);const{MtxRGB2XYZ:o,MtxAdaptMa:c,MtxAdaptMaI:r,Xn:u,Yn:l,Zn:d,As:a,Bs:m,Cs:b}=zs;let g=n*o.m00+i*o.m10+s*o.m20,p=n*o.m01+i*o.m11+s*o.m21,f=n*o.m02+i*o.m12+s*o.m22;const y=u*c.m00+l*c.m10+d*c.m20,v=u*c.m01+l*c.m11+d*c.m21,w=u*c.m02+l*c.m12+d*c.m22;let S=g*c.m00+p*c.m10+f*c.m20,k=g*c.m01+p*c.m11+f*c.m21,_=g*c.m02+p*c.m12+f*c.m22;return S*=y/a,k*=v/m,_*=w/b,g=S*r.m00+k*r.m10+_*r.m20,p=S*r.m01+k*r.m11+_*r.m21,f=S*r.m02+k*r.m12+_*r.m22,[g,p,f]},ki=(...n)=>{const[i,s,o,...c]=Xt(n,"rgb"),r=oa(i,s,o);return[...ca(r),...c.length>0&&c[0]<1?[c[0]]:[]]};function ca(n){const i=[[.819022437996703,.3619062600528904,-.1288737815209879],[.0329836539323885,.9292868615863434,.0361446663506424],[.0481771893596242,.2642395317527308,.6335478284694309]],s=[[.210454268309314,.7936177747023054,-.0040720430116193],[1.9779985324311684,-2.42859224204858,.450593709617411],[.0259040424655478,.7827717124575296,-.8086757549230774]],o=Tn(i,n);return Tn(s,o.map(c=>Math.cbrt(c)))}const{sin:aa,cos:ra}=Math,la=(...n)=>{let[i,s,o]=Xt(n,"lch");return isNaN(o)&&(o=0),o=o*ta,[i,ra(o)*s,aa(o)*s]},Hn=(...n)=>{n=Xt(n,"lch");const[i,s,o,...c]=n,[r,u,l]=la(i,s,o),[d,a,m]=wi(r,u,l);return[d,a,m,...c.length>0&&c[0]<1?[c[0]]:[]]},{sqrt:da,atan2:ua,round:ha}=Math,fa=(...n)=>{const[i,s,o]=Xt(n,"lab"),c=da(s*s+o*o);let r=(ua(o,s)*na+360)%360;return ha(c*1e4)===0&&(r=Number.NaN),[i,c,r]},pa=(...n)=>{const[i,s,o,...c]=Xt(n,"rgb"),[r,u,l]=ki(i,s,o),[d,a,m]=fa(r,u,l);return[d,a,m,...c.length>0&&c[0]<1?[c[0]]:[]]},ma={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_IMG_ALT_API_URL:gd}=ma;function Us({mediaAttachments:n,statusID:i,instance:s,lang:o,index:c=0,onClose:r=()=>{}}){var _,x;const{_:u}=ue(),[l,d]=$("default"),a=j(null),[m,b]=$(c),g=j(null);yt(()=>{var C;(C=g.current)==null||C.scrollIntoView()},[]);const p=j(i);ne(()=>{const C=c*a.current.clientWidth,I=p.current!==i;I&&(p.current=i),a.current.focus(),a.current.scrollTo({left:C*($t()?-1:1),behavior:I?"auto":"smooth"})},[c,i]);const[f,y]=$(!0);ne(()=>{let C=()=>{r()};return a.current&&a.current.addEventListener("swiped-down",C),()=>{a.current&&a.current.removeEventListener("swiped-down",C)}},[]),He("esc",r,{ignoreEventWhen:C=>!!document.querySelector("#modal-container > *")},[r]),ne(()=>{let C=()=>{const{clientWidth:I,scrollLeft:E}=a.current,L=Math.round(Math.abs(E)/I);b(L)};return a.current&&a.current.addEventListener("scroll",C,{passive:!0}),()=>{a.current&&a.current.removeEventListener("scroll",C)}},[]),ne(()=>{let C=setTimeout(()=>{var I,E;(E=(I=a.current)==null?void 0:I.focus)==null||E.call(I)},100);return()=>clearTimeout(C)},[]);const v=Te(()=>n==null?void 0:n.map(C=>{const{blurhash:I}=C;if(I){const E=li(I);return pa(E)}return null}),[n]),w=Te(()=>v==null?void 0:v.map(C=>C?{light:Hn([.95,.01,C[2]]),dark:Hn([.35,.01,C[2]]),default:Hn([.6,C[1],C[2]])}:null)),S=Te(()=>{const I=100/w.length,E=w.map((D,oe)=>{var Z,B,Y,ce;const ee=oe*I+5,W=(oe+1)*I-5;return D!=null&&D.light&&(D!=null&&D.dark)?{light:`
|
||
rgb(${(Z=D.light)==null?void 0:Z.join(",")}) ${ee}%,
|
||
rgb(${(B=D.light)==null?void 0:B.join(",")}) ${W}%
|
||
`,dark:`
|
||
rgb(${(Y=D.dark)==null?void 0:Y.join(",")}) ${ee}%,
|
||
rgb(${(ce=D.dark)==null?void 0:ce.join(",")}) ${W}%
|
||
`}:{light:`
|
||
transparent ${ee}%,
|
||
transparent ${W}%
|
||
`,dark:`
|
||
transparent ${ee}%,
|
||
transparent ${W}%
|
||
`}}),L=E.map(D=>D.light).join(", "),z=E.map(D=>D.dark).join(", ");return{light:L,dark:z}},[w]);let k=j(null);return ne(()=>()=>{var C,I;(I=(C=k.current)==null?void 0:C.hideToast)==null||I.call(C)},[]),yt(()=>{const C=w[m];let I,E;if(C){const L=we.local.get("theme");if(L){const z=`rgb(${C[L].join(",")})`;I=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),I&&(E=I.content,I.content=z)}else{const z=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",D=`rgb(${C[z].join(",")})`;I=document.querySelector(`meta[name="theme-color"][media*="${z}"]`),I&&(E=I.content,I.content=D)}}return()=>{I&&E&&(I.content=E)}},[m,w]),e("div",{class:`media-modal-container media-modal-count-${n==null?void 0:n.length}`,children:[e("div",{ref:a,tabIndex:"0","data-swipe-threshold":"44",class:"carousel",onClick:C=>{(C.target.classList.contains("carousel-item")||C.target.classList.contains("media")||C.target.classList.contains("media-zoom"))&&r()},style:n.length>1?{backgroundAttachment:"local","--accent-gradient-light":S==null?void 0:S.light,"--accent-gradient-dark":S==null?void 0:S.dark}:{},children:n==null?void 0:n.map((C,I)=>{var L,z;const E=n.length===1?w[I]:null;return e("div",{class:"carousel-item",style:E?{"--accent-color":`rgb(${E.default.join(",")})`,"--accent-light-color":`rgb(${(L=E.light)==null?void 0:L.join(",")})`,"--accent-dark-color":`rgb(${(z=E.dark)==null?void 0:z.join(",")})`,"--accent-alpha-color":`rgba(${E.default.join(",")}, 0.4)`}:{},tabindex:"0",ref:I===m?g:null,onClick:D=>{D.target.classList.contains("media")||y(!f)},children:[!!C.description&&e("button",{type:"button",class:"media-alt",hidden:!f,onClick:()=>{A.showMediaAlt={alt:C.description,lang:o}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:o,dir:"auto",children:C.description})]}),e(vs,{media:C,showOriginal:!0,lang:o})]},C.id)})}),e("div",{class:"carousel-top-controls",hidden:!f,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:()=>r(),children:e(T,{icon:"x",alt:u({id:"yz7wBu"})})})}),(n==null?void 0:n.length)>1?e("span",{class:"carousel-dots",children:n==null?void 0:n.map((C,I)=>e("button",{type:"button",disabled:I===m,class:`carousel-dot ${I===m?"active":""}`,onClick:E=>{E.preventDefault(),E.stopPropagation();const L=a.current.clientWidth*I*($t()?-1:1);a.current.focus(),a.current.scrollTo({left:L,behavior:"smooth"})},children:e(T,{icon:"round",size:"s",alt:"⸱"})},C.id))}):e("span",{}),e("span",{children:[e(lt,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(T,{icon:"more",alt:u({id:"2FYpfJ"})})}),children:[e(qe,{href:((_=n[m])==null?void 0:_.remoteUrl)||((x=n[m])==null?void 0:x.url),class:"carousel-button",target:"_blank",title:u({id:"5hXGws"}),children:[e(T,{icon:"popout"}),e("span",{children:e(h,{id:"aDr7Vc"})})]}),!1]})," ",e(ge,{to:`${s?`/${s}`:""}/s/${i}${window.matchMedia("(min-width: calc(40em + 350px))").matches?`?media=${m+1}`:""}`,class:"button carousel-button media-post-link",children:[e("span",{class:"button-label",children:[e(h,{id:"ISg5SQ"})," "]}),"»"]})]})]}),(n==null?void 0:n.length)>1&&e("div",{class:"carousel-controls",hidden:!f,children:[e("button",{type:"button",class:"carousel-button",hidden:m===0,onClick:C=>{C.preventDefault(),C.stopPropagation(),a.current.focus(),a.current.scrollTo({left:a.current.clientWidth*(m-1)*($t()?-1:1),behavior:"smooth"})},children:e(T,{icon:"arrow-left",alt:u({id:"DHhJ7s"})})}),e("button",{type:"button",class:"carousel-button",hidden:m===n.length-1,onClick:C=>{C.preventDefault(),C.stopPropagation(),a.current.focus(),a.current.scrollTo({left:a.current.clientWidth*(m+1)*($t()?-1:1),behavior:"smooth"})},children:e(T,{icon:"arrow-right",alt:u({id:"hXzOVo"})})})]})]})}const ga=[,"spam","legal","violation","other"],Jt={spam:{label:{id:"t8dIOP"},description:{id:"csQin/"}},legal:{label:{id:"IjKdHM"},description:{id:"e6tGFu"}},violation:{label:{id:"KPFHM2"},description:{id:"fpotTF"},stampLabel:{id:"iuLUuH"}},other:{label:{id:"/IX/7x"},description:{id:"kxiG8g"},excludeStamp:!0}};function ba({account:n,post:i,onClose:s}){const{_:o,_:c}=ue(),{masto:r}=le(),[u,l]=$("default"),[d,a]=n.acct.split("@"),[m,b]=Te(()=>{const{rules:k,domain:_}=ds();return[k||[],_]}),[g,p]=$(null),[f,y]=$(!1),v=j(null),[w,S]=$(!1);return e("div",{class:"report-modal-container",children:[e("div",{class:"top-controls",children:[e("h1",{children:c(i?{id:"muLhL3"}:{id:"ACul2G",values:{username:d}})}),e("button",{type:"button",class:"plain4 small",disabled:u==="loading",onClick:()=>s(),children:e(T,{icon:"x",size:"xl",alt:c({id:"yz7wBu"})})})]}),e("main",{children:[e("div",{class:"report-preview",children:i?e(Ke,{status:i,size:"s",previewMode:!0}):e(dt,{account:n,avatarSize:"xxl",useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!g&&!Jt[g].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[o(Jt[g].stampLabel||o(Jt[g].label)),e("small",{children:e(h,{id:"2WtL62"})})]},g),e("form",{onSubmit:k=>{k.preventDefault();const _=new FormData(k.target),x=Object.fromEntries(_.entries());let{category:C,comment:I,forward:E}=x;I||(I=void 0),E==="on"&&(E=!0);const L=C==="violation"?Object.entries(x).filter(([D])=>D.startsWith("rule_ids")).map(([D,oe])=>oe):void 0,z={category:C,comment:I,forward:E,ruleIds:L};l("loading"),(async()=>{try{await r.v1.reports.create({accountId:n.id,statusIds:i!=null&&i.id?[i.id]:void 0,category:C,comment:I,ruleIds:L,forward:E}),l("success"),me(c(i?{id:"y3ou+8"}:{id:"R9kjEL"})),s()}catch(D){l("error"),me((D==null?void 0:D.message)||c(i?{id:"+3FjPq"}:{id:"oEQq5w"}))}})()},children:[e("p",{children:c(i?{id:"L9fUm+"}:{id:"rSLkfe"})}),e("section",{class:"report-categories",children:ga.map(k=>k==="violation"&&!(m!=null&&m.length)?null:e(O,{children:[e("label",{class:"report-category",children:[e("input",{type:"radio",name:"category",value:k,required:!0,disabled:u==="loading",onChange:_=>{p(_.target.value),y(_.target.value==="violation")}}),e("span",{children:[o(Jt[k].label)," ",e("small",{class:"ib insignificant",children:o(Jt[k].description)})]})]}),k==="violation"&&!!(m!=null&&m.length)&&e("div",{class:"shazam-container no-animation",hidden:!f,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"report-rules",ref:v,children:m.map((_,x)=>e("label",{class:"report-rule",children:[e("input",{type:"checkbox",name:`rule_ids[${x}]`,value:_.id,required:f&&!w,disabled:u==="loading",onChange:C=>{const{checked:I}=C.target;I?S(!0):v.current.querySelectorAll("input:checked").length||S(!1)}}),e("span",{children:_.text})]},_.id))})})})]},k))}),e("section",{class:"report-comment",children:[e("p",{children:e("label",{for:"report-comment",children:e(h,{id:"ecVtjm"})})}),e("textarea",{maxlength:"1000",rows:"1",name:"comment",id:"report-comment",disabled:u==="loading",required:!i})]}),!!a&&a!==b&&e("section",{children:e("p",{children:e("label",{children:[e("input",{type:"checkbox",switch:!0,name:"forward",disabled:u==="loading"})," ",e("span",{children:e(h,{id:"cyjS8M",values:{domain:a},components:{0:e("i",{})}})})]})})}),e("footer",{children:[e("button",{type:"submit",disabled:u==="loading",children:e(h,{id:"4cijjm"})})," ",e("button",{type:"submit",class:"plain2",disabled:u==="loading",onClick:async()=>{try{await r.v1.accounts.$select(n.id).mute(),me(c({id:"/BGBeF",values:{username:d}}))}catch{me(c({id:"v02K7/",values:{username:d}}))}},children:e(h,{id:"caeqw/",components:{0:e("small",{class:"ib"})}})})," ",e("button",{type:"submit",class:"plain2",disabled:u==="loading",onClick:async()=>{try{await r.v1.accounts.$select(n.id).block(),me(c({id:"kjUejn",values:{username:d}}))}catch{me(c({id:"pMcdDp",values:{username:d}}))}},children:e(h,{id:"JybQca",components:{0:e("small",{class:"ib"})}})}),e(Be,{hidden:u!=="loading"})]})]})]})]})}var gn={exports:{}},bd=gn.exports,Bi;function ya(){return Bi||(Bi=1,function(n){var i=function(){var s=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",r={};function u(d,a){if(!r[d]){r[d]={};for(var m=0;m<d.length;m++)r[d][d.charAt(m)]=m}return r[d][a]}var l={compressToBase64:function(d){if(d==null)return"";var a=l._compress(d,6,function(m){return o.charAt(m)});switch(a.length%4){default:case 0:return a;case 1:return a+"===";case 2:return a+"==";case 3:return a+"="}},decompressFromBase64:function(d){return d==null?"":d==""?null:l._decompress(d.length,32,function(a){return u(o,d.charAt(a))})},compressToUTF16:function(d){return d==null?"":l._compress(d,15,function(a){return s(a+32)})+" "},decompressFromUTF16:function(d){return d==null?"":d==""?null:l._decompress(d.length,16384,function(a){return d.charCodeAt(a)-32})},compressToUint8Array:function(d){for(var a=l.compress(d),m=new Uint8Array(a.length*2),b=0,g=a.length;b<g;b++){var p=a.charCodeAt(b);m[b*2]=p>>>8,m[b*2+1]=p%256}return m},decompressFromUint8Array:function(d){if(d==null)return l.decompress(d);for(var a=new Array(d.length/2),m=0,b=a.length;m<b;m++)a[m]=d[m*2]*256+d[m*2+1];var g=[];return a.forEach(function(p){g.push(s(p))}),l.decompress(g.join(""))},compressToEncodedURIComponent:function(d){return d==null?"":l._compress(d,6,function(a){return c.charAt(a)})},decompressFromEncodedURIComponent:function(d){return d==null?"":d==""?null:(d=d.replace(/ /g,"+"),l._decompress(d.length,32,function(a){return u(c,d.charAt(a))}))},compress:function(d){return l._compress(d,16,function(a){return s(a)})},_compress:function(d,a,m){if(d==null)return"";var b,g,p={},f={},y="",v="",w="",S=2,k=3,_=2,x=[],C=0,I=0,E;for(E=0;E<d.length;E+=1)if(y=d.charAt(E),Object.prototype.hasOwnProperty.call(p,y)||(p[y]=k++,f[y]=!0),v=w+y,Object.prototype.hasOwnProperty.call(p,v))w=v;else{if(Object.prototype.hasOwnProperty.call(f,w)){if(w.charCodeAt(0)<256){for(b=0;b<_;b++)C=C<<1,I==a-1?(I=0,x.push(m(C)),C=0):I++;for(g=w.charCodeAt(0),b=0;b<8;b++)C=C<<1|g&1,I==a-1?(I=0,x.push(m(C)),C=0):I++,g=g>>1}else{for(g=1,b=0;b<_;b++)C=C<<1|g,I==a-1?(I=0,x.push(m(C)),C=0):I++,g=0;for(g=w.charCodeAt(0),b=0;b<16;b++)C=C<<1|g&1,I==a-1?(I=0,x.push(m(C)),C=0):I++,g=g>>1}S--,S==0&&(S=Math.pow(2,_),_++),delete f[w]}else for(g=p[w],b=0;b<_;b++)C=C<<1|g&1,I==a-1?(I=0,x.push(m(C)),C=0):I++,g=g>>1;S--,S==0&&(S=Math.pow(2,_),_++),p[v]=k++,w=String(y)}if(w!==""){if(Object.prototype.hasOwnProperty.call(f,w)){if(w.charCodeAt(0)<256){for(b=0;b<_;b++)C=C<<1,I==a-1?(I=0,x.push(m(C)),C=0):I++;for(g=w.charCodeAt(0),b=0;b<8;b++)C=C<<1|g&1,I==a-1?(I=0,x.push(m(C)),C=0):I++,g=g>>1}else{for(g=1,b=0;b<_;b++)C=C<<1|g,I==a-1?(I=0,x.push(m(C)),C=0):I++,g=0;for(g=w.charCodeAt(0),b=0;b<16;b++)C=C<<1|g&1,I==a-1?(I=0,x.push(m(C)),C=0):I++,g=g>>1}S--,S==0&&(S=Math.pow(2,_),_++),delete f[w]}else for(g=p[w],b=0;b<_;b++)C=C<<1|g&1,I==a-1?(I=0,x.push(m(C)),C=0):I++,g=g>>1;S--,S==0&&(S=Math.pow(2,_),_++)}for(g=2,b=0;b<_;b++)C=C<<1|g&1,I==a-1?(I=0,x.push(m(C)),C=0):I++,g=g>>1;for(;;)if(C=C<<1,I==a-1){x.push(m(C));break}else I++;return x.join("")},decompress:function(d){return d==null?"":d==""?null:l._decompress(d.length,32768,function(a){return d.charCodeAt(a)})},_decompress:function(d,a,m){var b=[],g,p=4,f=4,y=3,v="",w=[],S,k,_,x,C,I,E,L={val:m(0),position:a,index:1};for(S=0;S<3;S+=1)b[S]=S;for(_=0,C=Math.pow(2,2),I=1;I!=C;)x=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=m(L.index++)),_|=(x>0?1:0)*I,I<<=1;switch(g=_){case 0:for(_=0,C=Math.pow(2,8),I=1;I!=C;)x=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=m(L.index++)),_|=(x>0?1:0)*I,I<<=1;E=s(_);break;case 1:for(_=0,C=Math.pow(2,16),I=1;I!=C;)x=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=m(L.index++)),_|=(x>0?1:0)*I,I<<=1;E=s(_);break;case 2:return""}for(b[3]=E,k=E,w.push(E);;){if(L.index>d)return"";for(_=0,C=Math.pow(2,y),I=1;I!=C;)x=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=m(L.index++)),_|=(x>0?1:0)*I,I<<=1;switch(E=_){case 0:for(_=0,C=Math.pow(2,8),I=1;I!=C;)x=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=m(L.index++)),_|=(x>0?1:0)*I,I<<=1;b[f++]=s(_),E=f-1,p--;break;case 1:for(_=0,C=Math.pow(2,16),I=1;I!=C;)x=L.val&L.position,L.position>>=1,L.position==0&&(L.position=a,L.val=m(L.index++)),_|=(x>0?1:0)*I,I<<=1;b[f++]=s(_),E=f-1,p--;break;case 2:return w.join("")}if(p==0&&(p=Math.pow(2,y),y++),b[E])v=b[E];else if(E===f)v=k+k.charAt(0);else return null;w.push(v),b[f++]=k+v.charAt(0),p--,k=v,p==0&&(p=Math.pow(2,y),y++)}}};return l}();n!=null?n.exports=i:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return i})}(gn)),gn.exports}var Fi=ya();const va="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%234169E1'%20d='M14%2052a4%204%200%201%201-8%200%204%204%200%200%201%208%200Zm64-42a4%204%200%201%201-8%200%204%204%200%200%201%208%200Z'/%3e%3c/svg%3e",wa="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2082%2062'%3e%3crect%20width='78'%20height='58'%20x='2'%20y='2'%20fill='%23999'%20fill-opacity='.3'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3crect%20width='18'%20height='46'%20x='8'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='32'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3crect%20width='18'%20height='46'%20x='56'%20y='8'%20fill='%23fff'%20stroke='%23999'%20stroke-width='2'%20rx='1'/%3e%3c/svg%3e",ka="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20fill='none'%20viewBox='0%200%2084%2062'%3e%3crect%20width='64'%20height='48'%20x='18'%20y='2'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M19%203h62v10H19z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M43%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M52%208a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3crect%20width='32'%20height='48'%20x='2'%20y='12'%20fill='%23fff'%20stroke='%23999'%20stroke-width='3'%20rx='4'/%3e%3cpath%20fill='%23999'%20fill-opacity='.3'%20d='M3%2049h30v10H3z'/%3e%3cpath%20stroke='%234169E1'%20stroke-width='2'%20d='M11%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3cpath%20stroke='%23999'%20stroke-width='2'%20d='M20%2054a2%202%200%201%201-4%200%202%202%200%200%201%204%200Zm9%200a2%202%200%201%201-4%200%202%202%200%200%201%204%200Z'/%3e%3c/svg%3e",Sa=200,_a=10;async function xn(){const{masto:n}=le(),i=n.v1.followedTags.list({limit:Sa}),s=[];let o=0;do{const{value:c,done:r}=await i.next();if(r||(c==null?void 0:c.length)===0)break;s.push(...c),o++}while(o<_a);return s.sort((c,r)=>c.name.localeCompare(r.name)),s.length&&setTimeout(()=>{we.account.set("followedTags",{tags:s,updatedAt:Date.now()})},1),s}const Ca=24*60*60*1e3;async function Ia(){try{const{tags:n,updatedAt:i}=we.account.get("followedTags")||{};return n!=null&&n.length?(Date.now()-i>Ca&&xn(),n):await xn()}catch{return[]}}const Hi=document.createElement("div"),Ta=n=>{if(!n)return[];if(n.indexOf("#")===-1)return[];Hi.innerHTML=n;const i=Hi.querySelectorAll("a.hashtag");return i.length?Array.from(i).map(s=>s.innerText.trim().replace(/^[^#]*#+/,"")):[]};function bn({children:n}){if(typeof n=="string")return n;const[i,s]=$("");return ne(()=>{Promise.resolve(n).then(s)},[n]),i}const kt=9,xa=["following","mentions","notifications","list","public","trending","search","hashtag","bookmarks","favourites"],Bs={following:{id:"7ZJHdw"},notifications:{id:"iDNBZe"},list:{id:"h16FyT"},public:{id:"tXgQpk"},search:{id:"A1taO8"},"account-statuses":{id:"AeXO77"},bookmarks:{id:"7Ff7ia"},favourites:{id:"zZOZj7"},hashtag:{id:"GP8RLS"},trending:{id:"4/iCqx"},mentions:{id:"/bZzdR"}},yn={list:[{text:{id:"DUMt1y"},name:"id",notRequired:!0}],public:[{text:{id:"OgyJSr"},name:"local",type:"checkbox"},{text:{id:"kyAi7k"},name:"instance",type:"text",placeholder:{id:"7defFj"},notRequired:!0}],trending:[{text:{id:"kyAi7k"},name:"instance",type:"text",placeholder:{id:"7defFj"},notRequired:!0}],search:[{text:{id:"dmloPh"},name:"query",type:"text",placeholder:{id:"UHDQDE"},notRequired:!0}],"account-statuses":[{text:"@",name:"id",type:"text",placeholder:"cheeaun@mastodon.social"}],hashtag:[{text:"#",name:"hashtag",type:"text",placeholder:{id:"a6oTWs"},pattern:"[^#]+"},{text:{id:"eK4SL/"},name:"media",type:"checkbox"},{text:{id:"kyAi7k"},name:"instance",type:"text",placeholder:{id:"7defFj"},notRequired:!0}]},Aa=Ct(async({id:n})=>{const i=await le().masto.v1.accounts.$select(n).fetch();return i.username||i.acct||i.displayName}),An={following:{id:"home",title:(n,i)=>i===0?he._({id:"i0qMbr"}):he._({id:"following.title"}),path:"/",icon:"home"},mentions:{id:"mentions",title:{id:"/bZzdR"},path:"/mentions",icon:"at"},notifications:{id:"notifications",title:{id:"iDNBZe"},path:"/notifications",icon:"notification"},list:{id:({id:n})=>n?"list":"lists",title:({id:n})=>n?Ec(n):he._({id:"h16FyT"}),path:({id:n})=>n?`/l/${n}`:"/l",icon:"list",excludeViewMode:({id:n})=>n?[]:["multi-column"]},public:{id:"public",title:({local:n})=>n?he._({id:"d5zxa4"}):he._({id:"4ERYY7"}),subtitle:({instance:n})=>n||le().instance,path:({local:n,instance:i})=>`/${i}/p${n?"/l":""}`,icon:({local:n})=>n?"building":"earth"},trending:{id:"trending",title:{id:"4/iCqx"},subtitle:({instance:n})=>n||le().instance,path:({instance:n})=>`/${n}/trending`,icon:"chart"},search:{id:"search",title:({query:n})=>n?`“${n}”`:he._({id:"A1taO8"}),path:({query:n})=>n?`/search?q=${encodeURIComponent(n)}&type=statuses`:"/search",icon:"search",excludeViewMode:({query:n})=>n?[]:["multi-column"]},"account-statuses":{id:"account-statuses",title:Aa,path:({id:n})=>`/a/${n}`,icon:"user"},bookmarks:{id:"bookmarks",title:{id:"7Ff7ia"},path:"/b",icon:"bookmark"},favourites:{id:"favourites",title:{id:"zZOZj7"},path:"/f",icon:"heart"},hashtag:{id:"hashtag",title:({hashtag:n})=>n,subtitle:({instance:n})=>n||le().instance,path:({hashtag:n,instance:i,media:s})=>`${i?`/${i}`:""}/t/${n.split(/\s+/).join("+")}${s?"?media=1":""}`,icon:"hashtag"}};function Ea({onClose:n}){const{_:i}=ue(),s=Ve(A),{shortcuts:o}=s,[c,r]=$(!1),[u,l]=$(!1),[d]=mi();return e("div",{id:"shortcuts-settings-container",class:"sheet",tabindex:"-1",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(T,{icon:"x",alt:he._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:[e(T,{icon:"shortcut"})," ",e(h,{id:"CTqTgr"})," ",e("sup",{style:{fontSize:12,opacity:.5,textTransform:"uppercase"},children:e(h,{id:"A1As8l"})})]})}),e("main",{children:[e("p",{children:e(h,{id:"CIHAsy"})}),e("div",{class:"shortcuts-view-mode",children:[{value:"float-button",label:he._({id:"qwdOim"}),imgURL:va},{value:"tab-menu-bar",label:he._({id:"UxBoCm"}),imgURL:ka},{value:"multi-column",label:he._({id:"uvDfdW"}),imgURL:wa}].map(({value:a,label:m,imgURL:b})=>{const g=s.settings.shortcutsViewMode===a||a==="float-button"&&!s.settings.shortcutsViewMode;return e("label",{class:g?"checked":"",children:[e("input",{type:"radio",name:"shortcuts-view-mode",value:a,checked:g,onChange:p=>{A.settings.shortcutsViewMode=p.target.value}})," ",e("img",{src:b,alt:"",width:"80",height:"58"})," ",e("span",{children:m})]},a)})}),o.length>0?e(O,{children:[e("ol",{class:"shortcuts-list",ref:d,children:o.filter(Boolean).map((a,m)=>{const b=Object.values(a).join("-"),{type:g}=a;if(!An[g])return null;let{icon:p,title:f,subtitle:y,excludeViewMode:v}=An[g];typeof f=="function"?f=f(a,m):f=i(f),typeof y=="function"?y=y(a,m):y=i(y),typeof p=="function"&&(p=p(a,m)),typeof v=="function"&&(v=v(a,m));const w=v==null?void 0:v.includes(s.settings.shortcutsViewMode);return e("li",{children:[e(T,{icon:p}),e("span",{class:"shortcut-text",children:[e(bn,{children:f}),y&&e(O,{children:[" ",e("small",{class:"ib insignificant",children:y})]}),w&&e("span",{class:"tag",children:e(h,{id:"5KJFnN"})})]}),e("span",{class:"shortcut-actions",children:[e("button",{type:"button",class:"plain small",disabled:m===0,onClick:()=>{const S=Array.from(A.shortcuts);if(m>0){const k=A.shortcuts[m-1];S[m-1]=a,S[m]=k,A.shortcuts=S}},children:e(T,{icon:"arrow-up",alt:he._({id:"QyioBP"})})}),e("button",{type:"button",class:"plain small",disabled:m===o.length-1,onClick:()=>{const S=Array.from(A.shortcuts);if(m<A.shortcuts.length-1){const k=A.shortcuts[m+1];S[m+1]=a,S[m]=k,A.shortcuts=S}},children:e(T,{icon:"arrow-down",alt:he._({id:"3Ib6FN"})})}),e("button",{type:"button",class:"plain small",onClick:()=>{r({shortcut:a,shortcutIndex:m})},children:e(T,{icon:"pencil",alt:he._({id:"ePK91l"})})})]})]},b)})}),o.length===1&&s.settings.shortcutsViewMode!=="float-button"&&e("div",{class:"ui-state insignificant",children:[e(T,{icon:"info"})," ",e("small",{children:e(h,{id:"3Xq4Zi"})})]})]}):e("div",{class:"ui-state insignificant",children:[e("p",{children:s.settings.shortcutsViewMode==="multi-column"?he._({id:"3xIN+E"}):he._({id:"vLxvHT"})}),e("p",{children:e(h,{id:"Fq4zw3",components:{0:e("br",{}),1:e("a",{href:"#",onClick:a=>{a.preventDefault(),A.shortcuts=[{type:"following"},{type:"notifications"}]}})}})})]}),e("p",{class:"insignificant",children:o.length>=kt&&(s.settings.shortcutsViewMode==="multi-column"?he._({id:"RqXfsz",values:{SHORTCUTS_LIMIT:kt}}):he._({id:"EVRO/o",values:{SHORTCUTS_LIMIT:kt}}))}),e("p",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e("button",{type:"button",class:"light",onClick:()=>l(!0),children:e(h,{id:"bgVLbt"})}),e("button",{type:"button",disabled:o.length>=kt,onClick:()=>r(!0),children:[e(T,{icon:"plus"})," ",e("span",{children:s.settings.shortcutsViewMode==="multi-column"?he._({id:"Vh3ADI"}):he._({id:"9tmn6W"})})]})]})]}),c&&e(Ye,{onClick:a=>{a.target===a.currentTarget&&r(!1)},children:e(Ra,{shortcut:c.shortcut,shortcutIndex:c.shortcutIndex,onSubmit:({result:a,mode:m})=>{m==="edit"?A.shortcuts[c.shortcutIndex]=a:A.shortcuts.push(a)},onClose:()=>r(!1)})}),u&&e(Ye,{onClick:a=>{a.target===a.currentTarget&&l(!1)},children:e(La,{shortcuts:o,onClose:()=>l(!1)})})]})}const qi={list:{id:"1qL+L+"},search:{id:"dmTmkQ"},hashtag:{id:"E8laYz"}};function Ra({onSubmit:n,disabled:i,shortcut:s,shortcutIndex:o,onClose:c}){var v,w;const{_:r}=ue(),u=!!s,[l,d]=$((s==null?void 0:s.type)||null),[a,m]=$("default"),[b,g]=$([]),[p,f]=$([]);ne(()=>{(async()=>{if(l==="list")try{m("loading");const S=await rn();g(S),m("default")}catch{m("error")}})(),(async()=>{if(l==="hashtag")try{const S=await xn();f(S)}catch{}})()},[l]);const y=j();return ne(()=>{if(u&&l&&yn[l]){const S=y.current;yn[l].forEach(({name:k,type:_})=>{const x=S.querySelector(`[name="${k}"]`);x&&s[k]&&(_==="checkbox"?x.checked=s[k]==="on":x.value=s[k])})}},[u,l]),e("div",{id:"shortcut-settings-form",class:"sheet",children:[!!c&&e("button",{type:"button",class:"sheet-close",onClick:c,children:e(T,{icon:"x",alt:he._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:u?he._({id:"pe1jog"}):he._({id:"Lsxpe5"})})}),e("main",{tabindex:"-1",children:e("form",{ref:y,onSubmit:S=>{S.preventDefault();const k=new FormData(S.target),_={};k.forEach((x,C)=>{_[C]=x==null?void 0:x.trim(),C==="instance"&&(_[C]=_[C].replace(/^https?:\/\//,"").replace(/\/+$/,""),_[C]=_[C].replace(/^@?[^@]+@/,""))}),_.type&&(n({result:_,mode:u?"edit":"add"}),S.target.reset(),d(null),c==null||c())},children:[e("p",{children:e("label",{children:[e("span",{children:e(h,{id:"cklVjM"})}),e("select",{required:!0,disabled:i,onChange:S=>{d(S.target.value)},defaultValue:u?s.type:void 0,name:"type",dir:"auto",children:[e("option",{}),xa.map(S=>e("option",{value:S,children:r(Bs[S])}))]})]})}),(w=(v=yn[l])==null?void 0:v.map)==null?void 0:w.call(v,({text:S,name:k,type:_,placeholder:x,pattern:C,notRequired:I})=>l==="list"?e("p",{children:e("label",{children:[e("span",{children:e(h,{id:"2BBAbc"})}),e("select",{name:"id",required:!I,disabled:i||a==="loading",defaultValue:u?s.id:void 0,dir:"auto",children:[e("option",{value:""}),b.map(E=>e("option",{value:E.id,children:E.title}))]})]})}):e("p",{children:e("label",{children:[e("span",{children:r(S)})," ",e("input",{type:_,switch:_==="checkbox"||void 0,name:k,placeholder:r(x),required:_==="text"&&!I,disabled:i,list:l==="hashtag"?"followed-hashtags-datalist":null,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:C,dir:"auto"}),l==="hashtag"&&p.length>0&&e("datalist",{id:"followed-hashtags-datalist",children:p.map(E=>e("option",{value:E.name}))})]})})),!!qi[l]&&e("p",{class:"form-note insignificant",children:[e(T,{icon:"info"}),r(qi[l])]}),e("footer",{children:[e("button",{type:"submit",class:"block",disabled:i||a==="loading",children:u?he._({id:"tfDRzk"}):he._({id:"m16xKo"})}),u&&e("button",{type:"button",class:"light danger",onClick:()=>{A.shortcuts.splice(o,1),c==null||c()},children:e(h,{id:"t/YqKh"})})]})]})})]})}function La({shortcuts:n,onClose:i}){var g;const{_:s}=ue(),{masto:o}=le(),c=Te(()=>!n||!n.filter(Boolean).length?"":Fi.compressToEncodedURIComponent(JSON.stringify(n.filter(Boolean))),[n]),[r,u]=$(""),[l,d]=$("default"),a=Te(()=>{if(!r)return d("default"),null;try{const p=JSON.parse(Fi.decompressFromEncodedURIComponent(r));if(!Array.isArray(p))throw new Error("Not an array");return d("default"),p}catch{try{const f=JSON.parse(r);if(!Array.isArray(f))throw new Error("Not an array");return d("default"),f}catch{return d("error"),null}}},[r]),m=A.shortcuts.length>0,b=j();return e("div",{id:"import-export-container",class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:he._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"OOa7/5",components:{0:e("small",{class:"ib insignificant"})}})})}),e("main",{tabindex:"-1",children:[e("section",{children:[e("h3",{children:[e(T,{icon:"arrow-down-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(h,{id:"l3s5ri"})})]}),e("p",{class:"field-button",children:[e("input",{ref:b,type:"text",name:"import",placeholder:he._({id:"tBmklN"}),class:"block",onInput:p=>{u(p.target.value)},dir:"auto"}),A.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2 small",disabled:l==="cloud-downloading",onClick:async()=>{d("cloud-downloading");const p=St();me(he._({id:"HLqLGx"}));try{const y=(await o.v1.accounts.relationships.fetch({id:[p]}))[0];if(y){const{note:v=""}=y;if(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/.test(v)){const w=v.match(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/)[1],{v:S,dt:k,data:_}=JSON.parse(w);b.current.value=_,b.current.dispatchEvent(new Event("input"))}}d("default")}catch{d("error"),me(he._({id:"gCDfX+"}))}},title:he._({id:"B6cG3J"}),children:[e(T,{icon:"cloud"}),e(T,{icon:"arrow-down"})]})]}),!!a&&Array.isArray(a)&&e(O,{children:[e("p",{children:[e("b",{children:a.length})," shortcut",a.length>1?"s":""," ",e("small",{class:"insignificant",children:["(",r.length," characters)"]})]}),e("ol",{class:"import-settings-list",children:a.map(p=>{var f,y;return e("li",{children:[e("span",{style:{opacity:n.some(v=>Object.keys(v).every(w=>v[w]===p[w]))?1:0},children:"*"}),e("span",{children:[s(Bs[p.type]),p.type==="list"&&" ⚠️"," ",(y=(f=yn[p.type])==null?void 0:f.map)==null?void 0:y.call(f,({text:v,name:w,type:S})=>p[w]?e(O,{children:[e("span",{class:"tag collapsed insignificant",children:[v,":"," ",S==="checkbox"?p[w]==="on"?"✅":"❌":p[w]]})," "]}):null)]})]})})}),e("p",{children:[e("small",{children:e(h,{id:"o6sElH"})}),e("br",{}),e("small",{children:["⚠️"," ",e(h,{id:"N4z4P/"})]})]})]}),l==="error"&&e("p",{class:"error",children:e("small",{children:["⚠️ ",e(h,{id:"ZhsPEb"})]})}),e("p",{children:[m&&e(O,{children:[e(ut,{confirmLabel:he._({id:"6MzUUU"}),menuFooter:e("div",{class:"footer",children:e(h,{id:"nl8sCE"})}),onClick:()=>{const p=a.filter(v=>!A.shortcuts.some(w=>Object.keys(w).every(S=>w[S]===v[S])));if(!p.length){me(he._({id:"o6L30P"}));return}let f=[...A.shortcuts,...p];const y=f.length>kt;y&&(f=f.slice(0,kt)),A.shortcuts=f,me(y?he._({id:"SBmqmC",values:{SHORTCUTS_LIMIT:kt}}):he._({id:"QO9uTx"})),i==null||i()},children:e("button",{type:"button",class:"plain2",disabled:!a,children:e(h,{id:"c89gCv"})})})," "]}),e(ut,{confirmLabel:m?he._({id:"6ZjzWP"}):he._({id:"DWumLi"}),menuItemClassName:m?"danger":void 0,onClick:()=>{A.shortcuts=a,me(he._({id:"QO9uTx"})),i==null||i()},children:e("button",{type:"button",class:"plain2",disabled:!a,children:m?he._({id:"uIp8WL"}):he._({id:"Sjnlwj"})})})]})]}),e("section",{children:[e("h3",{children:[e(T,{icon:"arrow-up-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(h,{id:"GS+Mus"})})]}),e("p",{children:e("input",{style:{width:"100%"},type:"text",value:c,readOnly:!0,onClick:p=>{if(p.target.value){p.target.select();try{navigator.clipboard.writeText(p.target.value),me(he._({id:"cWtH+v"}))}catch{me(he._({id:"yUWyHa"}))}}},dir:"auto"})}),e("p",{children:[e("button",{type:"button",class:"plain2",disabled:!c,onClick:()=>{try{navigator.clipboard.writeText(c),me(he._({id:"+Kq2vY"}))}catch{me(he._({id:"tFvxZF"}))}},children:[e(T,{icon:"clipboard"})," ",e("span",{children:e(h,{id:"he3ygx"})})]})," ",(navigator==null?void 0:navigator.share)&&((g=navigator==null?void 0:navigator.canShare)==null?void 0:g.call(navigator,{text:c}))&&e("button",{type:"button",class:"plain2",disabled:!c,onClick:()=>{try{navigator.share({text:c})}catch{alert(he._({id:"TtG3Uh"}))}},children:[e(T,{icon:"share"})," ",e("span",{children:e(h,{id:"Z8lGw6"})})]})," ",A.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2",disabled:l==="cloud-uploading",onClick:async()=>{d("cloud-uploading");const p=St();try{const y=(await o.v1.accounts.relationships.fetch({id:[p]}))[0];if(y){const{note:v=""}=y;let w="";const S=JSON.stringify({v:"1",dt:Date.now(),data:c});/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/.test(v)?w=v.replace(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/,`<phanpy-shortcuts-settings>${S}</phanpy-shortcuts-settings>`):w=`${v}
|
||
|
||
|
||
<phanpy-shortcuts-settings>${S}</phanpy-shortcuts-settings>`,me(he._({id:"9ZYiLz"})),await o.v1.accounts.$select(p).note.create({comment:w}),d("default"),me(he._({id:"5w02SH"}))}}catch{d("error"),me(he._({id:"aVsTYo"}))}},title:he._({id:"gWd6Cu"}),children:[e(T,{icon:"cloud"}),e(T,{icon:"arrow-up"})]})," ",c.length>0&&e("small",{class:"insignificant ib",children:e(h,{id:"IPXOXm",values:{0:c.length}})})]}),!!c&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:e(h,{id:"e5E+WH"})})}),e("textarea",{style:{width:"100%"},rows:10,readOnly:!0,children:JSON.stringify(n.filter(Boolean),null,2)})]})]}),A.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(T,{icon:"cloud"})," ",e(h,{id:"C4T6O/"})]})})]})]})}us(A,n=>{for(const[i,s,o,c]of n)/^show/i.test(s)&&!o&&Xn()});function $a(){var c,r,u,l,d,a,m,b;const{_:n}=ue(),i=Ve(A),s=hs(),o=Wt();return ne(()=>{setTimeout(mo,1e3)},[]),e(O,{children:[!!i.showCompose&&e(Ye,{class:`solid ${i.composerState.minimized?"min":""}`,minimized:!!i.composerState.minimized,children:e(go,{replyToStatus:typeof i.showCompose!="boolean"?i.showCompose.replyToStatus:((c=window.__COMPOSE__)==null?void 0:c.replyToStatus)||null,editStatus:((r=A.showCompose)==null?void 0:r.editStatus)||((u=window.__COMPOSE__)==null?void 0:u.editStatus)||null,draftStatus:((l=A.showCompose)==null?void 0:l.draftStatus)||((d=window.__COMPOSE__)==null?void 0:d.draftStatus)||null,onClose:g=>{const{newStatus:p,instance:f,type:y}=g||{};A.showCompose=!1,window.__COMPOSE__=null,p&&(A.reloadStatusPage++,me({text:{post:n({id:"aTyHBW"}),reply:n({id:"lZdBKl"}),edit:n({id:"a5BN7l"})}[y||"post"],delay:1e3,duration:1e4,onClick:v=>{v.hideToast(),A.prevLocation=o,s(f?`/${f}/s/${p.id}`:`/s/${p.id}`)}}))}})}),!!i.showSettings&&e(Ye,{onClose:()=>{A.showSettings=!1},children:e(Ic,{onClose:()=>{A.showSettings=!1}})}),!!i.showAccounts&&e(Ye,{onClose:()=>{A.showAccounts=!1},children:e(pc,{onClose:()=>{A.showAccounts=!1}})}),!!i.showAccount&&e(Ye,{onClose:()=>{A.showAccount=!1},children:e(Gc,{account:((a=i.showAccount)==null?void 0:a.account)||i.showAccount,instance:(m=i.showAccount)==null?void 0:m.instance,onClose:({destination:g}={})=>{A.showAccount=!1}})}),!!i.showDrafts&&e(Ye,{onClose:()=>{A.showDrafts=!1},children:e(Wc,{onClose:()=>A.showDrafts=!1})}),!!i.showMediaModal&&e(Ye,{onClick:g=>{(g.target===g.currentTarget||g.target.classList.contains("media"))&&(A.showMediaModal=!1)},children:e(Us,{mediaAttachments:i.showMediaModal.mediaAttachments,instance:i.showMediaModal.instance,index:i.showMediaModal.index,statusID:i.showMediaModal.statusID,onClose:()=>{A.showMediaModal=!1}})}),!!i.showShortcutsSettings&&e(Ye,{onClose:()=>{A.showShortcutsSettings=!1},children:e(Ea,{onClose:()=>A.showShortcutsSettings=!1})}),!!i.showGenericAccounts&&e(Ye,{onClose:()=>{A.showGenericAccounts=!1},children:e(Jc,{instance:i.showGenericAccounts.instance,excludeRelationshipAttrs:i.showGenericAccounts.excludeRelationshipAttrs,postID:i.showGenericAccounts.postID,onClose:()=>A.showGenericAccounts=!1,blankCopy:i.showGenericAccounts.blankCopy})}),!!i.showMediaAlt&&e(Ye,{onClose:g=>{A.showMediaAlt=!1},children:e(Qc,{alt:i.showMediaAlt.alt||i.showMediaAlt,lang:(b=i.showMediaAlt)==null?void 0:b.lang,onClose:()=>{A.showMediaAlt=!1}})}),!!i.showEmbedModal&&e(Ye,{class:"solid",onClose:()=>{A.showEmbedModal=!1},children:e(Xc,{html:i.showEmbedModal.html,url:i.showEmbedModal.url,width:i.showEmbedModal.width,height:i.showEmbedModal.height,onClose:()=>{A.showEmbedModal=!1}})}),!!i.showReportModal&&e(Ye,{onClose:()=>{A.showReportModal=!1},children:e(ba,{account:i.showReportModal.account,post:i.showReportModal.post,onClose:()=>{A.showReportModal=!1}})})]})}function Qn({accountID:n,onChange:i}){const{_:s}=ue(),{masto:o}=le(),[c,r]=$("default"),[u,l]=$(null),[d,a]=$(null),m=d!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:c==="loading"||m,onClick:()=>{r("loading"),l("accept"),(async()=>{try{const b=await o.v1.followRequests.$select(n).authorize();if(!(b!=null&&b.followedBy))throw new Error("Follow request not accepted");a(b),i()}catch{}r("default")})()},children:e(h,{id:"g3UF2V"})})," ",e("button",{type:"button",disabled:c==="loading"||m,class:"light danger",onClick:()=>{r("loading"),l("reject"),(async()=>{try{const b=await o.v1.followRequests.$select(n).reject();if(b!=null&&b.followedBy)throw new Error("Follow request not rejected");a(b),i()}catch{r("default")}})()},children:e(h,{id:"1t/NnN"})}),e("span",{class:"follow-request-states",children:m&&u?u==="accept"?e(T,{icon:"check-circle",alt:s({id:"bzMKg7"}),class:"follow-accepted"}):e(T,{icon:"x-circle",alt:s({id:"ekCRTP"}),class:"follow-rejected"}):e(Be,{hidden:c!=="loading"})})]})}const Yi={mention:"comment",status:"notification",reblog:"rocket",follow:"follow",follow_request:"follow-add",favourite:"heart",poll:"poll",update:"pencil","admin.signup":"account-edit","admin.report":"account-warning",severed_relationships:"heart-break",moderation_warning:"alert",emoji_reaction:"emoji2","pleroma:emoji_reaction":"emoji2",annual_report:"celebrate"};function ji({account:n,emoji:i,emoji_url:s}){let o,c;typeof s=="string"?o=s:(o=s==null?void 0:s.url,c=s==null?void 0:s.staticUrl);const r=o?e(Po,{url:o,staticUrl:c,alt:i}):i;return e(h,{id:"i5uN6K",values:{account:n,emojiObject:r}})}const qn={status:({account:n})=>e(h,{id:"idiIxW",values:{account:n}}),reblog:({count:n,account:i,postsCount:s,postType:o,components:{Subject:c}})=>e(h,{id:"jkt9P5",values:{0:Xe(n),1:Xe(n),count:n,postsCount:s,postType:o,account:i},components:{0:e(c,{clickable:n>1}),1:e("span",{title:n}),2:e(c,{clickable:n>1}),3:e("span",{title:n})}}),follow:({account:n,count:i,components:{Subject:s}})=>e(h,{id:"+71G9C",values:{0:Xe(i),count:i,account:n},components:{0:e(s,{clickable:i>1}),1:e("span",{title:i})}}),follow_request:({account:n})=>e(h,{id:"eh6NHW",values:{account:n}}),favourite:({account:n,count:i,postsCount:s,postType:o,components:{Subject:c}})=>e(h,{id:"RqX1mR",values:{0:Xe(i),1:Xe(i),count:i,postsCount:s,postType:o,account:n},components:{0:e(c,{clickable:i>1}),1:e("span",{title:i}),2:e(c,{clickable:i>1}),3:e("span",{title:i})}}),poll:()=>he._({id:"kIlJaS"}),"poll-self":()=>he._({id:"kpjzdN"}),"poll-voted":()=>he._({id:"moT7M8"}),update:()=>he._({id:"uzt17m"}),"favourite+reblog":({count:n,account:i,postsCount:s,postType:o,components:{Subject:c}})=>e(h,{id:"NunZZQ",values:{0:Xe(n),1:Xe(n),count:n,postsCount:s,postType:o,account:i},components:{0:e(c,{clickable:n>1}),1:e("span",{title:n}),2:e(c,{clickable:n>1}),3:e("span",{title:n})}}),"admin.sign_up":({account:n})=>e(h,{id:"fJCCpx",values:{account:n}}),"admin.report":({account:n,targetAccount:i})=>e(h,{id:"eNfCmq",values:{account:n,targetAccount:i}}),severed_relationships:({name:n})=>e(h,{id:"Xl9v6+",values:{name:n},components:{0:e("i",{})}}),moderation_warning:()=>e("b",{children:e(h,{id:"YqffEv"})}),emoji_reaction:ji,"pleroma:emoji_reaction":ji,annual_report:({year:n})=>e(h,{id:"INLTzH",values:{year:n}})},Ma={account_suspension:({from:n,targetName:i})=>e(h,{id:"uRkcgw",values:{from:n,targetName:i},components:{0:e("i",{}),1:e("i",{})}}),domain_block:({from:n,targetName:i,followersCount:s,followingCount:o})=>e(h,{id:"Q3yArs",values:{from:n,targetName:i,followersCount:s,followingCount:o},components:{0:e("i",{}),1:e("i",{})}}),user_domain_block:({targetName:n,followersCount:i,followingCount:s})=>e(h,{id:"RQKWUa",values:{targetName:n,followersCount:i,followingCount:s},components:{0:e("i",{})}})},Da={none:{id:"ipnHrn"},disable:{id:"jw0eSZ"},mark_statuses_as_sensitive:{id:"v9jO+F"},delete_statuses:{id:"raUMBQ"},sensitive:{id:"w2OpMr"},silence:{id:"mlycBx"},suspend:{id:"Fz4lZ1"}},Yn=30;function Na({notification:n,instance:i,isStatic:s,disableContextMenu:o}){var H,U,K,pe,J,ye,_e;const{_:c}=ue(),{masto:r}=le(),{id:u,status:l,account:d,report:a,event:m,moderation_warning:b,annualReport:g,_ids:p,_accounts:f,_statuses:y,_groupKeys:v,sampleAccounts:w,notificationsCount:S,groupKey:k}=n;let{type:_}=n;if(_==="mention"&&!l)return null;const x=(l==null?void 0:l.reblog)||l,C=x==null?void 0:x.id,I=St(),E=I===(d==null?void 0:d.id),L=(H=l==null?void 0:l.poll)==null?void 0:H.voted,z=!!(l!=null&&l.inReplyToAccountId)&&(l==null?void 0:l.inReplyToAccountId)!==I&&((U=l==null?void 0:l.account)==null?void 0:U.id)===I;let D=0,oe=0;if(_==="favourite+reblog"){if(f)for(const q of f)(K=q._types)!=null&&K.includes("favourite")&&D++,(pe=q._types)!=null&&pe.includes("reblog")&&oe++;!oe&&D&&(_="favourite"),!D&&oe&&(_="reblog")}let ee;_==="poll"?ee=qn[E?"poll-self":L?"poll-voted":"poll"]:qn[_]?ee=qn[_]:ee=he._({id:"ODqZt1",values:{type:_}});const W=({clickable:q,...re})=>q?e("b",{tabIndex:"0",onClick:Y,...re}):e("b",{...re});if(typeof ee=="function"){const q=(f==null?void 0:f.length)||(w==null?void 0:w.length)||(d?1:0),re=(y==null?void 0:y.length)||(l?1:0);if(_==="admin.report"){const Ae=a==null?void 0:a.targetAccount;Ae&&(ee=ee({account:e(pt,{account:d,showAvatar:!0}),targetAccount:e(pt,{account:Ae,showAvatar:!0})}))}else if(_==="severed_relationships"){const Ae=m==null?void 0:m.targetName;Ae&&(ee=ee({name:Ae}))}else if((_==="emoji_reaction"||_==="pleroma:emoji_reaction")&&n.emoji){const Ae=n.emoji_url||((ye=(J=l==null?void 0:l.emojis)==null?void 0:J.find)==null?void 0:ye.call(J,De=>(De==null?void 0:De.shortcode)===n.emoji.replace(/^:/,"").replace(/:$/,"")));ee=ee({account:e(pt,{account:d,showAvatar:!0}),emoji:n.emoji,emojiURL:Ae})}else _==="annual_report"?ee=ee({...n.annualReport}):ee=ee({account:d?e(pt,{account:d,showAvatar:!0}):(w==null?void 0:w[0])&&e(pt,{account:w[0],showAvatar:!0}),count:q,postsCount:re,postType:z?"reply":"post",components:{Subject:W}})}const Z=n.createdAt&&new Date(n.createdAt).toLocaleString(),B={"favourite+reblog":he._({id:"+XOeb+"}),favourite:he._({id:"LQFF6J"}),reblog:he._({id:"phQpSa"}),follow:he._({id:"Ih01jh"})}[_]||he._({id:"bPwFdf"}),Y=()=>{A.showGenericAccounts={heading:B,accounts:f,showReactions:_==="favourite+reblog",excludeRelationshipAttrs:_==="follow"?["followedBy"]:[],postID:ot(C,i)}},M=S>0&&S>(w==null?void 0:w.length)?"remote":"local";if(l!=null&&l.filtered){const q=((_e=l==null?void 0:l.account)==null?void 0:_e.id)===I,re=Yt(l.filtered,"notifications");if(!E&&!q&&(re==null?void 0:re.action)==="hide")return null}return e("div",{class:`notification notification-${_}`,"data-notification-id":p||u,"data-group-key":(v==null?void 0:v.join(" "))||k,tabIndex:"0",children:[e("div",{class:`notification-type notification-${_}`,title:Z,children:_==="favourite+reblog"?e(O,{children:[e(T,{icon:"rocket",size:"xl",alt:_,class:"reblog-icon"}),e(T,{icon:"heart",size:"xl",alt:_,class:"favourite-icon"})]}):e(T,{icon:Yi[_]||"notification",size:"xl",alt:_})}),e("div",{class:"notification-content",children:[_!=="mention"&&e(O,{children:[e("p",{children:ee}),_==="follow_request"&&e(Qn,{accountID:d.id}),_==="severed_relationships"&&e("div",{children:[Ma[m.type]({from:i,...m}),e("br",{}),e("a",{href:`https://${i}/severed_relationships`,target:"_blank",rel:"noopener noreferrer",children:e(h,{id:"YL6Y8P",components:{0:e(T,{icon:"external",size:"s"})}})}),"."]}),_==="moderation_warning"&&!!b&&e("div",{children:[c(Da[b.action]()),e("br",{}),e("a",{href:`/disputes/strikes/${b.id}`,target:"_blank",rel:"noopener noreferrer",children:e(h,{id:"YL6Y8P",components:{0:e(T,{icon:"external",size:"s"})}})})]}),_==="annual_report"&&e("div",{children:e(ge,{to:`/annual_report/${g==null?void 0:g.year}`,children:e(h,{id:"5PGPvG"})})})]}),(f==null?void 0:f.length)>1&&e("p",{class:"avatars-stack",children:[f.slice(0,Yn).map(q=>e(O,{children:[e("a",{href:q.url,rel:"noopener noreferrer",class:"account-avatar-stack",onClick:re=>{re.preventDefault(),A.showAccount=q},children:[e(ht,{url:q.avatarStatic,size:f.length<=10?"xxl":f.length<20?"xl":"l",alt:`${q.displayName} @${q.acct}`,squircle:q==null?void 0:q.bot},q.id),_==="favourite+reblog"&&e("div",{class:"account-sub-icons",children:q._types.map(re=>e(T,{icon:Yi[re],size:"s",class:`${re}-icon`}))})]},q.id)," "]},q.id)),_==="favourite+reblog"&&M==="remote"?e("button",{type:"button",class:"small plain","data-group-keys":v==null?void 0:v.join(" "),onClick:()=>{A.showGenericAccounts={heading:B,fetchAccounts:async()=>{const q=await Promise.allSettled(v.map(async Ae=>{const De=r.v2.notifications.$select(Ae).accounts.list();return[Ae,(await De.next()).value]})),re=[];for(const Ae of q){const[De,Ne]=Ae.value,Pe=/^favourite/.test(De)?"favourite":/^reblog/.test(De)?"reblog":null;if(Pe)for(const Ue of Ne){const Ce=re.find(Q=>Q.id===Ue.id);Ce?Ce._types.push(Pe):(Ue._types=[Pe],re.push(Ue))}}return{done:!0,value:re}},showReactions:!0,postID:ot(C,i)}},children:e(T,{icon:"chevron-down"})}):e("button",{type:"button",class:"small plain",onClick:Y,children:[f.length>Yn&&`+${f.length-Yn}`,e(T,{icon:"chevron-down"})]})]}),!(f!=null&&f.length)&&(w==null?void 0:w.length)>1&&e("p",{class:"avatars-stack",children:[w.map(q=>e(O,{children:[e("a",{href:q.url,rel:"noopener noreferrer",class:"account-avatar-stack",onClick:re=>{re.preventDefault(),A.showAccount=q},children:e(ht,{url:q.avatarStatic,size:"xxl",alt:`${q.displayName} @${q.acct}`,squircle:q==null?void 0:q.bot},q.id)},q.id)," "]},q.id)),S>w.length&&e(ge,{to:i?`/${i}/s/${l.id}`:`/s/${l.id}`,class:"button small plain centered",children:["+",S-w.length,e(T,{icon:"chevron-right"})]})]}),(y==null?void 0:y.length)>1&&e("ul",{class:"notification-group-statuses",children:y.map(q=>e("li",{children:e(Vi,{class:`status-link status-type-${_}`,to:i?`/${i}/s/${q.id}`:`/s/${q.id}`,children:e(Ke,{status:q,size:"s",previewMode:!0,allowContextMenu:!0})})},q.id))}),l&&(!(y!=null&&y.length)||(y==null?void 0:y.length)<=1)&&e(Vi,{class:`status-link status-type-${_}`,to:i?`/${i}/s/${C}`:`/s/${C}`,onContextMenu:o?void 0:q=>{const re=q.target.querySelector(".status");if(re){if(q.metaKey)return;q.preventDefault(),re.dispatchEvent(new MouseEvent("contextmenu",{clientX:q.clientX,clientY:q.clientY}))}},children:s?e(Ke,{status:x,size:"s",readOnly:!0,allowContextMenu:!0}):e(Ke,{statusID:C,size:"s",readOnly:!0,allowContextMenu:!0})})]})]})}function Vi(n){const i=Oo();return e(ge,{...n,"data-read-more":he._({id:"8fZueG"}),ref:i})}const an=ct(Na,(n,i)=>{var s,o;return((s=n.notification)==null?void 0:s.id)===((o=i.notification)==null?void 0:o.id)});"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",n=>{const{type:i,id:s,accessToken:o}=(n==null?void 0:n.data)||{};i==="notification"&&(A.routeNotification={id:s,accessToken:o})});const Pa=ct(function(){const{_:i}=ue();if(!("serviceWorker"in navigator))return null;const s=Ve(A),{routeNotification:o}=s,{id:c,accessToken:r}=o||{},[u,l]=$(!1);yt(()=>{if(!c||!r)return;const{instance:a}=le(),{masto:m,instance:b}=le({accessToken:r}),g=a===b,p=r?bo(r):si();(async()=>{const f=await m.v1.notifications.$select(c).fetch();if(f&&p){const y=p.instanceURL,{type:v,status:w,account:S}=f,k=!!document.querySelector("#modal-container > *"),_=v==="follow"&&!!(S!=null&&S.id),x=!!(S!=null&&S.id),C=!!(w!=null&&w.id);_&&g?A.showAccount={account:S,instance:y}:k||!g||x&&C?l({id:c,account:p,notification:f,sameInstance:g}):C?location.hash=`/${a}/s/${w.id}`:_?location.hash=`/${a}/a/${S.id}`:location.hash="/notifications"}})()},[c,r]),yt(()=>{navigator!=null&&navigator.clearAppBadge&&navigator.clearAppBadge()},[]),jt(a=>{a&&(navigator!=null&&navigator.clearAppBadge)&&navigator.clearAppBadge()});const d=()=>{l(!1),A.routeNotification=null,/\/notifications\?id=/i.test(location.hash)&&(location.hash="/notifications")};if(u){const{id:a,account:m,notification:b,sameInstance:g}=u;return e(Ye,{onClick:p=>{p.target===p.currentTarget&&d()},children:e("div",{class:"sheet",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:d,children:e(T,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(h,{id:"5+87Pq"})})}),e("main",{children:[!g&&e("p",{children:e(h,{id:"k9N0Xk"})}),e("div",{class:"notification-peek",onClick:p=>{const{target:f}=p;(p.target.tagName==="BUTTON"||p.target.tagName==="A")&&d()},children:e(an,{instance:m.instanceURL,notification:b,isStatic:!0})}),e("div",{style:{textAlign:"end"},children:e(ge,{to:"/notifications",class:"button light",onClick:d,children:[e("span",{children:e(h,{id:"/WA/tl"})})," ",e(T,{icon:"arrow-right"})]})})]})]})})}return null}),Fs=vo((n,i)=>{const{_:s}=ue(),{instance:o}=le(),[c,r]=gt(),[u,l]=$(!1),[d,a]=$(c.get("q")||""),m=c.get("type"),b=j(null),g=j(null);return yo(i,()=>({setValue:p=>{a(p)},focus:()=>{g.current.focus()},select:()=>{g.current.select()},blur:()=>{g.current.blur()}})),e("form",{ref:b,class:"search-popover-container",onSubmit:p=>{var y;if(p.preventDefault(),/\/search/.test(location.hash))if(d){const v={q:d};m&&(v.type=m),r(v)}else r({});else d?location.hash=`/search?q=${encodeURIComponent(d)}${m?`&type=${m}`:""}`:location.hash="/search";(y=n==null?void 0:n.onSubmit)==null||y.call(n,p)},children:[e("input",{ref:g,value:d,name:"q",type:"search",placeholder:s({id:"A1taO8"}),dir:"auto",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",onSearch:p=>{p.target.value||r({})},onInput:p=>{a(p.target.value),l(!0)},onFocus:()=>{var p,f;l(!0),(f=(p=b.current)==null?void 0:p.querySelector(".search-popover-item"))==null||f.classList.add("focus")},onBlur:()=>{var p,f;setTimeout(()=>{l(!1)},100),(f=(p=b.current)==null?void 0:p.querySelector(".search-popover-item.focus"))==null||f.classList.remove("focus")},onKeyDown:p=>{var y;const{key:f}=p;switch(f){case"Escape":l(!1);break;case"Down":case"ArrowDown":if(p.preventDefault(),u){const v=b.current.querySelector(".search-popover-item.focus");if(v){let w=v.nextElementSibling;for(;w&&w.hidden;)w=w.nextElementSibling;w&&(w.classList.add("focus"),Array.from(w.parentElement.children).filter(k=>k!==w).forEach(k=>{k.classList.remove("focus")}))}else{const w=b.current.querySelector(".search-popover-item");w&&w.classList.add("focus")}}break;case"Up":case"ArrowUp":if(p.preventDefault(),u){const v=document.querySelector(".search-popover-item.focus");if(v){let w=v.previousElementSibling;for(;w&&w.hidden;)w=w.previousElementSibling;w&&(w.classList.add("focus"),Array.from(w.parentElement.children).filter(k=>k!==w).forEach(k=>{k.classList.remove("focus")}))}else{const w=document.querySelector(".search-popover-item:last-child");w&&w.classList.add("focus")}}break;case"Enter":if(u){const v=document.querySelector(".search-popover-item.focus");v&&(p.preventDefault(),v.click()),l(!1),(y=n==null?void 0:n.onSubmit)==null||y.call(n,p)}break}}}),e("div",{class:"search-popover",hidden:!u||!d,children:!!d&&[{label:e(h,{id:"48oDit",values:{query:d},components:{0:e("small",{class:"insignificant"})}}),to:`/search?q=${encodeURIComponent(d)}`,top:!m&&!/\s/.test(d),hidden:!!m},{label:e(h,{id:"o1mMWT",values:{query:d},components:{0:e("q",{})}}),to:`/search?q=${encodeURIComponent(d)}&type=statuses`,hidden:/^https?:/.test(d),top:/\s/.test(d),icon:"document",queryType:"statuses"},{label:e(h,{id:"YAZw8D",values:{0:d.replace(/^#/,"")},components:{0:e("mark",{})}}),to:`/${o}/t/${d.replace(/^#/,"")}`,hidden:/^@/.test(d)||/^https?:/.test(d)||/\s/.test(d),top:/^#/.test(d),type:"link",icon:"hashtag",queryType:"hashtags"},{label:e(h,{id:"gEoOUj",values:{query:d},components:{0:e("mark",{})}}),to:`/${d}`,hidden:!/^https?:/.test(d),top:/^https?:/.test(d),type:"link"},{label:e(h,{id:"cDoNQr",values:{query:d},components:{0:e("q",{})}}),to:`/search?q=${encodeURIComponent(d)}&type=accounts`,icon:"group",queryType:"accounts"}].sort((p,f)=>{if(m){if(p.queryType===m)return-1;if(f.queryType===m)return 1}return p.top&&!f.top?-1:!p.top&&f.top?1:0}).filter(({hidden:p})=>!p).map(({label:p,to:f,icon:y,type:v},w)=>e(ge,{to:f,class:`search-popover-item ${w===0?"focus":""}`,onClick:S=>{var k;(k=n==null?void 0:n.onSubmit)==null||k.call(n,S)},children:[e(T,{icon:y||(v==="link"?"arrow-right":"search"),class:"more-insignificant"}),e("span",{children:p})," "]}))})]})}),Oa=ct(function({onClose:i=()=>{}}){const[s,o]=$(!1),c=j(null);He(["Slash","/"],u=>{o(!0),setTimeout(()=>{var l,d,a,m;(d=(l=c.current)==null?void 0:l.focus)==null||d.call(l),(m=(a=c.current)==null?void 0:a.select)==null||m.call(a)},0)},{preventDefault:!0,ignoreEventWhen:u=>{const l=/\/search/.test(location.hash),d=!!document.querySelector("#modal-container > *");return l||d}});const r=()=>{o(!1),i()};return He("esc",u=>{var l,d;(d=(l=c.current)==null?void 0:l.blur)==null||d.call(l),r()},{enabled:s,enableOnFormTags:!0,preventDefault:!0}),e("div",{id:"search-command-container",hidden:!s,onClick:u=>{u.target===u.currentTarget&&r()},children:e(Fs,{ref:c,onSubmit:()=>{r()}})})});function za(){const{_:n}=ue(),{_:i}=ue(),{instance:s}=le(),o=Ve(A),{shortcuts:c,settings:r}=o;if(!c.length)return null;const u=r.shortcutsViewMode==="multi-column"||!r.shortcutsViewMode&&r.shortcutsColumnsMode;if(u)return null;const l=j(),d=j(!1),a=c.map((p,f)=>{const{type:y,...v}=p;if(!An[y])return null;let{id:w,path:S,title:k,subtitle:_,icon:x}=An[y];return typeof w=="function"&&(w=w(v,f)),typeof S=="function"&&(S=S({...v,instance:v.instance||s},f)),typeof k=="function"?k=k(v,f):k=i(k),typeof _=="function"?_=_(v,f):_=i(_),typeof x=="function"&&(x=x(v,f)),w==="lists"&&(d.current=!0),{id:w,path:S,title:k,subtitle:_,icon:x}}).filter(Boolean),m=hs();He(["1","2","3","4","5","6","7","8","9"],(p,f)=>{var v,w;const y=parseInt(f.keys[0],10)-1;if(y<a.length){const{path:S}=a[y];S&&(m(S),(w=(v=l.current)==null?void 0:v.closeMenu)==null||w.call(v))}},{enabled:!u});const[b,g]=$([]);return e("div",{id:"shortcuts",children:o.settings.shortcutsViewMode==="tab-menu-bar"?e("nav",{class:"tab-bar",onContextMenu:p=>{p.preventDefault(),A.showShortcutsSettings=!0},children:e("ul",{children:a.map(({id:p,path:f,title:y,subtitle:v,icon:w},S)=>e("li",{children:e(ge,{class:v?"has-subtitle":"",to:f,onClick:k=>{if(k.target.classList.contains("is-active")){k.preventDefault();const _=document.getElementById(`${p}-page`);if(_){_.scrollTop=0;const x=_.querySelector(".updates-button");x&&x.click()}}},children:[e(T,{icon:w,size:"xl",alt:y}),e("span",{children:[e(bn,{children:y}),v&&e(O,{children:[e("br",{}),e("small",{children:v})]})]})]})},`${S}-${p}-${y}-${v}-${f}`))})}):e(lt,{instanceRef:l,overflow:"auto",viewScroll:"close",menuClassName:"glass-menu shortcuts-menu",gap:8,position:"anchor",onMenuChange:p=>{p.open&&d.current&&rn().then(g)},menuButton:e("button",{type:"button",id:"shortcuts-button",class:"plain",onContextMenu:p=>{p.preventDefault(),A.showShortcutsSettings=!0},onTransitionStart:p=>{var f,y;try{const{target:v}=p;getComputedStyle(v).pointerEvents==="none"&&((y=(f=l.current)==null?void 0:f.closeMenu)==null||y.call(f))}catch{}},children:e(T,{icon:"shortcut",size:"xl",alt:n({id:"CTqTgr"})})}),children:a.map(({id:p,path:f,title:y,subtitle:v,icon:w},S)=>p==="lists"?e(Rn,{menuClassName:"glass-menu",overflow:"auto",gap:-8,label:e(O,{children:[e(T,{icon:w,size:"l"}),e("span",{class:"menu-grow",children:e(bn,{children:y})}),e(T,{icon:"chevron-right"})]}),children:[e(qe,{to:"/l",children:e("span",{children:e(h,{id:"BHWx+g"})})}),e(Ze,{}),b==null?void 0:b.map(k=>e(qe,{to:`/l/${k.id}`,children:e("span",{children:k.title})},k.id))]}):e(qe,{to:f,class:"glass-menu-item",children:[e(T,{icon:w,size:"l"})," ",e("span",{class:"menu-grow",children:[e("span",{children:e(bn,{children:y})}),v&&e(O,{children:[" ",e("small",{class:"more-insignificant",children:v})]})]}),e("span",{class:"menu-shortcut hide-until-focus-visible",children:S+1})]},`${S}-${p}-${y}-${v}-${f}`))})})}const Ua=ct(za);function Ba(n){var c;let i=[],s=[],o=0;for(let r=0;r<n.length;r++){const u=n[r];u.reblog&&!((c=u.account)!=null&&c.group)?(s.push(u),o++):(i.push(u),o<3&&(o=0))}if(n.length>10&&(s.length>n.length/4||o>=3)){const r=s.map(u=>u.id);if(s.length>n.length*3/4)i=[...i,{id:r,items:s,type:"boosts"}];else{const u=Math.floor(i.length/2);i=[...i.slice(0,u),{id:r,items:s,type:"boosts"},...i.slice(u)]}return i}else return n}function Ki(n,i){const s=we.account.get("boostedStatusIDs")||{},o=n.filter(r=>{if(!r.reblog)return!0;const u=`${i}-${r.reblog.id}`,l=s[u];return l&&l!==r.id?!1:(s[u]=r.id,!0)}),c=Object.keys(s);return c.length>50&&c.slice(0,c.length-50).forEach(r=>{delete s[r]}),we.account.set("boostedStatusIDs",s),o}function Fa(n,i){const s=[];let o=0;n.forEach(l=>{for(let a=0;a<s.length;a++){if(s[a].find(m=>m.id===l.id))return;if(s[a].find(m=>m.id===l.inReplyToId)||s[a].find(m=>m.inReplyToId===l.id)){s[a].push(l);return}}const d=n.find(a=>a.id===l.inReplyToId);d&&(s[o++]=[l,d])});for(let l=0;l<s.length;l++)for(let d=l+1;d<s.length;d++)s[l].find(m=>s[d].includes(m))&&(s[l]=[...s[l],...s[d]],s[l]=s[l].filter((m,b,g)=>g.findIndex(p=>p.id===m.id)===b),s.splice(d,1),d--);s.forEach(l=>{l.sort((d,a)=>!d.inReplyToId&&!a.inReplyToId?new Date(d.createdAt)-new Date(a.createdAt):d.inReplyToId===a.id?1:a.inReplyToId===d.id||!d.inReplyToId?-1:a.inReplyToId?new Date(d.createdAt)-new Date(a.createdAt):1)}),s.forEach(l=>{const d=l[0].account.id;l.forEach(a=>{a.account.id!==d&&(a._differentAuthor=!0)})}),s.length;const c=[],r=[],u=[];return n.forEach(l=>{if(l.reblog){c.push(l);return}for(let d=0;d<s.length;d++)if(s[d].find(a=>a.id===l.id)){if(r.includes(d))return;const a=s[d];a.sort((b,g)=>{const p=new Date(b.createdAt),f=new Date(g.createdAt);return p-f});const m=a[0].account.id;c.push({id:a.map(b=>b.id),items:a,type:a.every(b=>b.account.id===m)?"thread":"conversation"}),r.push(d);return}if(l.inReplyToId&&l.inReplyToAccountId!==l.account.id){const d=ot(l.id,i);A.statusReply[d]||u.push({sKey:d,inReplyToId:l.inReplyToId})}c.push(l)}),u!=null&&u.length&&queueMicrotask(()=>{const{masto:l}=le({instance:i});async function d(){for(let a=0;a<u.length;a++){const{sKey:m,inReplyToId:b}=u[a];try{const g=await Ha(b,l);Je(g,i,{skipThreading:!0}),A.statusReply[m]={id:g.id,instance:i},await new Promise(p=>setTimeout(p,1e3))}catch{}}}if(Qe("@mastodon/fetch-multiple-statuses")){const a=u.map(({inReplyToId:m})=>m);(async()=>{var m;try{const b=await l.v1.statuses.list({id:a});if(b!=null&&b.length)for(const g of b){Je(g,i,{skipThreading:!0});const p=(m=u.find(({inReplyToId:f})=>f===g.id))==null?void 0:m.sKey;p&&(A.statusReply[p]={id:g.id,instance:i})}else d()}catch{d()}})()}else d()}),c}const Ha=Ct((n,i)=>i.v1.statuses.$select(n).fetch());async function Hs(n,i){const s=await Ia();if(!s.length)return;const{statusFollowedTags:o}=A,c=[];if(n.forEach(r=>{var g;if(r.reblog)return;const{id:u,content:l,tags:d=[]}=r,a=ot(u,i);if((g=o[a])!=null&&g.length)return;const m=Ta(l);if(!m.length&&!d.length)return;const b=s.reduce((p,f)=>((m.some(y=>y.toLowerCase()===f.name.toLowerCase())||d.some(y=>y.name.toLowerCase()===f.name.toLowerCase()))&&p.push(f.name),p),[]);b.length&&c.push({item:r,sKey:a,followedTags:b})}),c.length){const r=c.map(l=>l.item.account),u=await ri(r);if(!u)return;c.forEach(l=>{const{item:d,sKey:a,followedTags:m}=l,b=u[d.account.id];b&&!b.following&&(o[a]=m)})}}function qa(){A.statusFollowedTags={}}function Ya({scrollableRef:n,distanceFromStart:i=1,distanceFromEnd:s=1,scrollThresholdStart:o=10,scrollThresholdEnd:c=10,direction:r="vertical",distanceFromStartPx:u,distanceFromEndPx:l}={}){const[d,a]=$(null),[m,b]=$(!1),[g,p]=$(!1),[f,y]=$(!1),[v,w]=$(!1),S=r==="vertical";return yt(()=>{const k=n.current;if(!k)return{};let _=S?k.scrollTop:k.scrollLeft;function x(){const{scrollTop:C,scrollLeft:I,scrollHeight:E,scrollWidth:L,clientHeight:z,clientWidth:D}=k,oe=S?C:I,ee=S?E:L,W=S?z:D,Z=Math.abs(oe-_),B=u||Math.min(W*i,ee,oe),Y=l||Math.min(W*s,ee,ee-oe-W);Z>=(_<oe?c:o)&&(a(_<oe?"end":"start"),_=oe),b(oe<=0),p(oe+W>=ee),y(oe<=B),w(oe+W>=ee-Y)}return k.addEventListener("scroll",x,{passive:!0}),()=>k.removeEventListener("scroll",x)},[i,s,o,c]),{scrollDirection:d,reachStart:m,reachEnd:g,nearReachStart:f,nearReachEnd:v,init:()=>{n.current&&n.current.dispatchEvent(new Event("scroll"))}}}function ja({scrollableRef:n,distanceFromStart:i=1,distanceFromEnd:s=1,scrollThresholdStart:o=10,scrollThresholdEnd:c=10,direction:r="vertical",distanceFromStartPx:u,distanceFromEndPx:l,init:d}={},a,m){if(!a)return;const b=r==="vertical",g=j(null),p=j(null),f=zo(()=>{let y=!1,v=!1,w=!1,S=!1;const k=n.current,{scrollTop:_,scrollLeft:x,scrollHeight:C,scrollWidth:I,clientHeight:E,clientWidth:L}=k,z=b?_:x,D=b?C:I,oe=b?E:L,ee=Math.abs(z-g.current),W=u||Math.min(oe*i,D,z),Z=l||Math.min(oe*s,D,D-z-oe);ee>=(g.current<z?c:o)&&(p.current=g.current<z?"end":"start",g.current=z),y=z<=0,v=z+oe>=D,w=z<=W,S=z+oe>=D-Z,a({scrollDirection:p.current,reachStart:y,reachEnd:v,nearReachStart:w,nearReachEnd:S})},500);yt(()=>{const y=n.current;return y?(g.current=y[b?"scrollTop":"scrollLeft"],y.addEventListener("scroll",f,{passive:!0}),()=>y.removeEventListener("scroll",f)):{}},[i,s,o,c,...m]),ne(()=>{d&&n.current&&queueMicrotask(()=>{n.current.dispatchEvent(new Event("scroll"))})},[d])}function Va({class:n,statusID:i,status:s,instance:o,parent:c,onMediaClick:r}){const{_:u}=ue();let l=ot(i,o);const d=Ve(A);if(s||(s=d.statuses[l]||d.statuses[i],l=ot(s==null?void 0:s.id,o)),!s)return null;const{account:{acct:a,avatar:m,avatarStatic:b,id:g,url:p,displayName:f,username:y,emojis:v,bot:w,group:S},id:k,repliesCount:_,reblogged:x,reblogsCount:C,favourited:I,favouritesCount:E,bookmarked:L,poll:z,muted:D,sensitive:oe,spoilerText:ee,visibility:W,language:Z,editedAt:B,filtered:Y,card:ce,createdAt:M,inReplyToId:H,inReplyToAccountId:U,content:K,mentions:pe,mediaAttachments:J,reblog:ye,uri:_e,url:q,emojis:re,_deleted:Ae,_pinned:De}=s;if(!(J!=null&&J.length))return null;const Ne=Se=>{Se.shiftKey},Pe=Te(()=>St(),[]),Ue=Te(()=>Pe&&Pe===g,[g,Pe]),Ce=wo(ws),Q=!Ue&&Yt(Y,Ce);if((Q==null?void 0:Q.action)==="hide")return null;const ke=oe,fe=Te(()=>{var P;return((P=(we.account.get("preferences")||{})["reading:expand:media"])==null?void 0:P.toLowerCase())||"default"},[])==="show_all",X=c||"div";return J.map((Se,P)=>{const te=`${l}-${Se.id}`,de=Q==null?void 0:Q.titlesStr;return e(X,{"data-state-post-id":l,onMouseEnter:Ne,"data-spoiler-text":ee||(oe?u({id:"FKojeB"}):void 0),"data-filtered-text":Q?u(de?{id:"7FGvtQ",values:{filterTitleStr:de}}:{id:"03Qqf9"}):void 0,class:`
|
||
media-post
|
||
${Q?"filtered":""}
|
||
${ke?"has-spoiler":""}
|
||
${fe?"show-media":""}
|
||
`,children:e(vs,{class:n,media:Se,lang:Z,to:`/${o}/s/${k}?media-only=${P+1}`,onClick:r?N=>r(N,P,Se,s):void 0})},te)})}const Gi=ct(Va);function Ka(n){var k,_,x,C,I;const{_:i}=ue(),s=Ve(A),{masto:o,instance:c,authenticated:r}=le(),[u,l]=Te(()=>{const E=we.local.getJSON("accounts")||[];return[E.find(z=>z.info.id===St())||E[0],E.length>1]},[]),d=(s.settings.shortcutsViewMode==="multi-column"||!s.settings.shortcutsViewMode&&s.settings.shortcutsColumnsMode)&&!s.shortcuts.find(E=>E.type==="following"),a=Uo(()=>{A.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),m=j(),[b,g]=$(void 0),p=Bo([0,0,s.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),f=j();async function y(E){return(E||!f.current)&&(f.current=o.v1.mutes.list({limit:80})),await f.current.next()}const v=j();async function w(E){return(E||!v.current)&&(v.current=o.v1.blocks.list({limit:80})),await v.current.next()}const S=j();return e(O,{children:[e("button",{ref:m,type:"button",class:`button plain nav-menu-button ${l?"with-avatar":""} ${b==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{S.current=Date.now(),g(E=>E?void 0:"open")},onContextMenu:E=>{E.preventDefault(),A.showAccounts=!0},...a(),children:[l&&e(ht,{url:((k=u==null?void 0:u.info)==null?void 0:k.avatar)||((_=u==null?void 0:u.info)==null?void 0:_.avatarStatic),size:"l",squircle:(x=u==null?void 0:u.info)==null?void 0:x.bot}),e(T,{icon:"menu",size:l?"s":"l",alt:i({id:"zucql+"})})]}),e(ks,{menuClassName:"nav-menu",state:b,anchorRef:m,onClose:()=>{g(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-S.current<300}},portal:{target:document.body},...n,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:p,unmountOnClose:!0,children:[!!((C=s.appVersion)!=null&&C.commitHash)&&s.appVersion.commitHash!=="119d4b0"&&e("div",{class:"top-menu",children:[e(Ie,{onClick:()=>{confirm(i({id:"Djbaby"}))&&(async()=>{try{location.reload()}catch{}})()},children:[e(T,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:e(h,{id:"95IFnD"})})]}),e(Ze,{})]}),e("section",{children:[e(qe,{to:"/",children:[e(T,{icon:"home",size:"l"})," ",e("span",{children:e(h,{id:"i0qMbr"})})]}),r?e(O,{children:[d&&e(qe,{to:"/following",children:[e(T,{icon:"following",size:"l"})," ",e("span",{children:e(h,{id:"following.title"})})]}),e(qe,{to:"/catchup",children:[e(T,{icon:"history2",size:"l"}),e("span",{children:e(h,{id:"xrl8fj"})})]}),Qe("@mastodon/mentions")&&e(qe,{to:"/mentions",children:[e(T,{icon:"at",size:"l"})," ",e("span",{children:e(h,{id:"/bZzdR"})})]}),e(qe,{to:"/notifications",children:[e(T,{icon:"notification",size:"l"})," ",e("span",{children:e(h,{id:"iDNBZe"})}),s.notificationsShowNew&&e("sup",{title:i({id:"isRobC"}),style:{opacity:.5},children:[" ","•"]})]}),e(Ze,{}),((I=u==null?void 0:u.info)==null?void 0:I.id)&&e(qe,{to:`/${c}/a/${u.info.id}`,children:[e(T,{icon:"user",size:"l"})," ",e("span",{children:e(h,{id:"vERlcd"})})]}),e(Ga,{menuState:b}),e(qe,{to:"/b",children:[e(T,{icon:"bookmark",size:"l"})," ",e("span",{children:e(h,{id:"7Ff7ia"})})]}),e(Rn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(O,{children:[e(T,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:e(h,{id:"24misb"})}),e(T,{icon:"chevron-right"})]}),children:[e(qe,{to:"/f",children:[e(T,{icon:"heart",size:"l"})," ",e("span",{children:e(h,{id:"zZOZj7"})})]}),e(qe,{to:"/fh",children:[e(T,{icon:"hashtag",size:"l"})," ",e("span",{children:e(h,{id:"Xi1/bw"})})]}),e(Ze,{}),Qe("@mastodon/filters")&&e(qe,{to:"/ft",children:[e(T,{icon:"filters",size:"l"})," ",e("span",{children:e(h,{id:"cSev+j"})})]}),e(Ie,{onClick:()=>{A.showGenericAccounts={id:"mute",heading:i({id:"sOKhEA"}),fetchAccounts:y,excludeRelationshipAttrs:["muting"]}},children:[e(T,{icon:"mute",size:"l"})," ",e("span",{children:e(h,{id:"n1sANU"})})]}),e(Ie,{onClick:()=>{A.showGenericAccounts={id:"block",heading:i({id:"nL8nlr"}),fetchAccounts:w,excludeRelationshipAttrs:["blocking"]}},children:[e(T,{icon:"block",size:"l"})," ",e("span",{children:e(h,{id:"r3RRWo"})})]})," "]}),e(Ze,{}),e(Ie,{onClick:()=>{A.showAccounts=!0},children:[e(T,{icon:"group",size:"l"})," ",e("span",{children:e(h,{id:"7e0O8Z"})})]})]}):e(O,{children:[e(Ze,{}),e(qe,{to:"/login",children:[e(T,{icon:"user",size:"l"})," ",e("span",{children:e(h,{id:"sQia9P"})})]})]})]}),e("section",{children:[e(Ze,{}),e(qe,{to:"/search",children:[e(T,{icon:"search",size:"l"})," ",e("span",{children:e(h,{id:"A1taO8"})})]}),e(qe,{to:`/${c}/trending`,children:[e(T,{icon:"chart",size:"l"})," ",e("span",{children:e(h,{id:"4/iCqx"})})]}),e(qe,{to:`/${c}/p/l`,children:[e(T,{icon:"building",size:"l"})," ",e("span",{children:e(h,{id:"d5zxa4"})})]}),e(qe,{to:`/${c}/p`,children:[e(T,{icon:"earth",size:"l"})," ",e("span",{children:e(h,{id:"4ERYY7"})})]}),r?e(O,{children:[e(Ze,{className:"divider-grow"}),e(Ie,{onClick:()=>{A.showKeyboardShortcutsHelp=!0},children:[e(T,{icon:"keyboard",size:"l"})," ",e("span",{children:e(h,{id:"77Emn0"})})]}),e(Ie,{onClick:()=>{A.showShortcutsSettings=!0},children:[e(T,{icon:"shortcut",size:"l"})," ",e("span",{children:e(h,{id:"8Kudkr"})})]}),e(Ie,{onClick:()=>{A.showSettings=!0},children:[e(T,{icon:"gear",size:"l"})," ",e("span",{children:e(h,{id:"uVbUP8"})})]})]}):e(O,{children:[e(Ze,{}),e(Ie,{onClick:()=>{A.showSettings=!0},children:[e(T,{icon:"gear",size:"l"})," ",e("span",{children:e(h,{id:"uVbUP8"})})]})]})]})]})]})}function Ga({menuState:n}){const i=Qe("@mastodon/lists"),[s,o]=$([]);return ne(()=>{i&&n==="open"&&rn().then(o)},[n,i]),s.length>0?e(Rn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(O,{children:[e(T,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:e(h,{id:"h16FyT"})}),e(T,{icon:"chevron-right"})]}),children:[e(qe,{to:"/l",children:e("span",{children:e(h,{id:"BHWx+g"})})}),(s==null?void 0:s.length)>0&&e(O,{children:[e(Ze,{}),s.map(c=>e(qe,{to:`/l/${c.id}`,children:e("span",{children:c.title})},c.id))]})]}):i&&e(qe,{to:"/l",children:[e(T,{icon:"list",size:"l"}),e("span",{children:e(h,{id:"h16FyT"})})]})}const zt=ct(Ka),dn={block:"nearest",inline:"center",behavior:"smooth"};function It({title:n,titleComponent:i,id:s,instance:o,emptyText:c,errorText:r,useItemID:u,boostsCarousel:l,fetchItems:d=()=>{},checkForUpdates:a=()=>{},checkForUpdatesInterval:m=15e3,headerStart:b,headerEnd:g,timelineStart:p,refresh:f,view:y,filterContext:v,showFollowedTags:w,showReplyParent:S,clearWhenRefresh:k}){const{_}=ue(),x=Ve(A),[C,I]=$([]),[E,L]=$("start"),[z,D]=$(!1),[oe,ee]=$(!1),[W,Z]=$(!0),B=j();__BENCHMARK.start(`timeline-${s}-load`);const Y=Te(()=>oi(),[]),ce=y!=="media",M=j(0),H=Fo(Q=>{ee(!1),L("loading"),(async()=>{try{const ke=M.current=Date.now();let{done:Le,value:fe}=await d(Q);if(ke!==M.current)return;if(Array.isArray(fe)){const[X,Se]=fe.reduce((P,te)=>(te._pinned?P[0].push(te):P[1].push(te),P),[[],[]]);fe=Se,ce&&(l&&(fe=Ba(fe)),fe=Fa(fe,o)),X.length&&(fe=X.concat(fe)),I(Q?fe:P=>[...P,...fe]),fe.length||(Le=!0),D(!Le)}else D(!1);L("default"),__BENCHMARK.end(`timeline-${s}-load`)}catch{L("error"),Q&&!C.length&&r&&me(r)}finally{H.cancel()}})()},1e3,{leading:!0}),U=".timeline-item, .timeline-item-alt",K=He("j, shift+j",(Q,ke)=>{const Le=document.activeElement.closest(U),fe=Le==null?void 0:Le.getBoundingClientRect(),X=Array.from(B.current.querySelectorAll(U));if(Le&&fe.top<B.current.clientHeight&&fe.bottom>0){const Se=X.indexOf(Le);let P=X[Se+1];ke.shift&&(P=X.find((te,de)=>de>Se&&!te.classList.contains("timeline-item-alt"))),P&&(P.focus(),P.scrollIntoView(dn))}else{const Se=X.find(P=>{const te=P.getBoundingClientRect();return te.top>=44&&te.left>=0});Se&&(Se.focus(),Se.scrollIntoView(dn))}}),pe=He("k, shift+k",(Q,ke)=>{const Le=document.activeElement.closest(U),fe=Le==null?void 0:Le.getBoundingClientRect(),X=Array.from(B.current.querySelectorAll(U));if(Le&&fe.top<B.current.clientHeight&&fe.bottom>0){const Se=X.indexOf(Le);let P=X[Se-1];ke.shift&&(P=X.findLast((te,de)=>de<Se&&!te.classList.contains("timeline-item-alt"))),P&&(P.focus(),P.scrollIntoView(dn))}else{const Se=X.find(P=>{const te=P.getBoundingClientRect();return te.top>=44&&te.left>=0});Se&&(Se.focus(),Se.scrollIntoView(dn))}}),J=He(["enter","o"],()=>{const Q=document.activeElement;Q!=null&&Q.matches(U)&&Q.click()}),ye=C.length>0&&E!=="loading"&&oe,_e=rt(()=>{var Q;ye&&H(!0),(Q=B.current)==null||Q.scrollTo({top:0,behavior:"smooth"})},[H,ye]),q=He(".",_e),re=j(),[Ae,De]=$(!1);ja({scrollableRef:B,distanceFromEnd:2,scrollThresholdStart:44},({scrollDirection:Q,nearReachStart:ke,reachStart:Le})=>{if(re.current){const fe=Q==="end"&&!ke;re.current.hidden=fe}De(ke),Le&&H(!0)},[]),ne(()=>{var Q;(Q=B.current)==null||Q.scrollTo({top:0}),H(!0)},[]);const Ne=j(!0);ne(()=>{var Q;if(Ne.current){Ne.current=!1;return}k&&(C!=null&&C.length)&&((Q=H.cancel)==null||Q.call(H),I([])),H(!0)},[k,f]);const Pe=j(y);ne(()=>{Pe.current!==y&&(Pe.current=y,I([]))},[y]);const Ue=rt(async({disableIdleCheck:Q=!1}={})=>{const ke=B.current?getComputedStyle(B.current).pointerEvents==="none":!1;x.settings.autoRefresh&&B.current.scrollTop<16&&(Q||window.__IDLE__)&&!Ja()&&!ke?H(!0):await a()&&ee(!0)},[s,H,a,x.settings.autoRefresh]),Ce=j();return jt(Q=>{if(Q){const ke=Date.now()-Ce.current;(!Ce.current||ke>1e3*3)&&Ue({disableIdleCheck:!0})}else Ce.current=Date.now();Z(Q)},[a,Ue,x.settings.autoRefresh]),ai(Ue,W&&!oe?m*(Ae?1:2):null),e(ws.Provider,{value:v,children:e("div",{id:`${s}-page`,class:`deck-container ${Y?"deck-container-media-first":""}`,ref:Q=>{B.current=Q,K(Q),pe(Q),J(Q),q(Q)},tabIndex:"-1",onClick:Q=>{re.current&&Q.target.closest(".timeline-item, .timeline-item-alt")&&setTimeout(()=>{re.current.hidden=!1},250)},children:e("div",{class:"timeline-deck deck",children:[e("header",{ref:re,onClick:Q=>{var ke;Q.target.closest("a, button")||(ke=B.current)==null||ke.scrollTo({top:0,behavior:"smooth"})},onDblClick:Q=>{Q.target.closest("a, button")||H(!0)},class:E==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(zt,{}),b??e(ge,{to:"/",class:"button plain home-button",children:e(T,{icon:"home",size:"l",alt:_({id:"i0qMbr"})})})]}),n&&(i||e("h1",{children:n})),e("div",{class:"header-side",children:!!g&&g})]}),ye&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:_e,children:[e(T,{icon:"arrow-up"})," ",e(h,{id:"2yr1/p"})]})]}),!!p&&e("div",{class:`timeline-start ${E==="loading"?"loading":""}`,children:p}),C.length?e(O,{children:[e("ul",{class:`timeline ${y?`timeline-${y}`:""}`,children:[C.map(Q=>e(Wa,{status:Q,instance:o,useItemID:u,filterContext:v,view:y,showFollowedTags:w,showReplyParent:S,mediaFirst:Y},Q.id+(Q==null?void 0:Q._pinned)+y)),z&&E==="loading"&&(y==="media"?null:e(O,{children:[e("li",{style:{height:"20vh"},children:e(Ke,{skeleton:!0,mediaFirst:Y})}),e("li",{style:{height:"25vh"},children:e(Ke,{skeleton:!0,mediaFirst:Y})})]}))]}),E==="default"&&(z?e(_t,{root:B.current,rootMargin:`0px 0px ${screen.height*1.5}px 0px`,onChange:Q=>{Q&&H()},children:e("button",{type:"button",class:"plain block",onClick:()=>H(),style:{marginBlockEnd:"6em"},children:e(h,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(h,{id:"2EYeAZ"})}))]}):E==="loading"?e("ul",{class:"timeline",children:Array.from({length:5}).map((Q,ke)=>y==="media"?e("div",{style:{height:"50vh"}}):e("li",{children:e(Ke,{skeleton:!0,mediaFirst:Y})},ke))}):E!=="error"&&E!=="start"&&e("p",{class:"ui-state",children:c}),E==="error"&&e("p",{class:"ui-state",children:[r,e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>H(!C.length),children:e(h,{id:"KDw4GX"})})]})]})})})}const Wa=ct(({status:n,instance:i,useItemID:s,filterContext:o,view:c,showFollowedTags:r,showReplyParent:u,mediaFirst:l})=>{const{_:d}=ue(),{id:a,reblog:m,items:b,type:g,_pinned:p}=n;p&&(s=!1);const f=(m==null?void 0:m.id)||a,y=i?`/${i}/s/${f}`:`/s/${f}`;if(b){let w=Mt(b,o),S="";if(g==="boosts"?S=he._({id:"NuqppG",values:{0:w.length}}):g==="pinned"&&(S=d({id:"GlfmCu"})),g==="boosts"||g==="pinned"){const x=new Set;if(w.sort((C,I)=>{const E=Yt(C.filtered,o),L=Yt(I.filtered,o);return E&&x.add(C.id),L&&x.add(I.id),E&&!L?1:!E&&L?-1:0}),x.size>=2){const I=[],E=[];w.forEach(z=>{x.has(z.id)?E.push(z):I.push(z)});const L=[];for(let z=0;z<E.length;z+=5)L.push({_grouped:!0,posts:E.slice(z,z+5)});w=I.concat(L)}return e("li",{class:"timeline-item-carousel",children:e(Za,{title:S,class:`${g}-carousel`,children:w.map(C=>{const{id:I,reblog:E,_pinned:L,_grouped:z}=C;if(z)return e("li",{class:"timeline-item-carousel-group",children:C.posts.map(ee=>{const{id:W,reblog:Z,_pinned:B}=ee,Y=(Z==null?void 0:Z.id)||W,ce=i?`/${i}/s/${Y}`:`/s/${Y}`;return B&&(s=!1),e(ge,{class:"status-carousel-link timeline-item-alt",to:ce,children:s?e(Ke,{statusID:W,instance:i,size:"s"}):e(Ke,{status:ee,instance:i,size:"s"})})})},I);const D=(E==null?void 0:E.id)||I,oe=i?`/${i}/s/${D}`:`/s/${D}`;return L&&(s=!1),e("li",{children:e(ge,{class:"status-carousel-link timeline-item-alt",to:oe,children:s?e(Ke,{statusID:I,instance:i,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:l}):e(Ke,{status:C,instance:i,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:l})})},I)})})},`timeline-${a}`)}const _=w.length>3;return w.map((x,C)=>{const{id:I,_differentAuthor:E}=x,L=i?`/${i}/s/${I}`:`/s/${I}`,z=C>0&&C<w.length-1,D=x.sensitive&&!!x.spoilerText,oe=!E&&D&&C>0||_&&z&&(g==="thread"||g==="conversation"&&!E&&!w[C-1]._differentAuthor&&!w[C+1]._differentAuthor),ee=C===0,W=C===w.length-1;return e("li",{class:`timeline-item-container timeline-item-container-type-${g} timeline-item-container-${ee?"start":W?"end":"middle"} ${E?"timeline-item-diff-author":""}`,children:e(ge,{class:"status-link timeline-item",to:L,children:oe?e(Xa,{status:x,instance:i,filterContext:o}):s?e(Ke,{statusID:I,instance:i,enableCommentHint:W,showFollowedTags:r}):e(Ke,{status:x,instance:i,enableCommentHint:W,showFollowedTags:r})})},`timeline-${I}`)})}const v=`timeline-${a+p}`;return c==="media"?s?e(Gi,{class:"timeline-item",parent:"li",statusID:a,instance:i},v):e(Gi,{class:"timeline-item",parent:"li",status:n,instance:i},v):e("li",{children:e(ge,{class:"status-link timeline-item",to:y,children:s?e(Ke,{statusID:a,instance:i,enableCommentHint:!0,showFollowedTags:r,showReplyParent:u,mediaFirst:l}):e(Ke,{status:n,instance:i,enableCommentHint:!0,showFollowedTags:r,showReplyParent:u,mediaFirst:l})})},v)},(n,i)=>{var c,r;const s=(((c=n.status)==null?void 0:c.id)||"").toString(),o=(((r=i.status)==null?void 0:r.id)||"").toString();return s===o&&n.instance===i.instance&&n.view===i.view});function Za({title:n,class:i,children:s}){const{_:o}=ue(),c=j(),r=j(),u=j(),[l,d]=$(!1);return ne(()=>{setTimeout(()=>{d(!0)},1)},[]),e("div",{class:`status-carousel ${i}`,children:[e("header",{children:[e("h3",{children:n}),e("span",{children:[e("button",{ref:r,type:"button",class:"small plain2",onClick:()=>{var m,b;const a=Math.min(320,(m=c.current)==null?void 0:m.offsetWidth)*($t()?1:-1);(b=c.current)==null||b.scrollBy({left:a,behavior:"smooth"})},children:e(T,{icon:"chevron-left",alt:o({id:"DHhJ7s"})})})," ",e("button",{ref:u,type:"button",class:"small plain2",onClick:()=>{var m,b;const a=Math.min(320,(m=c.current)==null?void 0:m.offsetWidth)*($t()?-1:1);(b=c.current)==null||b.scrollBy({left:a,behavior:"smooth"})},children:e(T,{icon:"chevron-right",alt:o({id:"hXzOVo"})})})]})]}),e("ul",{ref:c,children:[e(_t,{class:"status-carousel-beacon",onChange:a=>{r.current&&(r.current.disabled=a)}}),s[0],l&&s.slice(1),e(_t,{class:"status-carousel-beacon",onChange:a=>{u.current&&(u.current.disabled=a)}})]})]})}function Xa({status:n,instance:i,filterContext:s}){const{_:o}=ue(),c=Ve(A),{id:r,visibility:u,language:l}=n,d=di(n),a=ot(r,i),m=Yt(n.filtered,s);return e("article",{class:`status compact-thread ${u==="direct"?"visibility-direct":""}`,tabindex:"-1",children:[c.statusThreadNumber[a]?e("div",{class:"status-thread-badge",children:[e(T,{icon:"thread",size:"s",alt:o({id:"e66y2Z"})}),c.statusThreadNumber[a]?` ${c.statusThreadNumber[a]}/X`:""]}):e("div",{class:"status-thread-badge",children:e(T,{icon:"thread",size:"s",alt:o({id:"e66y2Z"})})}),e("div",{class:"content-compact",title:d,lang:l,dir:"auto",children:m?e("b",{class:"status-filtered-badge badge-meta horizontal",title:(m==null?void 0:m.titlesStr)||"",children:m!=null&&m.titlesStr?e(h,{id:"sr6maL",values:{0:m.titlesStr},components:{0:e("span",{}),1:e("span",{})}}):e("span",{children:e(h,{id:"03Qqf9"})})}):e(O,{children:[d,n.sensitive&&n.spoilerText&&e(O,{children:[" ",e("span",{class:"spoiler-badge",children:e(T,{icon:"eye-close",size:"s",alt:o({id:"gnKo7f"})})})]})]})})]})}function Ja(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}const Ht=20,Si=1983,Wi=`${Si}-01`,Qa=(()=>{try{const n=document.createElement("input");return n.setAttribute("type","month"),n.type==="month"}catch{return!1}})();async function er(n){var o;const{masto:i}=le({instance:n}),s=await i.v2.search.fetch({q:"from:me",type:"statuses",limit:1});return!!((o=s==null?void 0:s.statuses)!=null&&o.length)}const tr=Ct(er);function nr(){const{i18n:n,_:i}=ue(),s=Ve(A),{id:o,...c}=Et(),[r,u]=gt(),l=r.get("month"),d=!r.get("replies"),a=!!r.get("boosts"),m=r.get("tagged"),b=!!r.get("media"),{masto:g,instance:p,authenticated:f}=le({instance:c.instance}),{masto:y,instance:v}=le(),w=j(),S=[l,d,a,m,b],[k,_]=$(),x=j(0);ne(()=>{x.current=0},S);const C=Te(()=>oi(),[]),I=Te(()=>p===v,[p,v]),[E,L]=$(!1);ne(()=>{I&&k!=null&&k.acct&&(async()=>{const J=await tr(p);L(J)})()},[p,I,k==null?void 0:k.acct]);async function z(J){var De,Ne,Pe,Ue;const ye=/^\d{4}-[01]\d$/.test(l),_e=((Ne=(De=l==null?void 0:l.split)==null?void 0:De.call(l,"-"))==null?void 0:Ne[0])>=Si;if(ye&&_e){if(!k)return{value:[],done:!0};const[Ce,Q]=l.split("-"),ke=parseInt(Q,10)-1,Le=new Date(Ce,ke,0),fe=`${Le.getFullYear()}-${(Le.getMonth()+1).toString().padStart(2,"0")}-${Le.getDate().toString().padStart(2,"0")}`,X=new Date(Ce,ke+1,1),Se=`${X.getFullYear()}-${(X.getMonth()+1).toString().padStart(2,"0")}-${X.getDate().toString().padStart(2,"0")}`;let P;J?(P=Ht+1,x.current=0):(P=Ht+x.current+1,x.current+=Ht);const te=await g.v2.search.fetch({q:`from:${k.acct} after:${fe} before:${Se}`,type:"statuses",limit:P,offset:x.current});if((Pe=te==null?void 0:te.statuses)!=null&&Pe.length){const de=te.statuses.slice(0,Ht);de.forEach(ae=>{Je(ae,p)});const N=te.statuses.length<=Ht;return{value:de,done:N}}else return{value:[],done:!0}}let q=[];if(J){const{value:Ce}=await g.v1.accounts.$select(o).statuses.list({pinned:!0}).next();if(Ce!=null&&Ce.length&&!m&&!b){const Q=Ce.map(ke=>(Je(ke,p),{...ke,_pinned:!0}));if(Q.length>=3){const ke=Q.map(Le=>Le.id);q.push({id:ke,items:Q,type:"pinned"})}else q.push(...Q)}}(J||!w.current)&&(w.current=g.v1.accounts.$select(o).statuses.list({limit:Ht,exclude_replies:d,exclude_reblogs:a,only_media:b||void 0,tagged:m}));const{value:re,done:Ae}=await w.current.next();if(re!=null&&re.length){if(q.length){let Ce=[];((Ue=q[0])==null?void 0:Ue.type)==="pinned"?Ce=q[0].id:Ce=q.filter(ke=>ke._pinned).map(ke=>ke.id),Ce.every(ke=>re.some(Le=>Le.id===ke))&&(q=[])}q.push(...re),re.forEach(Ce=>{Je(Ce,p)})}return{value:q,done:Ae}}const[D,oe]=$([]);let ee=i({id:"/cKnpj"});if(k!=null&&k.acct){const J=(/@/.test(k.acct)?"":"@")+k.acct,ye=k!=null&&k.displayName?`${k.displayName} (${J})`:`${J}`;if(!d)ee=i({id:"hS1Opy",values:{accountDisplay:ye}});else if(a)ee=i({id:"A/CX5F",values:{accountDisplay:ye}});else if(m)ee=i({id:"QQrO94",values:{accountDisplay:ye,tagged:m}});else if(b)ee=i({id:"NoG5wD",values:{accountDisplay:ye}});else if(l){const _e=new Date(l).toLocaleString(n.locale,{month:"long",year:"numeric"});ee=i({id:"8GjLvB",values:{accountDisplay:ye,monthYear:_e}})}else ee=ye}et(ee,"/:instance?/a/:id");const W=j(),Z=rt(()=>{const J=W.current||g.v1.accounts.$select(o).fetch();return W.current=J,J},[o,g]);ne(()=>{(async()=>{try{const J=await Z();_(J)}catch{}if(!C)try{const J=await g.v1.accounts.$select(o).featuredTags.list();oe(J)}catch{}})()},[o,C]);const{displayName:B,acct:Y,emojis:ce}=k||{},M=j(),H=Te(()=>{const J=!d||a||m||b||!!l,ye=s.accounts[`${o}@${p}`];return e(O,{children:[e(Ps,{instance:p,account:ye||o,fetchAccount:Z,authenticated:f,standalone:!0}),!C&&e("div",{class:"filter-bar",ref:M,style:{position:"relative"},children:[J?e(ge,{to:`/${p}/a/${o}`,class:"insignificant filter-clear",title:i({id:"u8JHrO"}),children:e(T,{icon:"x",size:"l",alt:i({id:"xCJdfg"})})},"clear-filters"):e(T,{icon:"filter",class:"insignificant",size:"l",alt:i({id:"cSev+j"})}),e(ge,{to:`/${p}/a/${o}${d?"?replies=1":""}`,onClick:()=>{d&&me(i({id:"PIWNSQ"}))},class:d?"":"is-active",children:e(h,{id:"5BFynH"})}),e(ge,{to:`/${p}/a/${o}${a?"":"?boosts=0"}`,onClick:()=>{a||me(i({id:"Qd13i0"}))},class:a?"is-active":"",children:e(h,{id:"usxQx0"})}),e(ge,{to:`/${p}/a/${o}${b?"":"?media=1"}`,onClick:()=>{b||me(i({id:"rKpfPY"}))},class:b?"is-active":"",children:e(h,{id:"xYilR2"})}),D.map(_e=>e(ge,{to:`/${p}/a/${o}${m===_e.name?"":`?tagged=${encodeURIComponent(_e.name)}`}`,onClick:()=>{m!==_e.name&&me(i({id:"L+HFfr",values:{0:_e.name}}))},class:m===_e.name?"is-active":"",children:e("span",{children:[e("span",{class:"more-insignificant",children:"#"}),_e.name]})},_e.id)),E&&(Qa?e("label",{class:`filter-field ${l?"is-active":""}`,children:[e(T,{icon:"month",size:"l"}),e("input",{type:"month",disabled:!(k!=null&&k.acct),value:l||"",min:Wi,max:new Date().toISOString().slice(0,7),onInput:_e=>{const{value:q,validity:re}=_e.currentTarget;if(!re.valid)return;u(q?{month:q}:{});const[Ae,De]=q.split("-"),Ne=parseInt(De,10)-1,Pe=new Date(Ae,Ne);me(i({id:"yKR8NJ",values:{1:Pe.toLocaleString(n.locale,{month:"long",year:"numeric"})}}))}})]}):e(ir,{class:`filter-field ${l?"is-active":""}`,disabled:!(k!=null&&k.acct),value:l||"",min:Wi,max:new Date().toISOString().slice(0,7),onInput:_e=>{const{value:q,validity:re}=_e;re.valid&&u(q?{month:q}:{})}}))]})]})},[o,p,f,D,Z,E,...S]);ne(()=>{var ye;const J=(ye=M.current)==null?void 0:ye.querySelector(".is-active");J&&M.current.scrollTo({behavior:"smooth",left:J.offsetLeft-(M.current.offsetWidth-J.offsetWidth)/2})},[D,E,...S]);const U=Te(()=>k!=null&&k.url?URL.parse(k.url).hostname:null,[k]),pe=!!k&&!(p===U);return e(It,{title:`${k!=null&&k.acct?"@"+k.acct:i({id:"+owNNn"})}`,titleComponent:e("h1",{class:"header-double-lines header-account",children:[e("b",{children:e(bs,{text:B,emojis:ce})}),e("div",{children:e("span",{class:"bidi-isolate",children:["@",Y]})})]}),id:"account-statuses",instance:p,emptyText:i({id:"+k97fV"}),errorText:i({id:"scd9lw"}),fetchItems:z,useItemID:!0,view:b||C?"media":void 0,boostsCarousel:s.settings.boostsCarousel,timelineStart:H,refresh:[d,a,m,b,l+(k==null?void 0:k.acct)].toString(),headerEnd:e(lt,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[e(Ie,{disabled:!pe,onClick:()=>{(async()=>{try{const{masto:J}=le({instance:U}),ye=await J.v1.accounts.lookup({acct:k.acct}),{id:_e}=ye;location.hash=`/${U}/a/${_e}`}catch{alert(i({id:"FgdLx0"}))}})()},children:[e(T,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"/JFxxT",values:{0:U?e(O,{children:[" ","(",e("b",{children:Pt.toUnicode(U)}),")"]}):null}})})]}),!I&&e(Ie,{onClick:()=>{(async()=>{try{const J=await y.v1.accounts.lookup({acct:k.acct+"@"+p}),{id:ye}=J;location.hash=`/${v}/a/${ye}`}catch{alert(i({id:"FgdLx0"}))}})()},children:[e(T,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"HkuyOu",values:{currentInstance:v},components:{0:e("b",{})}})})]})]})},o)}function ir(n){const{i18n:i}=ue(),{class:s,disabled:o,value:c,min:r,max:u,onInput:l=()=>{}}=n,[d,a]=(c==null?void 0:c.split("-"))||[],m=j(),b=j(),g=(p,f)=>{const[y,v]=(r==null?void 0:r.split("-"))||[],[w,S]=(u==null?void 0:u.split("-"))||[];return!(f<y||f>w||f===y&&p<v||f===w&&p>S)};return e("div",{class:s,children:[e(T,{icon:"month",size:"l"}),e("select",{ref:m,disabled:o,value:a||"",onInput:p=>{const{value:f}=p.currentTarget,y=b.current.value;if(!g(f,y))return{value:"",validity:{valid:!1}};l({value:f?`${y}-${f}`:"",validity:{valid:!0}})},children:[e("option",{value:"",children:e(h,{id:"HajiZl"})}),e("option",{disabled:!0,children:"-----"}),Array.from({length:12},(p,f)=>e("option",{value:(f+1).toString().padStart(2,"0"),children:new Date(0,f).toLocaleString(i.locale,{month:"long"})},f))]})," ",e("input",{ref:b,type:"number",disabled:o,value:d||new Date().getFullYear(),min:(r==null?void 0:r.slice(0,4))||Si,max:(u==null?void 0:u.slice(0,4))||new Date().getFullYear(),onInput:p=>{const{value:f,validity:y}=p.currentTarget,v=m.current.value;if(!y.valid||!g(v,f))return{value:"",validity:{valid:!1}};l({value:f?`${f}-${v}`:"",validity:{valid:!0}})},style:{width:"4.5em"}})]})}function sr(){var p;const n=Et(),{year:i}=n;et(i?`Annual Report: ${i}`:"Annual Report");const{masto:s,instance:o}=le(),[c,r]=$(null),[u,l]=$("default");ne(()=>{i&&(async()=>{l("loading");const f=await s.v1.annualReports.$select(i).fetch();r(f),l("default")})()},[i]);const{accounts:d,annualReports:a,statuses:m}=c||{},b=(p=a==null?void 0:a.find(f=>f.year==i))==null?void 0:p.data,g=new Date;return e("div",{id:"annual-report-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"report",children:[e("h1",{children:[i," #Wrapstodon"]}),u==="loading"&&e("p",{children:[e(Be,{abrupt:!0})," ",e(h,{id:"Pwqkdw"})]}),!!b&&e("dl",{children:Object.entries(b).map(([f,y])=>e(O,{children:[e("dt",{children:f}),e("dd",{class:`report-${f}`,children:Array.isArray(y)?e("table",{children:[e("thead",{children:e("tr",{children:Object.entries(y[0]).map(([v,w])=>e("th",{class:v!=="month"&&typeof w=="number"?"number":"",children:v}))})}),e("tbody",{children:y.map(v=>e("tr",{children:Object.entries(v).map(([w,S])=>e("td",{class:w!=="month"&&typeof S=="number"?"number":"",children:S&&/(accountId)/i.test(w)&&/^(mostRebloggedAccounts|commonlyInteractedWithAccounts)$/i.test(f)?e(pt,{account:d==null?void 0:d.find(k=>k.id===S),showAvatar:!0}):w==="month"?g.setMonth(S-1)&&g.toLocaleString(void 0,{month:"long"}):typeof S=="number"?S.toLocaleString():S}))}))})]}):typeof y=="object"?/^(topStatuses)$/i.test(f)?e("dl",{children:Object.entries(y).map(([v,w])=>e(O,{children:[e("dt",{children:v}),e("dd",{children:w&&e(ge,{to:`/${o}/s/${w}`,children:e(Ke,{status:m==null?void 0:m.find(S=>S.id===w),size:"s",readOnly:!0})})})]}))}):e("table",{children:e("tbody",{children:Object.entries(y).map(([v,w])=>e("tr",{children:[e("th",{children:v}),e("td",{class:typeof w=="number"?"number":"",children:w})]}))})}):typeof y=="string"?y:JSON.stringify(y,null,2)})]}))})]}),e("hr",{}),e("p",{style:{textAlign:"center"},children:e(ge,{to:"/",children:e(h,{id:"iWpEwy"})})})]})}const or=20;function qs(){const{_:n}=ue();et(n({id:"7Ff7ia"}),"/bookmarks");const{masto:i,instance:s}=le(),o=j();async function c(r){return(r||!o.current)&&(o.current=i.v1.bookmarks.list({limit:or})),await o.current.next()}return e(It,{title:n({id:"7Ff7ia"}),id:"bookmarks",emptyText:n({id:"8k2w6G"}),errorText:n({id:"UoL+FC"}),instance:s,fetchItems:c})}const cr=""+new URL("catch-up-DuauQu-W.png",import.meta.url).href,ar="home",at=[{label:{id:"Ov9hfp"},value:1},{label:{id:"tVE2wM"},value:2},{label:{id:"8+HOWa"},value:3},{label:{id:"1o+mEC"},value:4},{label:{id:"dZZ8oA"},value:5},{label:{id:"lpPucp"},value:6},{label:{id:"r9r5X6"},value:7},{label:{id:"I9uBFA"},value:8},{label:{id:"pBYFlb"},value:9},{label:{id:"wvL7OJ"},value:10},{label:{id:"7Vb+qD"},value:11},{label:{id:"VU1Pnd"},value:12},{label:{id:"vpc27K"},value:13}],rr={original:{id:"HxF6Fk"},replies:{id:"N8UzTV"},boosts:{id:"puY2t0"},followedTags:{id:"lCLRBe"},groups:{id:"zhrjek"},filtered:{id:"03Qqf9"}},lr=["createdAt","repliesCount","favouritesCount","reblogsCount","density"],dr=[null,"account"],ur=fs(n=>new Intl.DateTimeFormat(n||void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}));function hr(){const{i18n:n,_:i,_:s}=ue(),o=ur(n.locale);et("Catch-up","/catchup");const{masto:c,instance:r}=le(),[u,l]=gt(),d=u.get("id"),[a,m]=$("start"),[b,g]=$(!1),p=Te(()=>St(),[]),f=R=>R===p,y=Qe("@pixelfed/home-include-reblogs");async function v({maxCreatedAt:R}){var ie,Oe,$e;const V=R?new Date(R):null,se=[],G=c.v1.timelines.home.list({limit:40});e:for(;;)try{y&&G.nextParams&&(typeof G.nextParams=="string"?G.nextParams+="&include_reblogs=true":G.nextParams.include_reblogs=!0);const Me=await G.next(),{value:Fe}=Me;if(Fe!=null&&Fe.length){await Hs(Fe,r);let je=!1;for(let ve=0;ve<Fe.length;ve++){const ze=Fe[ve],tt=new Date(ze.createdAt);if(!V||tt>=V){const We=!f(((Oe=(ie=ze.reblog)==null?void 0:ie.account)==null?void 0:Oe.id)||ze.account.id)&&Yt((($e=ze.reblog)==null?void 0:$e.filtered)||ze.filtered,ar);if((We==null?void 0:We.action)==="hide")continue;ze._filtered=We;const vt=ot(ze.id,r);ze._followedTags=A.statusFollowedTags[vt]?[...A.statusFollowedTags[vt]]:[],se.push(ze),je=!0}if(!je)break e}}else break e;await new Promise(je=>setTimeout(je,1e3))}catch{break e}return se.forEach(Me=>{if(Me!=null&&Me.inReplyToId){const Fe=se.find(je=>je.id===Me.inReplyToId);Fe&&!Fe.inReplyToId&&(Fe._thread=!0)}}),se}const[w,S]=$([]),k=j(),_=j(),x=Te(()=>_n(),[]),C=rt(async({duration:R}={})=>{const V=Date.now(),se=R?V-R:null;m("loading");const G=await v({maxCreatedAt:se}),ie=`${x}-${Ho()}`;try{await ft.catchup.set(ie,{id:ie,posts:G,count:G.length,startAt:se,endAt:V}),l({id:ie})}catch{}},[]);ne(()=>{d?(async()=>{const R=await ft.catchup.get(d);R&&(R.posts.sort((V,se)=>V.createdAt>se.createdAt?1:-1),S(R.posts),m("results"))})():a==="results"&&(S([]),m("start"))},[d]);const[I,E]=Nt(R=>R+1,0),[L,z]=$(null),[D,oe]=$([]);ne(()=>{(async()=>{try{const R=await ft.catchup.keys();if(R.length){const V=_n(),se=R.filter(G=>G.startsWith(`${V}-`));if(se.length){let G=await ft.catchup.getMany(se);G.sort((Me,Fe)=>Fe.endAt-Me.endAt);let ie=G.slice(0,3),Oe=G.slice(3);const $e=ie.map(Me=>{const{id:Fe,count:je,startAt:ve,endAt:ze}=Me;return{id:Fe,count:je,startAt:ve,endAt:ze}});oe($e),z(ie[0].endAt),G=null,ie=null,queueMicrotask(()=>{Oe.length&&ft.catchup.delMany(Oe.map(Me=>Me.id)).then(()=>{Oe=null}).catch(Me=>{})});return}}}catch{}oe([])})()},[I]),ne(()=>{a==="start"&&E()},[a==="start"]);const[ee,W]=Te(()=>{var Fe,je,ve,ze,tt;let R=0,V=0,se=0,G=0,ie=0,Oe=0;const $e={};for(const Ee of w){Ee._filtered?(R++,Ee.__FILTER="filtered"):Ee.group?(V++,Ee.__FILTER="groups"):Ee.reblog?(se++,Ee.__FILTER="boosts"):(Fe=Ee._followedTags)!=null&&Fe.length?(ie++,Ee.__FILTER="followedTags"):Ee.inReplyToId&&Ee.inReplyToAccountId!==((je=Ee.account)==null?void 0:je.id)?(G++,Ee.__FILTER="replies"):(Oe++,Ee.__FILTER="original");const We=Ee.reblog||Ee;if(Ee.__FILTER!=="filtered"&&((ve=We.card)!=null&&ve.url)&&((ze=We.card)!=null&&ze.image)&&((tt=We.card)==null?void 0:tt.type)==="link"){const{card:vt,favouritesCount:ln,reblogsCount:Rt}=We;let{url:nt}=vt;if(nt=nt.replace(/\/$/,""),!$e[nt])$e[nt]={postID:We.id,card:vt,shared:1,sharers:[Ee.account],likes:ln,boosts:Rt};else{if($e[nt].sharers.find(Ut=>Ut.id===Ee.account.id))continue;$e[nt].shared++,$e[nt].sharers.push(Ee.account),$e[nt].postID!==We.id&&($e[nt].likes+=ln,$e[nt].boosts+=Rt)}}}let Me=[];for(const Ee in $e)Me.push({url:Ee,...$e[Ee]});if(Me.sort((Ee,We)=>Ee.shared>We.shared?-1:Ee.shared<We.shared?1:Ee.boosts>We.boosts?-1:Ee.boosts<We.boosts?1:Ee.likes>We.likes?-1:Ee.likes<We.likes?1:0),Me.length>10)e:for(let Ee=10;Ee<Me.length;Ee++){const{shared:We}=Me[Ee];if(We<=1){Me=Me.slice(0,Ee);break e}}return[{filtered:R,groups:V,boosts:se,replies:G,followedTags:ie,original:Oe},Me]},[w]),[Z,B]=$("all"),[Y,ce]=$(null),[M,H]=$(1),[U,K]=$("createdAt"),[pe,J]=$("asc"),[ye,_e]=$(null),[q,re,Ae]=Te(()=>{const R={},V=new Map;let se=w.filter(ie=>{const Oe=Z==="all"||ie.__FILTER===Z;return Oe&&(R[ie.account.id]=ie.account,V.set(ie.account.id,(V.get(ie.account.id)||0)+1)),Oe});const G={};return se.forEach(ie=>{ie.reblog&&(G[ie.reblog.id]?(G[ie.reblog.id].__BOOSTERS?G[ie.reblog.id].__BOOSTERS.add(ie.account):G[ie.reblog.id].__BOOSTERS=new Set([ie.account]),ie.__HIDDEN=!0):G[ie.reblog.id]=ie)}),Y&&V.has(Y)&&(se=se.filter(ie=>ie.account.id===Y||[...ie.__BOOSTERS||[]].find(Oe=>Oe.id===Y))),[se,R,Object.fromEntries(V)]},[Z,Y,w]),De=Te(()=>{const R={};return q.forEach(V=>{R[V.id]=V}),R},[q]),Ne=Te(()=>Object.keys(Ae).sort((R,V)=>Ae[V]-Ae[R]),[Ae]),Pe=Te(()=>{const R={};return Ne.forEach((V,se)=>{R[V]=se}),q.filter(V=>!V.__HIDDEN).sort((V,se)=>{if(ye==="account"){const G=V.account.id,ie=se.account.id,Oe=R[G],$e=R[ie],Me=Oe-$e;if(Me!==0)return Me}if(U!=="createdAt"&&(V=V.reblog||V,se=se.reblog||se,U!=="density"&&V[U]===se[U]))return V.createdAt>se.createdAt?1:-1;if(U==="density"){const G=Zi(V),ie=Zi(se);return pe==="asc"?G>ie?1:-1:ie>G?1:-1}return pe==="asc"?V[U]>se[U]?1:-1:se[U]>V[U]?1:-1})},[q,U,pe,ye,Ne]),Ue=j(null),Ce=j(null),Q=j(!1);ne(()=>{w.length>100||Q.current||Ce.current&&(Rs(Ce.current,{duration:200}),Q.current=!0)},[w,Ce]);const ke=w.length>160?"3d":"2d",Le=Te(()=>ke!=="2d"?null:w.map(R=>{const V=De[R.id];return e("span",{class:`post-dot ${V?"post-dot-highlight":""}`},R.id)}),[De]),fe=Te(()=>ke!=="3d"||!(w!=null&&w.length)?null:vr(w,"createdAt",320).map((V,se)=>e("div",{class:"posts-bin",children:V.map(G=>{const ie=De[G.id];return e("span",{class:`post-dot ${ie?"post-dot-highlight":""}`},G.id)})},se)),[De]),X=j(null),Se=Te(()=>L?(Date.now()-L)/1e3/60/60:null,[L,M]);ne(()=>{if(a!=="results")return;const R=Y&&re[Y]?re[Y].username:"",V=pe==="asc"?0:1,se={account:"authors"};let G=me({duration:5e3,text:s({id:"TLYeLT",values:{selectedFilterCategory:Z,sortBy:U,sortOrder:pe,groupBy:ye}})});return()=>{var ie;(ie=G==null?void 0:G.hideToast)==null||ie.call(G)}},[a,Z,Y,U,pe,ye,re]),ne(()=>{var R;if(Y&&re[Y]){const V=Ce.current.querySelector(`[data-author="${Y}"]`),se=(R=Ce.current)==null?void 0:R.getBoundingClientRect(),G=V==null?void 0:V.getBoundingClientRect();G.left<se.left||G.right>se.right?V.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}):G.top<0&&V.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})}},[Y,re]);const[P,te]=$(!1),de=".catchup-list > li > a",N=He("j",()=>{const R=document.activeElement.closest(de),V=R==null?void 0:R.getBoundingClientRect(),se=Array.from(X.current.querySelectorAll(de));if(R&&V.top<X.current.clientHeight&&V.bottom>0){const G=se.indexOf(R),ie=se[G+1];ie&&(ie.focus(),ie.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}))}else{const G=se.find(ie=>ie.getBoundingClientRect().top>=0);G&&(G.focus(),G.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}))}},{preventDefault:!0,ignoreModifiers:!0}),ae=He("k",()=>{const R=document.activeElement.closest(de),V=R==null?void 0:R.getBoundingClientRect(),se=Array.from(X.current.querySelectorAll(de));if(R&&V.top<X.current.clientHeight&&V.bottom>0){const G=se.indexOf(R);let ie=se[G-1];ie&&(ie.focus(),ie.scrollIntoView({block:"center",inline:"center",behavior:"smooth"}))}else{const G=se.find(ie=>{const Oe=ie.getBoundingClientRect();return Oe.top>=44&&Oe.left>=0});G&&(G.focus(),G.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}))}},{preventDefault:!0,ignoreModifiers:!0}),xe=He("h, l",(R,V)=>{var G,ie,Oe;const se=V.keys[0];if(Y){const $e=Ne.indexOf(Y);se==="h"?$e>0&&$e<Ne.length&&(ce(Ne[$e-1]),(G=X.current)==null||G.focus()):se==="l"&&$e<Ne.length-1&&$e>=0&&(ce(Ne[$e+1]),(ie=X.current)==null||ie.focus())}else se==="l"&&(ce(Ne[0]),(Oe=X.current)==null||Oe.focus())},{preventDefault:!0,ignoreModifiers:!0,enableOnFormTags:["input"]}),F=He("esc",()=>{var R;ce(null),(R=X.current)==null||R.focus()},{preventDefault:!0,ignoreModifiers:!0,enableOnFormTags:["input"]}),be=He(".",()=>{var R;(R=X.current)==null||R.scrollTo({top:0,behavior:"smooth"})},{preventDefault:!0,ignoreModifiers:!0,enableOnFormTags:["input"]}),Re=rt(R=>{const V=document.activeElement,se=(V==null?void 0:V.tagName)==="INPUT"&&V.type==="radio";if((R.key==="ArrowDown"||R.key==="ArrowUp"||R.key==="ArrowLeft"||R.key==="ArrowRight")&&se){V.blur();return}},[]);return e("div",{ref:R=>{X.current=R,N(R),ae(R),xe(R),F(R)},id:"catchup-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck wide",children:[e("header",{class:`${a==="loading"?"loading":""}`,onClick:R=>{var V;R.target.closest("a, button")||(V=X.current)==null||V.scrollTo({top:0,behavior:"smooth"})},children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(zt,{}),a==="results"&&e(ge,{to:"/catchup",class:"button plain",children:e(T,{icon:"history2",size:"l",alt:s({id:"xrl8fj"})})}),a==="start"&&e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:s({id:"i0qMbr"})})})]}),e("h1",{children:a!=="start"&&e(h,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("div",{class:"header-side",children:a!=="start"&&a!=="loading"&&e("button",{type:"button",class:"plain",onClick:()=>{te(!0)},children:e(h,{id:"c3XJ18"})})})]})}),e("main",{onKeyDown:Re,children:[a==="start"&&e("div",{class:"catchup-start",children:[e("h1",{children:e(h,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("details",{children:[e("summary",{children:e(h,{id:"CxKPv6"})}),e("p",{children:e(h,{id:"YMU1CK"})}),e("img",{src:cr,width:"1200",height:"900",alt:s({id:"CeInO2"})}),e("p",{children:e("button",{type:"button",onClick:R=>{R.target.closest("details").open=!1},children:e(h,{id:"2jI8hh"})})})]}),e("p",{children:e(h,{id:"1RfGk7"})}),e("p",{children:e("b",{children:e(h,{id:"OOEonE"})})}),e("div",{class:"catchup-form",children:[e("input",{ref:k,type:"range",value:M,min:at[0].value,max:at[at.length-1].value,step:"1",list:"catchup-ranges",onChange:R=>H(+R.target.value)})," ",e("span",{style:{width:"8em"},children:[i(at[M-1].label),e("br",{}),e("small",{class:"insignificant",children:M==at[at.length-1].value?s({id:"NMNiaO"}):mt(new Date(Date.now()-M*60*60*1e3))})]}),e("datalist",{id:"catchup-ranges",children:at.map(({label:R,value:V})=>e("option",{value:V,label:i(R)}))})," ",e("button",{type:"button",onClick:()=>{var R;if(M<at[at.length-1].value){let V;M===at[at.length-1].value&&((R=_.current)!=null&&R.checked)?V=Date.now()-L:V=M*60*60*1e3,C({duration:V})}else C()},children:e(h,{id:"R0yu2l"})})]}),Se&&M>Se?e("p",{class:"catchup-info",children:[e(T,{icon:"info"})," ",e(h,{id:"AGyV7s"})]}):M===at[at.length-1].value&&L?e("p",{class:"catchup-info",children:e("label",{children:[e("input",{type:"checkbox",switch:!0,checked:!0,ref:_})," ",e(h,{id:"dDJEHI",values:{0:o.format(new Date(L))}})]})}):null,e("p",{class:"insignificant",children:e("small",{children:e(h,{id:"EAjFM0"})})}),!!(D!=null&&D.length)&&e("div",{class:"catchup-prev",children:[e("p",{children:e(h,{id:"Yfb9A8"})}),e("ul",{children:D.map(R=>e("li",{children:[e(ge,{to:`/catchup?id=${R.id}`,children:[e(T,{icon:"history2"})," ",e("span",{children:R.startAt?o.formatRange(new Date(R.startAt),new Date(R.endAt)):`… – ${o.format(new Date(R.endAt))}`})]})," ",e("span",{children:[e("small",{class:"ib insignificant",children:e(h,{id:"S6XZwv",values:{0:R.count}})})," ",e("button",{type:"button",class:"light danger small",onClick:async()=>{var se;if(confirm(s({id:"D9CmP2"}))){let G=me(s({id:"xJUo4P",values:{0:R.id}}));await ft.catchup.del(R.id),(se=G==null?void 0:G.hideToast)==null||se.call(G),me(s({id:"bRDKRy",values:{1:R.id}})),E()}},children:e(T,{icon:"x",alt:s({id:"t/YqKh"})})})]})]},R.id))}),D.length>=3&&e("p",{children:e("small",{children:e(h,{id:"sXmrl4"})})})]})]}),a==="loading"&&e("div",{class:"ui-state catchup-start",children:[e(Be,{abrupt:!0}),e("p",{class:"insignificant",children:e(h,{id:"rbUTzD"})}),e("p",{class:"insignificant",children:e(h,{id:"q9urQO"})})]}),a==="results"&&e(O,{children:[e("div",{class:"catchup-header",children:[w.length>0&&e("p",{children:e("b",{class:"ib",children:o.formatRange(new Date(w[0].createdAt),new Date(w[w.length-1].createdAt))})}),e("aside",{children:[e("button",{hidden:Z==="all"&&!Y&&U==="createdAt"&&pe==="asc",type:"button",class:"plain4 small",onClick:()=>{B("all"),ce(null),K("createdAt"),_e(null),J("asc")},children:e(h,{id:"I9EnzM"})}),(W==null?void 0:W.length)>0&&e("button",{type:"button",class:"plain small",onClick:()=>g(!b),children:[e(h,{id:"EIZREX"})," ",e(T,{icon:"chevron-down",style:{transform:b?"rotate(180deg)":"rotate(0deg)"}})]})]})]}),e("div",{class:"shazam-container no-animation",hidden:!b,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"catchup-top-links links-bar",children:W.map(R=>{const{card:V,shared:se,sharers:G,likes:ie,boosts:Oe}=R,{blurhash:$e,title:Me,description:Fe,url:je,image:ve,imageDescription:ze,language:tt,width:Ee,height:We,publishedAt:vt}=V,ln=Pt.toUnicode(URL.parse(je).hostname.replace(/^www\./,"").replace(/\/$/,""));let Rt;if($e){const nt=li($e),Ut=ki(nt);Rt=wi([.6,Ut[1],Ut[2]])}return e("a",{href:je,target:"_blank",rel:"noopener noreferrer",class:"link-block",style:Rt?{"--accent-color":`rgb(${Rt.join(",")})`,"--accent-alpha-color":`rgba(${Rt.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:ve,alt:ze,width:Ee,height:We,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:ln})," ",!!vt&&e(O,{children:"· "}),!!vt&&e(O,{children:e(Zt,{datetime:vt,format:"micro"})})]}),!!Me&&e("h1",{class:"title",lang:tt,dir:"auto",title:Me,children:Me})]}),!!Fe&&e("p",{class:"description",lang:tt,dir:"auto",title:Fe,children:Fe}),e("hr",{}),e("p",{style:{whiteSpace:"nowrap"},children:e(h,{id:"bfSr6z",values:{0:G.map(nt=>{const{avatarStatic:Ut,displayName:ro}=nt;return e("button",{type:"button",class:"plain",style:{padding:0},onClick:Ci=>{Ci.preventDefault(),Ci.stopPropagation();const{id:lo}=nt;ce(lo),B("all")},children:e(ht,{url:Ut,size:"s",alt:ro})})})}})})]})]})},je)})})})}),w.length>=5&&(ke==="3d"?e("div",{class:"catchup-posts-viz-time-bar",children:fe}):e("div",{class:"catchup-posts-viz-bar",children:Le})),w.length>=2&&e("div",{class:"catchup-filters",children:[e("label",{class:"filter-cat",children:[e("input",{type:"radio",name:"filter-cat",checked:Z.toLowerCase()==="all",onChange:()=>{B("all")}}),e(h,{id:"N40H+G"})," ",e("span",{class:"count",children:w.length})]}),Object.entries(rr).map(([R,V])=>!!ee[R]&&e("label",{class:"filter-cat",title:(ee[R]/w.length*100).toFixed(2)+"%",children:[e("input",{type:"radio",name:"filter-cat",checked:Z.toLowerCase()===R.toLowerCase(),onChange:()=>{B(R),R==="boosts"&&(K("reblogsCount"),J("desc"),_e(null))}}),i(V)," ",e("span",{class:"count",children:ee[R]})]},i(V)))]}),w.length>=2&&!!Ae&&e("div",{class:"catchup-filters authors-filters",ref:Ce,children:[Ne.map(R=>e("label",{class:"filter-author","data-author":R,children:[e("input",{type:"radio",name:"filter-author",checked:Y===R,onChange:()=>{ce(R)},onClick:()=>{Y===R&&ce(null)}}),e(ht,{url:re[R].avatarStatic||re[R].avatar,size:"xxl",alt:`${re[R].displayName} (@${re[R].acct})`})," ",e("span",{class:"count",children:Ae[R]}),e("span",{class:"username",children:re[R].username})]},`${R}-${Ae[R]}`)),Ne.length>5&&e("small",{style:{whiteSpace:"nowrap",paddingInline:"1em",opacity:.33},children:e(h,{id:"HHtYi7",values:{0:Ne.length}})},"authors-count")]}),w.length>=2&&e("div",{class:"catchup-filters",children:[e("span",{class:"filter-label",children:e(h,{id:"f6Hub0"})})," ",e("fieldset",{class:"radio-field-group",children:lr.map(R=>e("label",{class:"filter-sort",onClick:V=>{U===R&&(V.preventDefault(),V.stopPropagation(),J(pe==="asc"?"desc":"asc"))},children:[e("input",{type:"radio",name:"filter-sort-cat",checked:U===R,onChange:()=>{K(R);const V=/(replies|favourites|reblogs)/.test(R)?"desc":"asc";J(V)}}),{createdAt:s({id:"mYGY3B"}),repliesCount:s({id:"N8UzTV"}),favouritesCount:s({id:"zZOZj7"}),reblogsCount:s({id:"puY2t0"}),density:s({id:"0tQ7AD"})}[R],U===R&&(pe==="asc"?" ↑":" ↓")]},R))}),e("span",{class:"filter-label",children:e(h,{id:"group.filter"})})," ",e("fieldset",{class:"radio-field-group",children:dr.map(R=>e("label",{class:"filter-group",children:[e("input",{type:"radio",name:"filter-group",checked:ye===R,onChange:()=>{_e(R)},disabled:R==="account"&&Y}),{account:s({id:"dpqPBg"})}[R]||s({id:"EdQY6l"})]},R||"none"))}),Y&&Ne.length>1?e("button",{type:"button",class:"plain6 small",onClick:()=>{ce(null)},style:{whiteSpace:"nowrap"},children:e(h,{id:"/dlmrZ"})}):null]}),e("ul",{class:`catchup-list catchup-filter-${Z||""} ${U?`catchup-sort-${U}`:""} ${Y&&re[Y]?"catchup-selected-author":""} ${ye?`catchup-group-${ye}`:""}`,children:Pe.map((R,V)=>{var ie;const se=((ie=R.reblog)==null?void 0:ie.id)||R.id;let G=!1;return ye==="account"&&(Ue.current&&R.account.id!==Ue.current&&V>0&&(G=!0),Ue.current=R.account.id),e(O,{children:[G&&e("li",{class:"separator"}),e(pr,{to:`/${r}/s/${se}`,post:R,root:X.current})]},`${R.id}-${G}`)})}),e("footer",{children:q.length>5&&e("p",{children:[s(Z==="boosts"?{id:"eVosYr"}:{id:"rhmyFK"})," ",e("button",{type:"button",class:"textual",onClick:()=>{X.current.scrollTop=0},children:e(h,{id:"0MgdN+"})}),"."]})})]})]})]}),P&&e(Ye,{onClose:()=>te(!1),children:e("div",{class:"sheet",id:"catchup-help-sheet",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>te(!1),children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"c3XJ18"})})}),e("main",{children:e("dl",{children:[e("dt",{children:e(h,{id:"EIZREX"})}),e("dd",{children:e(h,{id:"YmGrIy"})}),e("dt",{children:e(h,{id:"coaNtr"})}),e("dd",{children:e(h,{id:"UUrqX1"})}),e("dt",{children:e(h,{id:"ScQBC/"})}),e("dd",{children:e(h,{id:"srocAr"})}),e("dt",{children:e(h,{id:"77Emn0"})}),e("dd",{children:e("table",{children:e("tbody",{children:[e("tr",{children:[e("td",{children:e(h,{id:"Gy9P9T"})}),e("td",{children:e("kbd",{children:"j"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"6XYpYY"})}),e("td",{children:e("kbd",{children:"k"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"f5dduh"})}),e("td",{children:e("kbd",{children:"l"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"rj0vxZ"})}),e("td",{children:e("kbd",{children:"h"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"jsFF8C"})}),e("td",{children:e("kbd",{children:"Enter"})})]}),e("tr",{children:[e("td",{children:e(h,{id:"bUUv3P"})}),e("td",{children:e("kbd",{children:"."})})]})]})})})]})})]})})]})}const fr=ct(function({post:n}){const{id:i,account:s,group:o,reblog:c,inReplyToId:r,inReplyToAccountId:u,_followedTags:l,_filtered:d,visibility:a,__BOOSTERS:m}=n,b=r&&u!==s.id,g=!!d,p=f=>{f.shiftKey};return e("article",{class:`post-line ${o?"group":c?"reblog":l!=null&&l.length?"followed-tags":""} ${b?"reply-to":""} ${g?"filtered":""} visibility-${a}`,onMouseEnter:p,children:[e("span",{class:"post-author",children:c?e("span",{class:"post-reblog-avatar",children:[e(ht,{url:s.avatarStatic||s.avatar,squircle:s.bot}),(m==null?void 0:m.size)>0?[...m].map(f=>e(ht,{url:f.avatarStatic||f.avatar,squircle:f.bot})):""," ",e(T,{icon:"rocket"})," ",e(pt,{account:c.account,showAvatar:!0})]}):e(pt,{account:s,showAvatar:!0})}),e(br,{post:c||n,filterInfo:d}),e("span",{class:"post-meta",children:[e(yr,{post:c||n})," ",e(Zt,{datetime:new Date((c==null?void 0:c.createdAt)||n.createdAt),format:"micro"})]})]})},(n,i)=>{var s,o;return((s=n==null?void 0:n.post)==null?void 0:s.id)===((o=i==null?void 0:i.post)==null?void 0:o.id)}),pr=({root:n,to:i,...s})=>{const o=j(),[c,r]=$(!1);return ne(()=>{const u=new IntersectionObserver(l=>{l[0].isIntersecting&&(queueMicrotask(()=>r(!0)),u.unobserve(o.current))},{root:n,rootMargin:`${Math.max(320,screen.height*.75)}px`});return o.current&&u.observe(o.current),()=>{o.current&&u.unobserve(o.current)}},[]),c?e("li",{children:e(ge,{to:i,children:e(fr,{...s})})}):e("li",{ref:o,style:{height:"4em"}})},mr=8,gr=8;function Zi(n){var d;const{spoilerText:i,content:s,poll:o,mediaAttachments:c,card:r}=n,u=(d=o==null?void 0:o.options)!=null&&d.length?o.options.reduce((a,m)=>a+m.title,""):"";return(i.length+Ss(s)+u.length)/140+(c!=null&&c.length?mr*c.length:r!=null&&r.image?gr:0)}const Tt=48;function br({post:n,filterInfo:i}){var k;const{_:s}=ue(),{spoilerText:o,sensitive:c,content:r,emojis:u,poll:l,mediaAttachments:d,card:a,inReplyToId:m,inReplyToAccountId:b,account:g,_thread:p}=n,f=m&&b===g.id||!!p,y=Te(()=>!!(we.account.get("preferences")||{})["reading:expand:spoilers"],[]),v=y||!o&&!c,w=r?di(n):"",S=!o||y;return e("div",{class:"post-peek",title:o?"":w,children:[e("span",{class:"post-peek-content",children:[f&&!S&&e(O,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:"Thread"})," "]}),i?e("span",{class:"post-peek-filtered",children:i!=null&&i.titlesStr?s({id:"suKjh3",values:{0:i.titlesStr}}):s({id:"03Qqf9"})}):e(O,{children:[!!o&&e("span",{class:"post-peek-spoiler",children:[e(T,{icon:`${y?"eye-open":"eye-close"}`})," ",o]}),S&&e("div",{class:"post-peek-html",children:[f&&e(O,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:e(h,{id:"e66y2Z"})})," "]}),!!r&&e("div",{dangerouslySetInnerHTML:{__html:qo(r,u)}}),!!((k=l==null?void 0:l.options)!=null&&k.length)&&l.options.map(_=>e("div",{children:[l.multiple?"▪️":"•"," ",_.title]})),!r&&(d==null?void 0:d.length)===1&&d[0].description&&e(O,{children:[e("span",{class:"post-peek-tag post-peek-alt",children:"ALT"})," ",e("div",{children:d[0].description})]})]})]})]}),!i&&e("span",{class:"post-peek-post-content",children:[!!l&&e("span",{class:"post-peek-tag post-peek-poll",children:[e(T,{icon:"poll",size:"s"}),e(h,{id:"4WUbF1"})]}),d!=null&&d.length?d.map(_=>{var L,z,D,oe,ee,W,Z,B,Y,ce;const x=_.previewUrl||_.url,C=_.previewRemoteUrl||_.remoteUrl,I=(L=_.meta)!=null&&L.original?_.meta.original.width:((D=(z=_.meta)==null?void 0:z.small)==null?void 0:D.width)||((ee=(oe=_.meta)==null?void 0:oe.original)==null?void 0:ee.width),E=(W=_.meta)!=null&&W.original?_.meta.original.height:((B=(Z=_.meta)==null?void 0:Z.small)==null?void 0:B.height)||((ce=(Y=_.meta)==null?void 0:Y.original)==null?void 0:ce.height);return e("span",{class:"post-peek-media",children:{image:(x||C)&&v?e("img",{src:x,width:Tt,height:Tt,alt:_.description,loading:"lazy",onError:M=>{const{src:H}=M.target;H===x&&(M.target.src=C)},style:{"--anim-duration":`${Math.min(Math.max(Math.max(I,E)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"🖼"}),gifv:(x||C)&&v?e("img",{src:x,width:Tt,height:Tt,alt:_.description,loading:"lazy",onError:M=>{const{src:H}=M.target;H===x&&(M.target.src=C)}}):e("span",{class:"post-peek-faux-media",children:"🎞️"}),video:(x||C)&&v?e("img",{src:x,width:Tt,height:Tt,alt:_.description,loading:"lazy",onError:M=>{const{src:H}=M.target;H===x&&(M.target.src=C)}}):e("span",{class:"post-peek-faux-media",children:"📹"}),audio:e("span",{class:"post-peek-faux-media",children:"🎵"})}[_.type]||null},_.id)}):!!a&&a.image&&v&&e("span",{class:`post-peek-media post-peek-card card-${a.type||""}`,children:a.image?e("img",{src:a.image,width:Tt,height:Tt,alt:a.title||a.description||a.imageDescription,loading:"lazy",style:{"--anim-duration":a.width&&a.height&&`${Math.min(Math.max(Math.max(a.width,a.height)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"🔗"})})]})]})}function yr({post:n}){const{_:i}=ue(),{reblogsCount:s,repliesCount:o,favouritesCount:c}=n;return e("span",{class:"post-stats",children:[o>0&&e("span",{class:"post-stat-replies",children:[e(T,{icon:"comment2",size:"s",alt:i({id:"N8UzTV"})})," ",Xe(o)]}),c>0&&e("span",{class:"post-stat-likes",children:[e(T,{icon:"heart",size:"s",alt:i({id:"zZOZj7"})})," ",Xe(c)]}),s>0&&e("span",{class:"post-stat-boosts",children:[e(T,{icon:"rocket",size:"s",alt:i({id:"puY2t0"})})," ",Xe(s)]})]})}function vr(n,i,s){const o=n.map(d=>new Date(d[i])),c=o.reduce((d,a)=>a<d?a:d,o[0]),u=o.reduce((d,a)=>a>d?a:d,o[0]).getTime()-c.getTime(),l=Array.from({length:s},()=>[]);return n.forEach(d=>{const m=(new Date(d[i]).getTime()-c.getTime())/u,b=Math.floor(m*(s-1));l[b].push(d)}),l}const wr=20;function Ys(){const{_:n}=ue();et(n({id:"zZOZj7"}),"/favourites");const{masto:i,instance:s}=le(),o=j();async function c(r){return(r||!o.current)&&(o.current=i.v1.favourites.list({limit:wr})),await o.current.next()}return e(It,{title:n({id:"zZOZj7"}),id:"favourites",emptyText:n({id:"PHIrMr"}),errorText:n({id:"khVljG"}),instance:s,fetchItems:c})}const kr=["home","public","notifications","thread","account"],Xi=["notifications","thread","account"],Sr={home:{id:"Buy2bt"},notifications:{id:"iDNBZe"},public:{id:"RO10dm"},thread:{id:"EnJuK0"},account:{id:"vrQQgz"}},_r=[0,30*60,60*60,6*60*60,12*60*60,60*60*24,60*60*24*7,60*60*24*30],jn={0:{id:"qqeAJM"},1800:it(30,"minute"),3600:it(1,"hour"),21600:it(6,"hour"),43200:it(12,"hour"),86400:it(24,"hour"),604800:it(7,"day"),2592e3:it(30,"day")};function Cr(){const{_:n}=ue(),{masto:i}=le();et(n({id:"cSev+j"}),"/ft");const[s,o]=$("default"),[c,r]=$(!1),[u,l]=Nt(m=>m+1,0),[d,a]=$([]);return ne(()=>{o("loading"),(async()=>{try{const m=await i.v2.filters.list();m.sort((b,g)=>b.title.localeCompare(g.title)),m.forEach(b=>{var g;(g=b.keywords)!=null&&g.length&&b.keywords.sort((p,f)=>p.id-f.id)}),a(m),o("default")}catch{o("error")}})()},[u]),e("div",{id:"filters-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck",children:[e("header",{children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(zt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(h,{id:"cSev+j"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{r(!0)},children:e(T,{icon:"plus",size:"l",alt:n({id:"yFfBdX"})})})})]})}),e("main",{children:d.length>0?e(O,{children:[e("ul",{class:"filters-list",children:d.map(m=>{const{id:b,title:g,expiresAt:p,keywords:f}=m;return e("li",{children:[e("div",{children:[e("h2",{children:g}),(f==null?void 0:f.length)>0&&e("div",{children:f.map(y=>e(O,{children:[e("span",{class:"tag collapsed insignificant",children:y.wholeWord?`“${y.keyword}”`:y.keyword})," "]}))}),e("small",{class:"insignificant",children:e(js,{expiresAt:p})})]}),e("button",{type:"button",class:"plain",onClick:()=>{r({filter:m})},children:e(T,{icon:"pencil",size:"l",alt:"Edit filter"})})]},b)})}),d.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(h,{id:"5vzJxv",values:{0:d.length}})})})]}):s==="loading"?e("p",{class:"ui-state",children:e(Be,{})}):s==="error"?e("p",{class:"ui-state",children:e(h,{id:"qcAUwp"})}):e("p",{class:"ui-state",children:e(h,{id:"cWIHTt"})})})]}),!!c&&e(Ye,{title:n({id:"vCSBPD"}),onClose:()=>{r(!1)},children:e(xr,{filter:c==null?void 0:c.filter,onClose:m=>{m.state==="success"&&l(),r(!1)}})})]})}let Ir=1;const Tr=()=>Ir++;function xr({filter:n,onClose:i}){const{_:s,_:o}=ue(),{masto:c}=le(),[r,u]=$("default"),l=!!n,{context:d,expiresAt:a,id:m,keywords:b,title:g,filterAction:p}=n||{},f=!!a,y=f&&new Date(a),[v,w]=$(b||[]),S=j(),[k,_]=$([]),[x,C]=$([]),I=v.filter(E=>!k.includes(E.id)&&!x.includes(E._id));return e("div",{class:"sheet",id:"filters-add-edit-modal",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:o(l?{id:"3mOee6"}:{id:"yFfBdX"})})}),e("main",{children:e("form",{onSubmit:E=>{E.preventDefault();const L=new FormData(E.target),z=L.get("title"),D=L.getAll("keyword_attributes[][id]"),oe=L.getAll("keyword_attributes[][keyword]"),ee=[...S.current.querySelectorAll('input[name="keyword_attributes[][whole_word]"]')].map(ce=>ce.checked),W=oe.map((ce,M)=>({id:D[M]||void 0,keyword:ce,wholeWord:ee[M]}));l&&(k!=null&&k.length)&&k.forEach(ce=>{W.push({id:ce,_destroy:!0})});const Z=L.getAll("context");let B=L.get("expires_in");const Y=L.get("filter_action");!z||!(Z!=null&&Z.length)||(u("loading"),(async()=>{try{let ce;l?(B===""||B===null?f?B=Math.floor((y-new Date)/1e3):B=null:B==="0"||B===0?B=null:B=+B,ce=await c.v2.filters.$select(m).update({title:z,context:Z,expiresIn:B,keywordsAttributes:W,filterAction:Y})):(B=+B||null,ce=await c.v2.filters.create({title:z,context:Z,expiresIn:B,keywordsAttributes:W,filterAction:Y})),u("default"),i==null||i({state:"success",filter:ce})}catch{u("error"),alert(o(l?{id:"H8RP+h"}:{id:"Fr0hAN"}))}})())},children:[e("div",{class:"filter-form-row",children:e("label",{children:[e("b",{children:e(h,{id:"MHrjPM"})}),e("input",{type:"text",name:"title",defaultValue:g,disabled:r==="loading",dir:"auto",required:!0})]})}),e("div",{class:"filter-form-keywords",ref:S,children:[I.length?e("ul",{class:"filter-keywords",children:I.map(E=>{const{id:L,keyword:z,wholeWord:D,_id:oe}=E;return e("li",{children:[e("input",{type:"hidden",name:"keyword_attributes[][id]",value:L}),e("input",{name:"keyword_attributes[][keyword]",type:"text",defaultValue:z,disabled:r==="loading",required:!0,dir:"auto"}),e("div",{class:"filter-keyword-actions",children:[e("label",{children:[e("input",{name:"keyword_attributes[][whole_word]",type:"checkbox",value:L,defaultChecked:D,disabled:r==="loading"})," ",e(h,{id:"/7UQ7y"})]}),e("button",{type:"button",class:"light danger small",disabled:r==="loading",onClick:()=>{L?(k.push(L),_([...k])):oe&&(x.push(oe),C([...x]))},children:e(T,{icon:"x",alt:o({id:"t/YqKh"})})})]})]},`${L}-${oe}`)})}):e("div",{class:"filter-keywords",children:e("div",{class:"insignificant",children:e(h,{id:"SYKm3p"})})}),e("footer",{class:"filter-keywords-footer",children:[e("button",{type:"button",class:"light",onClick:()=>{w([...v,{_id:Tr(),keyword:"",wholeWord:!0}]),setTimeout(()=>{var L,z;const E=S.current.querySelectorAll('input[type="text"]');(z=(L=E[E.length-1])==null?void 0:L.focus)==null||z.call(L)},10)},children:e(h,{id:"qn5Dbn"})})," ",(I==null?void 0:I.length)>1&&e("small",{class:"insignificant",children:e(h,{id:"1JZ175",values:{0:I.length}})})]})]}),e("div",{class:"filter-form-cols",children:[e("div",{class:"filter-form-col",children:[e("div",{children:e("b",{children:e(h,{id:"uqf7Yq"})})}),kr.map(E=>e("div",{children:[e("label",{class:Xi.includes(E)?"insignificant":"",children:[e("input",{type:"checkbox",name:"context",value:E,defaultChecked:d?d.includes(E):!0,disabled:r==="loading"})," ",s(Sr[E]),Xi.includes(E)?"*":""]})," "]})),e("p",{children:e("small",{class:"insignificant",children:e(h,{id:"m0G499"})})})]}),e("div",{class:"filter-form-col",children:[l&&e(h,{id:"ucJk3m",components:{0:e("b",{}),1:e(js,{expiresAt:a,showNeverExpires:!0})}}),e("div",{children:[e("label",{for:"filters-expires_in",children:o(l?{id:"BcNdg+"}:{id:"agO/T/"})}),e("select",{id:"filters-expires_in",name:"expires_in",disabled:r==="loading",defaultValue:l?void 0:0,children:[l&&e("option",{}),_r.map(E=>e("option",{value:E,children:typeof jn[E]=="function"?jn[E]():s(jn[E])}))]})]}),e("p",{children:[e(h,{id:"blQMpa"}),e("br",{}),e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"warn",defaultChecked:p==="warn"||!l,disabled:r==="loading"})," ",e(h,{id:"jbreWy"})]})," ",e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"hide",defaultChecked:p==="hide",disabled:r==="loading"})," ",e(h,{id:"zNCBmf"})]})]})]})]}),e("footer",{class:"filter-form-footer",children:[e("span",{children:[e("button",{type:"submit",disabled:r==="loading",children:o(l?{id:"tfDRzk"}:{id:"hYgDIe"})})," ",e(Be,{abrupt:!0,hidden:r!=="loading"})]}),l&&e(ut,{disabled:r==="loading",align:"end",menuItemClassName:"danger",confirmLabel:o({id:"BPjyR2"}),onClick:()=>{u("loading"),(async()=>{try{await c.v2.filters.$select(m).remove(),u("default"),i==null||i({state:"success"})}catch{u("error"),alert(o({id:"4Dh9J1"}))}})()},children:e("button",{type:"button",class:"light danger",onClick:()=>{},disabled:r==="loading",children:e(h,{id:"Jb6/SB"})})})]})]})})]})}function js({expiresAt:n,showNeverExpires:i}){const{_:s}=ue(),o=!!n,c=o&&new Date(n),r=o&&c<=new Date,[u,l]=Nt(d=>d+1,0);return ai(l,r||3e4),r?s({id:"M1RnFv"}):o?e(h,{id:"urGtsw",components:{0:e(Zt,{datetime:c})}}):i&&s({id:"O1Aswy"})}function Ar(){const{_:n}=ue(),{masto:i,instance:s}=le();et(n({id:"Xi1/bw"}),"/fh");const[o,c]=$("default"),[r,u]=$([]);return ne(()=>{c("loading"),(async()=>{try{const l=await xn();u(l),c("default")}catch{c("error")}})()},[]),e("div",{id:"followed-hashtags-page",class:"deck-container",tabIndex:"-1",children:e("div",{class:"timeline-deck deck",children:[e("header",{children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(zt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(h,{id:"Xi1/bw"})}),e("div",{class:"header-side"})]})}),e("main",{children:r.length>0?e(O,{children:[e("ul",{class:"link-list",children:r.map(l=>e("li",{children:e(ge,{to:s?`/${s}/t/${l.name}`:`/t/${l.name}`,children:[e(T,{icon:"hashtag",alt:"#"})," ",e("span",{children:l.name})]})}))}),r.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(h,{id:"2S/uvJ",values:{0:r.length}})})})]}):o==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):o==="error"?e("p",{class:"ui-state",children:e(h,{id:"2AeREO"})}):e("p",{class:"ui-state",children:e(h,{id:"vKsGhk"})})})]})})}const Er=20;function _i({title:n,path:i,id:s,...o}){const{_:c}=ue();et(n||c({id:"following.title"}),i||"/following");const{masto:r,streaming:u,instance:l}=le(),d=Ve(A),a=j(),m=j();__BENCHMARK.end("time-to-following");const b=Qe("@pixelfed/home-include-reblogs");async function g(f){var w;(f||!a.current)&&(__BENCHMARK.start("fetch-home-first"),a.current=r.v1.timelines.home.list({limit:Er})),b&&((w=a.current)!=null&&w.nextParams)&&(typeof a.current.nextParams=="string"?a.current.nextParams+="&include_reblogs=true":a.current.nextParams.include_reblogs=!0);const y=await a.current.next();let{value:v}=y;if(v!=null&&v.length){let S=!1;f&&(v[0].id!==m.current&&(S=!0),m.current=v[0].id),v.forEach(k=>{Je(k,l)}),v=Ki(v,l),f&&S&&qa(),Hs(v,l),v.sort((k,_)=>{const x=new Date(k.createdAt);return new Date(_.createdAt)-x})}return __BENCHMARK.end("fetch-home-first"),{...y,value:v}}async function p(){var f;try{const y={limit:5,since_id:m.current};Qe("@pixelfed/home-include-reblogs")&&(y.include_reblogs=!0);const v=await r.v1.timelines.home.list(y).next();let{value:w}=v;const S=((f=w[0])==null?void 0:f.id)===m.current;return!!(w!=null&&w.length&&!S&&(m.current=w[0].id,w=Ki(w,l),w=Mt(w,"home"),w.some(k=>!k.reblog)))}catch{return!1}}return ne(()=>{let f;return(async()=>{if(u){f=u.user.subscribe();for await(const y of f){if(!f)break;if(y.event==="status.update"){const v=y.payload;Je(v,l)}else if(y.event==="delete"){const v=y.payload,w=ps(v,l);w&&(w._deleted=!0)}}}})(),()=>{var y;(y=f==null?void 0:f.unsubscribe)==null||y.call(f),f=null}},[u]),e(It,{title:n||c({id:"following.title"}),id:s||"following",emptyText:c({id:"nJEKbY"}),errorText:c({id:"7QSeK6"}),instance:l,fetchItems:g,checkForUpdates:p,useItemID:!0,boostsCarousel:d.settings.boostsCarousel,...o,filterContext:"home",showFollowedTags:!0,showReplyParent:!0})}const Rr=20,Lr=4,Ji=Lr+1;function Vs({media:n,columnMode:i,...s}){const{_:o}=ue();let{hashtag:c,...r}=i?{}:Et();s.hashtag&&(c=s.hashtag);let u=c.trim().split(/[\s+]+/);u.sort(),c=u[0];const[l,d]=gt(),a=n||!!l.get("media"),m=a?"?media=1":"",{masto:b,instance:g,authenticated:p}=le({instance:(s==null?void 0:s.instance)||r.instance}),{masto:f,instance:y,authenticated:v}=le(),w=u.map(M=>`#${M}`).join(" "),S=o(g?a?{id:"kH0rA0",values:{hashtagTitle:w,instance:g}}:{id:"IK0zKi",values:{hashtagTitle:w,instance:g}}:a?{id:"hHSI3w",values:{hashtagTitle:w}}:{id:"+ZzjRY",values:{hashtagTitle:w}});et(S,"/:instance?/t/:hashtag");const k=j(),_=Te(()=>oi(),[]),x=j(void 0);async function C(M){const H=await b.v1.timelines.tag.$select(c).list({limit:Rr,any:u.slice(1),maxId:M?void 0:x.current,onlyMedia:a?!0:void 0}).next();let{value:U}=H;return U!=null&&U.length&&(M&&(k.current=U[0].id),U.forEach(K=>{Je(K,g,{skipThreading:a||_})}),x.current=U[U.length-1].id),{...H,value:U}}async function I(){var M;try{const H=await b.v1.timelines.tag.$select(c).list({limit:1,any:u.slice(1),since_id:k.current,onlyMedia:a}).next();let{value:U}=H;const K=((M=U[0])==null?void 0:M.id)===k.current;return U!=null&&U.length&&!K?(U=Mt(U,"public"),!0):!1}catch{return!1}}const[E,L]=$("default"),[z,D]=$();ne(()=>{(async()=>{try{const M=await b.v1.tags.$select(c).fetch();D(M)}catch{}})()},[c]);const oe=u.length>=Ji,[ee,W]=$("default"),[Z,B]=$([]),[Y,ce]=$(!1);return ne(()=>{p&&(async()=>{try{const M=await b.v1.featuredTags.list();B(M),ce(M.some(H=>H.name.toLowerCase()===c.toLowerCase()))}catch{}})()},[]),e(It,{title:S,titleComponent:!!g&&e("h1",{class:"header-double-lines",children:[e("b",{dir:"auto",children:w}),e("div",{children:g})]}),id:"hashtag",instance:g,emptyText:o({id:"CNSLAW"}),errorText:o({id:"yjj6Ll"}),fetchItems:C,checkForUpdates:I,useItemID:!0,view:a||_?"media":void 0,refresh:a,filterContext:"public",headerEnd:e(lt,{portal:!0,setDownOverflow:!0,overflow:"auto",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:o({id:"2FYpfJ"})})}),children:[!!z&&u.length===1&&e(O,{children:[e(ut,{subMenu:!0,confirm:z.following,confirmLabel:o({id:"ctJi7k",values:{hashtag:c}}),disabled:E==="loading"||!p,onClick:()=>{L("loading"),z.following?b.v1.tags.$select(c).unfollow().then(()=>{D({...z,following:!1}),me(o({id:"doK/ij",values:{hashtag:c}}))}).catch(M=>{alert(M)}).finally(()=>{L("default")}):b.v1.tags.$select(c).follow().then(()=>{D({...z,following:!0}),me(o({id:"R9+aEN",values:{hashtag:c}}))}).catch(M=>{alert(M)}).finally(()=>{L("default")})},children:z.following?e(O,{children:[e(T,{icon:"check-circle"})," ",e("span",{children:e(h,{id:"HOSk7R"})})]}):e(O,{children:[e(T,{icon:"plus"})," ",e("span",{children:e(h,{id:"MKEPCY"})})]})}),e(Ie,{type:"checkbox",checked:Y,disabled:ee==="loading"||!p,onClick:()=>{if(W("loading"),Y){const M=Z.find(H=>H.name.toLowerCase()===c.toLowerCase()).id;M?b.v1.featuredTags.$select(M).remove().then(()=>{ce(!1),me(o({id:"VH+Tf9"})),B(Z.filter(H=>H.id!==M))}).catch(H=>{}).finally(()=>{W("default")}):me(o({id:"3OLv47"}))}else b.v1.featuredTags.create({name:c}).then(M=>{ce(!0),me(o({id:"9ra4hn"})),B(Z.concat(M))}).catch(M=>{}).finally(()=>{W("default")})},children:Y?e(O,{children:[e(T,{icon:"check-circle"}),e("span",{children:e(h,{id:"9ra4hn"})})]}):e(O,{children:[e(T,{icon:"check-circle"}),e("span",{children:e(h,{id:"UlJ3QN"})})]})}),e(Ze,{})]}),!_&&e(O,{children:[e(_s,{className:"plain",children:e(h,{id:"cSev+j"})}),e(Ie,{type:"checkbox",checked:!!a,onClick:()=>{a?l.delete("media"):l.set("media","1"),d(l)},children:[e(T,{icon:"check-circle",alt:"☑️"})," ",e("span",{class:"menu-grow",children:e(h,{id:"eK4SL/"})})]}),e(Ze,{})]}),e(Yo,{className:"menu-field",disabled:oe,children:({ref:M})=>e("form",{onSubmit:H=>{var K,pe;H.preventDefault();const U=(pe=(K=H.target[0].value)==null?void 0:K.trim)==null?void 0:pe.call(K);U&&!u.some(J=>J.toLowerCase()===U.toLowerCase())&&(u.push(U),u.sort(),location.hash=g?`/${g}/t/${u.join("+")}`:`/t/${u.join("+")}${m}`)},children:[e(T,{icon:"hashtag"}),e("input",{ref:M,type:"text",placeholder:oe?he._({id:"ouWc/D",values:{TOTAL_TAGS_LIMIT:Ji}}):o({id:"cxL5F9"}),required:!0,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:"[^#][^\\s#]+[^#]",disabled:oe,dir:"auto"})]})}),e(jo,{takeOverflow:!0,children:u.map((M,H)=>e(Ie,{disabled:u.length===1,onClick:U=>{u.splice(H,1),u.sort(),location.hash=g?`/${g}/t/${u.join("+")}${m}`:`/t/${u.join("+")}${m}`},children:[e(T,{icon:"x",alt:o({id:"OISAkj"}),class:"danger-icon"}),e("span",{class:"bidi-isolate",children:[e("span",{class:"more-insignificant",children:"#"}),M]})]},M))}),e(Ze,{}),e(Ie,{disabled:!v,onClick:()=>{if(A.shortcuts.length>=kt){alert(he._({id:"XN1xAY",values:{SHORTCUTS_LIMIT:kt}}));return}const M={type:"hashtag",hashtag:u.join(" "),instance:g,media:a?"on":void 0};A.shortcuts.some(U=>U.type===M.type&&U.hashtag.split(/[\s+]+/).sort().join(" ")===M.hashtag.split(/[\s+]+/).sort().join(" ")&&(U.instance?U.instance===M.instance:!0)&&(U.media?!!U.media==!!M.media:!0))?alert(o({id:"kfeQnS"})):(A.shortcuts.push(M),me(o({id:"MIhb91"})))},children:[e(T,{icon:"shortcut"})," ",e("span",{children:e(h,{id:"i02Lq/"})})]}),e(Ie,{onClick:()=>{let M=prompt(o({id:"2MQ2cd"}));if(!/\./.test(M)){M&&alert(o({id:"7WddtO"}));return}M&&(M=M.toLowerCase().trim(),location.hash=`/${M}/t/${u.join("+")}${m}`)},children:[e(T,{icon:"bus"})," ",e("span",{children:e(h,{id:"Sq04Yc"})})]}),y!==g&&e(Ie,{onClick:()=>{location.hash=`/${y}/t/${u.join("+")}${m}`},children:[e(T,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"iAzCp4",values:{currentInstance:y},components:{0:e("b",{})}})})]})]})},g+w)}const $r=20;function Ks(n){var S;const{_:i}=ue(),s=Ve(A),{masto:o,instance:c}=le(),r=(n==null?void 0:n.id)||((S=Et())==null?void 0:S.id),u=j(),l=j();async function d(k){(k||!l.current)&&(l.current=o.v1.timelines.list.$select(r).list({limit:$r}));const _=await l.current.next();let{value:x}=_;return x!=null&&x.length&&(k&&(u.current=x[0].id),x.forEach(C=>{Je(C,c)})),{..._,value:x}}async function a(){var k;try{const _=await o.v1.timelines.list.$select(r).list({limit:1,since_id:u.current});let{value:x}=_;const C=((k=x[0])==null?void 0:k.id)===u.current;return x!=null&&x.length&&!C?(x=Mt(x,"home"),!0):!1}catch{return!1}}const[m,b]=$([]);ne(()=>{rn().then(b)},[]);const[g,p]=$({title:"List"});et(g.title,"/l/:id"),ne(()=>{(async()=>{try{const k=await Ds(r);p(k)}catch{}})()},[r]);const[f,y]=$(!1),[v,w]=$(!1);return e(O,{children:[e(It,{title:g.title,id:"list",emptyText:i({id:"KkDhfU"}),errorText:i({id:"7QSeK6"}),instance:c,fetchItems:d,checkForUpdates:a,useItemID:!0,boostsCarousel:s.settings.boostsCarousel,filterContext:"home",showReplyParent:!0,headerStart:e(lt,{overflow:"auto",menuButton:e("button",{type:"button",class:"plain",children:[e(T,{icon:"list",size:"l",alt:i({id:"h16FyT"})}),e(T,{icon:"chevron-down",size:"s"})]}),children:[e(qe,{to:"/l",children:e("span",{children:e(h,{id:"BHWx+g"})})}),(m==null?void 0:m.length)>0&&e(O,{children:[e(Ze,{}),m.map(k=>e(qe,{to:`/l/${k.id}`,children:e("span",{children:k.title})},k.id))]})]}),headerEnd:e(lt,{portal:!0,setDownOverflow:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[e(Ie,{onClick:()=>y({list:g}),children:[e(T,{icon:"pencil",size:"l"}),e("span",{children:e(h,{id:"ePK91l"})})]}),e(Ie,{onClick:()=>w(!0),children:[e(T,{icon:"group",size:"l"}),e("span",{children:e(h,{id:"hB02vO"})})]})]})},r),f&&e(Ye,{onClick:k=>{k.target===k.currentTarget&&y(!1)},children:e(vi,{list:f==null?void 0:f.list,onClose:k=>{k.state==="success"&&k.list?p(k.list):k.state==="deleted"&&(location.hash="/l"),y(!1)}})}),v&&e(Ye,{onClick:k=>{k.target===k.currentTarget&&w(!1)},children:e(Dr,{listID:r,onClose:()=>w(!1)})})]})}const Mr=40;function Dr({listID:n,onClose:i}){const{_:s}=ue(),{masto:o,instance:c}=le(),[r,u]=$([]),[l,d]=$("default"),[a,m]=$(!1),b=j();async function g(p){m(!1),d("loading"),(async()=>{try{(p||!b.current)&&(b.current=o.v1.lists.$select(n).accounts.list({limit:Mr}));const f=await b.current.next();let{done:y,value:v}=f;v!=null&&v.length?(u(p?v:r.concat(v)),m(!y)):m(!1),d("default")}catch{d("error")}})()}return ne(()=>{g(!0)},[]),e("div",{class:"sheet",id:"list-manage-members-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"hB02vO"})})}),e("main",{children:e("ul",{children:[r.map(p=>e("li",{children:[e(dt,{account:p,instance:c}),e(Nr,{account:p,listID:n})]},p.id)),a&&l==="default"&&e(_t,{as:"li",onChange:p=>p&&g(),children:e("button",{type:"button",class:"light block",onClick:g,children:e(h,{id:"uXRAkV"})})})]})})]})}function Nr({account:n,listID:i}){const{_:s}=ue(),{masto:o}=le(),[c,r]=$("default"),[u,l]=$(!1);return e(ut,{confirm:!u,confirmLabel:e("span",{children:e(h,{id:"j5n9Ry",values:{0:n.username},components:{0:e("span",{class:"bidi-isolate"})}})}),align:"end",menuItemClassName:"danger",onClick:()=>{u?(r("loading"),(async()=>{try{await o.v1.lists.$select(i).accounts.create({accountIds:[n.id]}),r("default"),l(!1)}catch{r("error")}})()):(r("loading"),(async()=>{try{await o.v1.lists.$select(i).accounts.remove({accountIds:[n.id]}),r("default"),l(!0)}catch{r("error")}})())},children:e("button",{type:"button",class:`light ${u?"":"danger"}`,disabled:c==="loading",children:s(u?{id:"m16xKo"}:{id:"MWIaew"})})})}const Pr={mention:["account","status"],status:["account","status"],reblog:["account","status"],follow:["account"],follow_request:["account"],favourite:["account","status"],poll:["status"],update:["status"]},Or=["favourite","reblog","follow"],Gs=n=>Or.includes(n);function Ws(n){return n.filter(i=>{const{type:s,id:o,createdAt:c}=i;if(!s)return!1;const r=Pr[s];return r!=null&&r.length?r.every(u=>!!i[u]):!0})}function Zs(n){if(n!=null&&n.notificationGroups){const{accounts:i=[],notificationGroups:s=[],statuses:o=[]}=n;return s.map(c=>{const{sampleAccountIds:r,statusId:u}=c,l=(r==null?void 0:r.map(a=>i.find(m=>m.id===a)))||[],d=(o==null?void 0:o.find(a=>a.id===u))||null;return{...c,sampleAccounts:l,status:d}})}return n}function zr(n){const i=n.map(u=>{const{latestPageNotificationAt:l,mostRecentNotificationId:d,sampleAccounts:a,notificationsCount:m}=u;return{id:""+d,createdAt:l,account:a[0],...u}}),s={},o=[];for(let u=0;u<i.length;u++){const l=i[u],{type:d,status:a,createdAt:m,notificationsCount:b,sampleAccounts:g,groupKey:p}=l,f=m?new Date(m).toLocaleDateString():"";let y=d;b>0&&(g==null||g.length),(d==="favourite"||d==="reblog")&&(y="favourite+reblog");const v=`${a==null?void 0:a.id}-${y}-${f}`,w=s[v];if(!Gs(d))o.push(l);else if(w)g.forEach(S=>{const k=w.sampleAccounts.find(_=>_.id===S.id);k?(k._types.push(d),k._types.sort().reverse()):w.sampleAccounts.push({...S,_types:[d]})}),w.notificationsCount=Math.min(w.notificationsCount,b),w._notificationsCount.push(b),w._accounts=w.sampleAccounts,w._groupKeys.push(p);else{const S=g.map(k=>({...k,_types:[d]}));s[v]={...l,sampleAccounts:S,type:y,_accounts:S,_groupKeys:p?[p]:[],_notificationsCount:[b]},o.push(s[v])}}const c={},r=[];for(let u=0;u<o.length;u++){const l=o[u],{type:d,account:a,_accounts:m,sampleAccounts:b,createdAt:g,groupKey:p}=l,f=g?new Date(g).toLocaleDateString():"",y=(b==null?void 0:b.length)===1||(m==null?void 0:m.length)===1;if((d==="favourite"||d==="reblog"||d==="favourite+reblog")&&y){const v=`${a==null?void 0:a.id}-${d}-${f}`,w=c[v];if(w)w._statuses.push(l.status),w._ids+=`-${l.id}`,w._groupKeys.push(p);else{let S=c[v]={...l,type:d,_ids:l.id,_statuses:[l.status],_groupKeys:p?[p]:[]};r.push(S)}}else r.push(l)}return r}function Ur(n){n=Ws(n);const i={},s=[];for(let r=0,u=0;r<n.length;r++){const l=n[r],{id:d,status:a,account:m,type:b,createdAt:g}=l,p=g?new Date(g).toLocaleDateString():"";let f=b;(b==="favourite"||b==="reblog")&&(f="favourite+reblog");const y=`${a==null?void 0:a.id}-${f}-${p}`,v=i[y];if(!Gs(b))s[u++]=l;else if(v!=null&&v.account){const w=v._accounts.find(S=>S.id===m.id);w?(w._types.push(b),w._types.sort().reverse(),v._ids+=`-${d}`):(m._types=[b],v._accounts.push(m),v._ids+=`-${d}`)}else{m&&(m._types=[b]);let w=i[y]={...l,type:f,_ids:d,_accounts:m?[m]:[]};s[u++]=w}}const o={},c=[];for(let r=0,u=0;r<s.length;r++){const l=s[r],{id:d,account:a,_accounts:m,type:b,createdAt:g}=l,p=g?new Date(g).toLocaleDateString():"";if(b==="favourite+reblog"&&a&&m.length===1){const f=`${a==null?void 0:a.id}-${b}-${p}`,y=o[f];if(y)y._statuses.push(l.status),y._ids+=`-${d}`;else{let v=o[f]={...l,type:b,_ids:d,_statuses:[l.status]};c[u++]=v}}else c[u++]=l}return c}const Qi=20,Br=new URLSearchParams;function Xs({columnMode:n,...i}){const{_:s}=ue(),{masto:o,instance:c}=le(),[r]=n?[Br]:gt(),[u,l]=$(null),d=(i==null?void 0:i.type)||r.get("type")||u;et(s(d==="private"?{id:"2BApYc"}:{id:"/bZzdR"}),"/mentions");const a=j(),m=j();async function b(S){(S||!a.current)&&(a.current=o.v1.notifications.list({limit:Qi,types:["mention"]}));const k=await a.current.next();let{value:_}=k;return _!=null&&_.length&&(_=Ws(_),S&&(m.current=_[0].id),_.forEach(({status:x})=>{Je(x,c)})),{...k,value:_==null?void 0:_.map(x=>x.status)}}const g=j(),p=j();async function f(S){(S||!g.current)&&(g.current=o.v1.conversations.list({limit:Qi}));const k=await g.current.next();let{value:_}=k;return _=_==null?void 0:_.filter(x=>x.lastStatus),_!=null&&_.length&&(S&&(p.current=_[0].lastStatus.id),_.forEach(({lastStatus:x})=>{Je(x,c)})),{...k,value:_==null?void 0:_.map(x=>x.lastStatus)}}function y(...S){return d==="private"?f(...S):b(...S)}async function v(){var S;if(d==="private")try{const k=await o.v1.conversations.list({limit:1,since_id:p.current}).next();let{value:_}=k;const x=((S=_[0])==null?void 0:S.id)===p.current;return _!=null&&_.length&&!x?(p.current=_[0].lastStatus.id,!0):!1}catch{return!1}else try{const k=await o.v1.notifications.list({limit:1,types:["mention"],since_id:m.current}).next();let{value:_}=k;return _!=null&&_.length?(m.current=_[0].id,!0):!1}catch{return!1}}const w=Te(()=>e("div",{class:"filter-bar centered",children:[e(ge,{to:"/mentions",class:d?"":"is-active",onClick:S=>{n&&(S.preventDefault(),l(null))},children:e(h,{id:"N40H+G"})}),e(ge,{to:"/mentions?type=private",class:d==="private"?"is-active":"",onClick:S=>{n&&(S.preventDefault(),l("private"))},children:e(h,{id:"zwBp5t"})})]}),[d]);return e(It,{title:s({id:"/bZzdR"}),id:"mentions",emptyText:s({id:"03jFGT"}),errorText:s({id:"pqR9KF"}),instance:c,fetchItems:y,checkForUpdates:v,useItemID:!0,timelineStart:w,refresh:d})}const Fr=80,Hr=20,qr=new URLSearchParams,un={block:"center",inline:"center",behavior:"smooth"},Js=fs(()=>Qe("@mastodon/grouped-notifications"),{maxAge:1e3*60*5});function ei(n={}){const{masto:i}=le();return A.settings.groupedNotificationsAlpha&&Js()?i.v2.notifications.list({limit:Hr,...n}):i.v1.notifications.list({limit:Fr,...n})}function Qs(n){return A.settings.groupedNotificationsAlpha&&Js()?zr(n):Ur(n)}const Yr=["forNotFollowing","forNotFollowers","forNewAccounts","forPrivateMentions","forLimitedAccounts"],jr={forNotFollowing:{id:"d+hDoa"},forNotFollowers:{id:"oAwuQj"},forNewAccounts:{id:"Srs8u7"},forPrivateMentions:{id:"IDC5Uw"},forLimitedAccounts:{id:"XMGM2e"}};function Vr({columnMode:n}){var de;const{_:i,_:s}=ue();et(s({id:"iDNBZe"}),"/notifications");const{masto:o,instance:c}=le(),r=Ve(A),[u,l]=$("default"),[d]=n?[qr]:gt(),a=d.get("id"),m=d.get("access_token"),[b,g]=$(!1),[p,f]=$(!1),y=j(),{nearReachEnd:v,scrollDirection:w,reachStart:S,nearReachStart:k}=Ya({scrollableRef:y}),_=w==="end"&&!k,[x,C]=$([]),[I,E]=$([]),L=j();async function z(N){var F;if((N||!L.current)&&(L.current=ei({excludeTypes:["follow_request"]})),/max_id=($|&)/i.test((F=L.current)==null?void 0:F.nextParams))return{done:!0};const ae=await L.current.next(),xe=Zs(ae.value);if(xe!=null&&xe.length){xe.forEach(Re=>{Je(Re.status,c,{skipThreading:!0})});const be=Qs(xe);N?(A.notificationsLast=be[0],A.notifications=be,o.v1.markers.create({notifications:{lastReadId:be[0].id}}).catch(()=>{})):A.notifications.push(...be)}return A.notificationsShowNew=!1,A.notificationsLastFetchTime=Date.now(),ae}async function D(){try{return await o.v1.followRequests.list({limit:80})}catch{return[]}}const oe=()=>{l("loading"),(async()=>{try{const N=await D();C(N),l("default")}catch{l("error")}})()};async function ee(){try{return await o.v1.announcements.list()}catch{return[]}}const W=Qe("@mastodon/filtered-notifications"),[Z,B]=$(!1),[Y,ce]=$({});function M(){return o.v2.notifications.policy.fetch().catch(()=>{})}function H(){M().then(N=>{ce(N)}).catch(()=>{})}const[U,K]=$(null);function pe(){return o.v1.notifications.requests.list()}const J=N=>{_e(!1),l("loading"),(async()=>{try{const ae=z(N);N&&(ee().then(F=>{F.sort((be,Re)=>{const R=new Date(be.updatedAt||be.createdAt);return new Date(Re.updatedAt||Re.createdAt)-R}),E(F)}).catch(()=>{}),D().then(F=>{C(F)}).catch(()=>{}),W&&H());const{done:xe}=await ae;g(!xe),l("default")}catch{l("error")}})()};ne(()=>{J(!0)},[]),ne(()=>{S&&J(!0)},[S]);const[ye,_e]=$(!1),q=rt(({disableIdleCheck:N=!1}={})=>{var ae;u!=="loading"&&r.settings.autoRefresh&&((ae=y.current)==null?void 0:ae.scrollTop)<16&&(N||window.__IDLE__)&&!Kr()&&J(!0)},[r.notificationsShowNew,r.settings.autoRefresh,u]),re=j();jt(N=>{if(N){const ae=Date.now()-re.current;!re.current||ae>1e3*3?q({disableIdleCheck:!0}):re.current=Date.now()}});const Ae=j(!0);ne(()=>{let N=ko(A,"notificationsShowNew",ae=>{if(Ae.current){Ae.current=!1;return}u!=="loading"&&(ae&&q(),_e(ae))});return()=>N==null?void 0:N()},[]);const De=new Date,Ne=new Date(De-24*60*60*1e3);let Pe=new Date;const Ue=!r.notifications.some(N=>new Date(N.createdAt).toDateString()===De.toDateString()),Ce=j();ne(()=>{a&&(A.routeNotification={id:a,accessToken:atob(m)})},[a,m]);const[Q,ke]=$(null);ne(async()=>{var F,be,Re;const N=new Date;if(N.getMonth()!==11||!Qe("@mastodon/annual-report"))return;let ae=we.account.get("annualReportNotification");if(ae){ke(ae);return}const xe=ei({types:["annual_report"]});try{const R=await xe.next();ae=(be=(F=R==null?void 0:R.value)==null?void 0:F.notificationGroups)==null?void 0:be[0],((Re=ae==null?void 0:ae.annualReport)==null?void 0:Re.year)==N.getFullYear()&&(ke(ae),we.account.set("annualReportNotification",ae))}catch{}},[]);const Le=".notification",fe=He("j",()=>{const N=document.activeElement.closest(Le),ae=N==null?void 0:N.getBoundingClientRect(),xe=Array.from(y.current.querySelectorAll(Le));if(N&&ae.top<y.current.clientHeight&&ae.bottom>0){const F=xe.indexOf(N);let be=xe[F+1];be&&(be.focus(),be.scrollIntoView(un))}else{const F=xe.find(be=>{const Re=be.getBoundingClientRect();return Re.top>=44&&Re.left>=0});F&&(F.focus(),F.scrollIntoView(un))}}),X=He("k",()=>{const N=document.activeElement.closest(Le),ae=N==null?void 0:N.getBoundingClientRect(),xe=Array.from(y.current.querySelectorAll(Le));if(N&&ae.top<y.current.clientHeight&&ae.bottom>0){const F=xe.indexOf(N);let be=xe[F-1];be&&(be.focus(),be.scrollIntoView(un))}else{const F=xe.find(be=>{const Re=be.getBoundingClientRect();return Re.top>=44&&Re.left>=0});F&&(F.focus(),F.scrollIntoView(un))}}),Se=He(["enter","o"],()=>{const N=document.activeElement.closest(Le),ae=N==null?void 0:N.querySelector(".status-link");ae&&ae.click()}),P=new Date,te=Te(()=>mt(P,{forceOpts:{weekday:"long"}}),[P]);return e("div",{id:"notifications-page",class:"deck-container",ref:N=>{y.current=N,fe(N),X(N),Se(N)},tabIndex:"-1",children:[e("div",{class:`timeline-deck deck ${p?"only-mentions":""}`,children:[e("header",{hidden:_,onClick:N=>{var ae;N.target.closest("a, button")||(ae=y.current)==null||ae.scrollTo({top:0,behavior:"smooth"})},onDblClick:N=>{N.target.closest("a, button")||J(!0)},class:u==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(zt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l",alt:s({id:"i0qMbr"})})})]}),e("h1",{children:e(h,{id:"iDNBZe"})}),e("div",{class:"header-side",children:W&&e("button",{type:"button",class:"button plain4",onClick:()=>{B(!0)},children:e(T,{icon:"settings",size:"l",alt:s({id:"a/+arl"})})})})]}),ye&&u!=="loading"&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:()=>{var N;J(!0),(N=y.current)==null||N.scrollTo({top:0,behavior:"smooth"})},children:[e(T,{icon:"arrow-up"})," ",e(h,{id:"Jy9RU/"})]})]}),I.length>0&&e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e("details",{class:"announcements",children:[e("summary",{children:[e("span",{children:[e(T,{icon:"announce",class:"announcement-icon",size:"l"})," ",e(h,{id:"0whvLM",values:{0:I.length}})," ",e("small",{class:"insignificant",children:c})]}),I.length>1&&e("span",{class:"announcements-nav-buttons",children:I.map((N,ae)=>e("button",{type:"button",class:"plain2 small",onClick:()=>{var xe;(xe=Ce.current)==null||xe.children[ae].scrollIntoView({behavior:"smooth",block:"nearest"})},children:ae+1}))})]}),e("ul",{class:`announcements-list-${I.length>1?"multiple":"single"}`,ref:Ce,children:I.map(N=>e("li",{children:e(Gr,{announcement:N})}))})]})})}),x.length>0&&e("div",{class:"follow-requests",children:[e("h2",{class:"timeline-header",children:e(h,{id:"6Fs1Ba"})}),x.length>5?e("details",{children:[e("summary",{children:e(h,{id:"7dHKu4",values:{0:x.length}})}),e("ul",{children:x.map(N=>e("li",{children:[e(dt,{account:N}),e(Qn,{accountID:N.id,onChange:()=>{}})]},N.id))})]}):e("ul",{children:x.map(N=>e("li",{children:[e(dt,{account:N}),e(Qn,{accountID:N.id,onChange:()=>{}})]},N.id))})]}),W&&((de=Y==null?void 0:Y.summary)==null?void 0:de.pendingRequestsCount)>0&&e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e("div",{class:"filtered-notifications",children:e("details",{onToggle:async N=>{const{open:ae}=N.target;if(ae){const xe=await pe();K(xe)}},children:[e("summary",{children:e(h,{id:"N3Bq0f",values:{0:Y.summary.pendingRequestsCount}})}),U?(U==null?void 0:U.length)>0&&e("ul",{children:U.map(N=>{var ae,xe;return e("li",{children:[e("div",{class:"request-notifcations",children:[!((ae=N.lastStatus)!=null&&ae.id)&&e(dt,{useAvatarStatic:!0,showStats:!0,account:N.account}),((xe=N.lastStatus)==null?void 0:xe.id)&&e("div",{class:"last-post",children:e(ge,{class:"status-link",to:`/${c}/s/${N.lastStatus.id}`,children:e(Ke,{status:N.lastStatus,size:"s",readOnly:!0})})}),e(Zr,{request:N})]}),e(Xr,{request:N,onChange:()=>{J(!0)}})]},N.id)})}):e("p",{class:"ui-state",children:e(Be,{abrupt:!0})})]})})})}),Q&&e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e(an,{notification:Q})})}),e("div",{id:"mentions-option",children:e("label",{children:[e("input",{type:"checkbox",checked:p,onChange:N=>{f(N.target.checked)}})," ",e(h,{id:"0udtPI"})]})}),e("h2",{class:"timeline-header",children:[e(h,{id:"ecUA8p"})," ",e("small",{class:"insignificant bidi-isolate",children:te})]}),Ue&&e("p",{class:"ui-state insignificant",children:u==="default"?s({id:"KS7iJH"}):e(O,{children:"…"})}),r.notifications.length?e(O,{children:r.notifications.filter(N=>N.type!=="follow_request").map(N=>{if(p&&N.type!=="mention")return null;const ae=new Date(N.createdAt),xe=ae.toDateString()!==Pe.toDateString();xe&&(Pe=ae);const F=ae.toDateString()===Ne.toDateString()?s({id:"y/0uwd"}):mt(Pe,{hideTime:!0}),be=mt(Pe,{forceOpts:{weekday:"long"}});return e(O,{children:[xe&&e("h2",{class:"timeline-header",children:[e("span",{children:F})," ",e("small",{class:"insignificant bidi-isolate",children:be})]}),e(an,{instance:c,notification:N},N._ids||N.id)]},N._ids||N.id)})}):e(O,{children:[u==="loading"&&e(O,{children:e("ul",{class:"timeline flat",children:Array.from({length:5}).map((N,ae)=>e("li",{class:"notification skeleton",children:[e("div",{class:"notification-type",children:e(T,{icon:"notification",size:"xl"})}),e("div",{class:"notification-content",children:e("p",{children:"███████████ ████"})})]}))})}),u==="error"&&e("p",{class:"ui-state",children:[e(h,{id:"gjzl8E"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>J(!0),children:e(h,{id:"KDw4GX"})})]})]}),b&&e(_t,{onChange:N=>{N&&J()},children:e("button",{type:"button",class:"plain block",disabled:u==="loading",onClick:()=>J(),style:{marginBlockEnd:"6em"},children:u==="loading"?e(Be,{abrupt:!0}):e(h,{id:"uXRAkV"})})})]}),W&&Z&&e(Ye,{onClick:N=>{N.target===N.currentTarget&&B(!1)},children:e("div",{class:"sheet",id:"notifications-settings",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>B(!1),children:e(T,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(h,{id:"a/+arl"})})}),e("main",{children:e("form",{onSubmit:N=>{N.preventDefault();const{forNotFollowing:ae,forNotFollowers:xe,forNewAccounts:F,forPrivateMentions:be,forLimitedAccounts:Re}=N.target,R={...Y,forNotFollowing:ae.value,forNotFollowers:xe.value,forNewAccounts:F.value,forPrivateMentions:be.value,forLimitedAccounts:Re.value};ce(R),B(!1),(async()=>{try{await o.v2.notifications.policy.update(R),me(s({id:"4+7X9i"}))}catch{}})()},children:[e("p",{children:e(h,{id:"WrkPTf"})}),e("div",{class:"notification-policy-fields",children:Yr.map(N=>{const ae=Y[N];return e("div",{children:e("label",{children:[i(jr[N]),e("select",{name:N,defaultValue:ae,class:"small",children:[e("option",{value:"accept",children:e(h,{id:"g3UF2V"})}),e("option",{value:"filter",children:e(h,{id:"o7J4JM"})}),e("option",{value:"drop",children:e(h,{id:"gbbkE7"})})]})]})},N)})}),e("p",{children:e("button",{type:"submit",children:e(h,{id:"tfDRzk"})})})]})})]})})]})}function Kr(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}function Gr({announcement:n}){const{instance:i}=le(),{contact:s}=ds(),o=s==null?void 0:s.account,{id:c,content:r,startsAt:u,endsAt:l,published:d,allDay:a,publishedAt:m,updatedAt:b,read:g,mentions:p,statuses:f,tags:y,emojis:v,reactions:w}=n,S=new Date(m),k=mt(S),_=new Date(b),x=mt(_);return e("div",{class:"announcement-block",children:[e(dt,{account:o}),e("div",{class:"announcement-content",onClick:gs({mentions:p,instance:i}),dangerouslySetInnerHTML:{__html:Gn(r,{emojis:v})}}),e("p",{class:"insignificant",children:[e("time",{datetime:S.toISOString(),children:mt(S)}),b&&x!==k&&e(O,{children:[" ","•"," ",e("span",{class:"ib",children:e(h,{id:"TbFrLc",values:{0:mt(_)},components:{0:e("time",{datetime:_.toISOString()})}})})]})]}),e("div",{class:"announcement-reactions",hidden:!0,children:w.map(C=>{const{name:I,count:E,me:L,staticUrl:z,url:D}=C;return e("button",{type:"button",class:`plain4 small ${L?"reacted":""}`,children:[D||z?e("img",{src:D||z,alt:I,width:"16",height:"16"}):e("span",{children:I})," ",e("span",{class:"count",children:Xe(E)})]})})})]})}function Wr(n){const{masto:i}=le();return i.v1.notifications.list({accountID:n})}function Zr({request:n}){var b;const{instance:i}=le(),[s,o]=$("loading"),{account:c,lastStatus:r}=n,[u,l]=$(!1),[d,a]=$([]);function m(){l(!1)}return ne(()=>{var g;(g=n==null?void 0:n.account)!=null&&g.id&&u&&(o("loading"),(async()=>{const p=await Wr(n.account.id);a(p||[]),o("default")})())},[u,(b=n==null?void 0:n.account)==null?void 0:b.id]),e(O,{children:[e("button",{type:"button",class:"plain4 request-notifications-account",onClick:()=>{l(!0)},children:[e(T,{icon:"notification",class:"more-insignificant"})," ",e("small",{children:e(h,{id:"H0wUNM",values:{0:c.username},components:{0:e("span",{class:"bidi-isolate"})}})})," ",e(T,{icon:"chevron-down"})]}),u&&e(Ye,{onClick:g=>{g.target===g.currentTarget&&m()},children:e("div",{class:"sheet",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:m,children:e(T,{icon:"x",alt:t`Close`})}),e("header",{children:e("b",{children:e(h,{id:"MXOmPt",values:{0:c.username},components:{0:e("span",{class:"bidi-isolate"})}})})}),e("main",{children:s==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):d.map(g=>e("div",{class:"notification-peek",onClick:p=>{const{target:f}=p;(p.target.tagName==="BUTTON"||p.target.tagName==="A")&&m()},children:e(an,{instance:i,notification:g,isStatic:!0})}))})]})})]})}function Xr({request:n,onChange:i}){const{_:s}=ue(),{masto:o}=le(),[c,r]=$("default"),[u,l]=$(null),d=u!==null;return e("p",{class:"notification-request-buttons",children:[e("button",{type:"button",disabled:c==="loading"||d,onClick:()=>{r("loading"),(async()=>{try{await o.v1.notifications.requests.$select(n.id).accept(),l("accept"),r("default"),i({request:n,state:"accept"}),me(s({id:"ZtBMwU",values:{0:n.account.username}}))}catch{r("error"),me(s({id:"S92JKG"}))}})()},children:e(h,{id:"h7peZQ"})})," ",e("button",{type:"button",disabled:c==="loading"||d,class:"light danger",onClick:()=>{r("loading"),(async()=>{try{await o.v1.notifications.requests.$select(n.id).dismiss(),l("dismiss"),r("default"),i({request:n,state:"dismiss"}),me(s({id:"pRqdUf",values:{1:n.account.username}}))}catch{r("error"),me(s({id:"S5aemF"}))}})()},children:e(h,{id:"1QfxQT"})}),e("span",{class:"notification-request-states",children:c==="loading"?e(Be,{abrupt:!0}):u==="accept"?e(T,{icon:"check-circle",alt:s({id:"bzMKg7"}),class:"notification-accepted"}):u==="dismiss"&&e(T,{icon:"x-circle",alt:s({id:"J6hrEy"}),class:"notification-dismissed"})})]})}const eo=ct(Vr),Jr=20;function ti({local:n,columnMode:i,...s}){const{_:o}=ue(),c=Ve(A),r=!!n,u=i?{}:Et(),{masto:l,instance:d}=le({instance:(s==null?void 0:s.instance)||u.instance}),{masto:a,instance:m}=le(),b=o(r?{id:"u96B/B",values:{instance:d}}:{id:"PgVqvd",values:{instance:d}});et(b,r?"/:instance?/p/l":"/:instance?/p");const g=j(),p=j();async function f(v){if(v||!p.current){const k={limit:Jr,local:r||void 0};!r&&Qe("@pixelfed/global-feed")&&(k.remote=!0),p.current=l.v1.timelines.public.list(k)}const w=await p.current.next();let{value:S}=w;return S!=null&&S.length&&(v&&(g.current=S[0].id),S.forEach(k=>{Je(k,d)})),{...w,value:S}}async function y(){var v;try{const w=await l.v1.timelines.public.list({limit:1,local:r,since_id:g.current}).next();let{value:S}=w;const k=((v=S[0])==null?void 0:v.id)===g.current;return S!=null&&S.length&&!k?(S=Mt(S,"public"),!0):!1}catch{return!1}}return e(It,{title:b,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:o(r?{id:"pJQgQV"}:{id:"cg0I+x"})}),e("div",{children:d})]}),id:"public",instance:d,emptyText:o({id:"BiZJ6G"}),errorText:o({id:"scd9lw"}),fetchItems:f,checkForUpdates:y,useItemID:!0,headerStart:e(O,{}),boostsCarousel:c.settings.boostsCarousel,filterContext:"public",headerEnd:e(lt,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:o({id:"2FYpfJ"})})}),children:[e(Ie,{href:r?`/#/${d}/p`:`/#/${d}/p/l`,children:r?e(O,{children:[e(T,{icon:"transfer"})," ",e("span",{children:e(h,{id:"dXMiUw"})})]}):e(O,{children:[e(T,{icon:"transfer"})," ",e("span",{children:e(h,{id:"t2B/we"})})]})}),e(Ze,{}),e(Ie,{onClick:()=>{let v=prompt(o({id:"2MQ2cd"}));if(!/\./.test(v)){v&&alert(o({id:"7WddtO"}));return}v&&(v=v.toLowerCase().trim(),location.hash=r?`/${v}/p/l`:`/${v}/p`)},children:[e(T,{icon:"bus"})," ",e("span",{children:e(h,{id:"Sq04Yc"})})]}),m!==d&&e(Ie,{onClick:()=>{location.hash=r?`/${m}/p/l`:`/${m}/p`},children:[e(T,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"iAzCp4",values:{currentInstance:m},components:{0:e("b",{})}})})]})]})},d+r)}const hn=5,Vn=40,Qr=new URLSearchParams,fn={block:"nearest",inline:"center",behavior:"smooth"};function to({columnMode:n,...i}){const{_:s}=ue(),o=n?{}:Et(),{masto:c,instance:r,authenticated:u}=le({instance:o.instance}),[l,d]=$("default"),[a]=n?[Qr]:gt(),m=j(),b=(i==null?void 0:i.query)||a.get("q"),g=n?"statuses":(i==null?void 0:i.type)||a.get("type");let p=s({id:"A1taO8"});if(b)switch(g){case"statuses":p=s({id:"6YeoAt",values:{q:b}});break;case"accounts":p=s({id:"fpgumQ",values:{q:b}});break;case"hashtags":p=s({id:"AuiMZZ",values:{q:b}});break;default:p=s({id:"wr3GZI",values:{q:b}})}et(p,"/search");const[f,y]=$(!1),v=j(0);ne(()=>{v.current=0},[b,g]);const w=j();yt(()=>{var M,H;(H=(M=w.current)==null?void 0:M.scrollTo)==null||H.call(M,0,0)},[b,g]);const[S,k]=$([]),[_,x]=$([]),[C,I]=$([]);ne(()=>{k([]),x([]),I([])},[b]);const E={statuses:S,accounts:_,hashtags:C},L={statuses:k,accounts:x,hashtags:I},[z,D]=$({}),oe=async M=>{if(!(M!=null&&M.length))return;const H=await ri(M,z);H&&D({...z,...H})};function ee(M){M&&(v.current=0),!(!M&&!u)&&(d("loading"),M&&!g&&(k(S.slice(0,hn)),x(_.slice(0,hn)),I(C.slice(0,hn))),(async()=>{var U,K,pe,J,ye,_e;const H={q:b,resolve:u,limit:hn};g&&(H.limit=Vn,H.type=g,u&&(H.offset=v.current));try{const q=await c.v2.search.fetch(H);if(g)if(M){L[g](q[g]);const re=(U=q[g])==null?void 0:U.length;v.current=Vn,y(!!re)}else if(((pe=(K=q[g])==null?void 0:K[0])==null?void 0:pe.id)===((ye=(J=E[g])==null?void 0:J[0])==null?void 0:ye.id))y(!1);else{L[g](Ae=>[...Ae,...q[g]]);const re=(_e=q[g])==null?void 0:_e.length;v.current=v.current+Vn,y(!!re)}else k(q.statuses||[]),x(q.accounts||[]),I(q.hashtags||[]),v.current=0,y(!1);oe(q.accounts),d("default")}catch{d("error")}})())}const W=j();jt(M=>{var U;const H=((U=w.current)==null?void 0:U.scrollTop)===0;if(M&&H){const K=Date.now()-W.current;!W.current||K>1e3*3?ee(!0):W.current=Date.now()}}),ne(()=>{var H,U;let M;return(U=(H=m.current)==null?void 0:H.setValue)==null||U.call(H,b||""),b?ee(!0):M=setTimeout(()=>{var K,pe;(pe=(K=m.current)==null?void 0:K.focus)==null||pe.call(K)},150),()=>clearTimeout(M)},[b,g,r]),He(["/","Slash"],M=>{var H,U,K,pe;(U=(H=m.current)==null?void 0:H.focus)==null||U.call(H),(pe=(K=m.current)==null?void 0:K.select)==null||pe.call(K)},{preventDefault:!0});const Z=".timeline > li > a, .hashtag-list > li > a",B=He("j",()=>{const M=document.activeElement.closest(Z),H=M==null?void 0:M.getBoundingClientRect(),U=Array.from(w.current.querySelectorAll(Z));if(M&&H.top<w.current.clientHeight&&H.bottom>0){const K=U.indexOf(M);let pe=U[K+1];pe&&(pe.focus(),pe.scrollIntoView(fn))}else{const K=U.find(pe=>{const J=pe.getBoundingClientRect();return J.top>=44&&J.left>=0});K&&(K.focus(),K.scrollIntoView(fn))}}),Y=He("k",()=>{const M=document.activeElement.closest(Z),H=M==null?void 0:M.getBoundingClientRect(),U=Array.from(w.current.querySelectorAll(Z));if(M&&H.top<w.current.clientHeight&&H.bottom>0){const K=U.indexOf(M);let pe=U[K-1];pe&&(pe.focus(),pe.scrollIntoView(fn))}else{const K=U.find(pe=>{const J=pe.getBoundingClientRect();return J.top>=44&&J.left>=0});K&&(K.focus(),K.scrollIntoView(fn))}}),[ce]=mi();return e("div",{id:"search-page",class:"deck-container",tabIndex:"-1",ref:M=>{w.current=M,B(M),Y(M)},children:e("div",{class:"timeline-deck deck",children:[e("header",{class:l==="loading"?"loading":"",children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:e(zt,{})}),e(Fs,{ref:m}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{ee(!0)},disabled:l==="loading",children:e(T,{icon:"search",size:"l",alt:s({id:"A1taO8"})})})})]})}),e("main",{children:[!!b&&!n&&e("div",{ref:ce,class:`filter-bar ${l==="loading"?"loading":""}`,children:[!!g&&e(ge,{to:`/search${b?`?q=${encodeURIComponent(b)}`:""}`,children:[e(T,{icon:"chevron-left"})," ",e(h,{id:"N40H+G"})]}),[{label:s({id:"bPwFdf"}),type:"accounts",to:`/search?q=${encodeURIComponent(b)}&type=accounts`},{label:s({id:"VwUsHI"}),type:"hashtags",to:`/search?q=${encodeURIComponent(b)}&type=hashtags`},{label:s({id:"+owNNn"}),type:"statuses",to:`/search?q=${encodeURIComponent(b)}&type=statuses`}].sort((M,H)=>M.type===g?-1:H.type===g?1:0).map(M=>e(ge,{to:M.to,children:M.label},M.type))]}),b?e(O,{children:[(!g||g==="accounts")&&e(O,{children:[g!=="accounts"&&e("h2",{class:"timeline-header",children:[e(h,{id:"bPwFdf"})," ",e(ge,{to:`/search?q=${encodeURIComponent(b)}&type=accounts`,children:e(T,{icon:"arrow-right",size:"l",alt:s({id:"V1fa9u"})})})]}),_.length>0?e(O,{children:[e("ul",{class:"timeline flat accounts-list",children:_.map(M=>e("li",{children:e(dt,{account:M,instance:r,showStats:!0,relationship:z[M.id]})},M.id))}),g!=="accounts"&&e("div",{class:"ui-state",children:e(ge,{class:"plain button",to:`/search?q=${encodeURIComponent(b)}&type=accounts`,children:[e(h,{id:"BMmtZ8"})," ",e(T,{icon:"arrow-right"})]})})]}):!g&&(l==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("p",{class:"ui-state",children:e(h,{id:"YYB61U"})}))]}),(!g||g==="hashtags")&&e(O,{children:[g!=="hashtags"&&e("h2",{class:"timeline-header",children:[e(h,{id:"VwUsHI"})," ",e(ge,{to:`/search?q=${encodeURIComponent(b)}&type=hashtags`,children:e(T,{icon:"arrow-right",size:"l",alt:s({id:"V1fa9u"})})})]}),C.length>0?e(O,{children:[e("ul",{class:"link-list hashtag-list",children:C.map(M=>{var pe;const{name:H,history:U}=M,K=(pe=U==null?void 0:U.reduce)==null?void 0:pe.call(U,(J,ye)=>J+ +ye.uses,0);return e("li",{children:e(ge,{to:r?`/${r}/t/${H}`:`/t/${H}`,children:[e(T,{icon:"hashtag",alt:"#"}),e("span",{children:H}),!!K&&e("span",{class:"count",children:Xe(K)})]})},`${H}-${K}`)})}),g!=="hashtags"&&e("div",{class:"ui-state",children:e(ge,{class:"plain button",to:`/search?q=${encodeURIComponent(b)}&type=hashtags`,children:[e(h,{id:"Nc/W5J"})," ",e(T,{icon:"arrow-right"})]})})]}):!g&&(l==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("p",{class:"ui-state",children:e(h,{id:"4MFM3P"})}))]}),(!g||g==="statuses")&&e(O,{children:[g!=="statuses"&&e("h2",{class:"timeline-header",children:[e(h,{id:"+owNNn"})," ",e(ge,{to:`/search?q=${encodeURIComponent(b)}&type=statuses`,children:e(T,{icon:"arrow-right",size:"l",alt:s({id:"V1fa9u"})})})]}),S.length>0?e(O,{children:[e("ul",{class:"timeline",children:S.map(M=>e("li",{children:e(ge,{class:"status-link",to:r?`/${r}/s/${M.id}`:`/s/${M.id}`,children:e(Ke,{status:M})})},M.id))}),g!=="statuses"&&e("div",{class:"ui-state",children:e(ge,{class:"plain button",to:`/search?q=${encodeURIComponent(b)}&type=statuses`,children:[e(h,{id:"LYCgej"})," ",e(T,{icon:"arrow-right"})]})})]}):!g&&(l==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("p",{class:"ui-state",children:e(h,{id:"Hzi9AA"})}))]}),!!g&&(l==="default"?f?e(_t,{onChange:M=>{M&&ee()},children:e("button",{type:"button",class:"plain block",onClick:()=>ee(),style:{marginBlockEnd:"6em"},children:e(h,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(h,{id:"2EYeAZ"})}):l==="loading"&&e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}))]}):l==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("p",{class:"ui-state",children:e(h,{id:"fGn1Hk"})})]})]})})}const el=20,no=10*60*1e3,tl=Ct(n=>n.v1.trends.links.list().next(),{maxAge:no}),nl=Ct(n=>n.v1.trends.tags.list().next(),{maxAge:no});function il(n){return Qe("@pixelfed/trending")?n.pixelfed.v2.discover.posts.trending.list({range:"daily"}):n.v1.trends.statuses.list({limit:el})}function sl(n,i){return n.v1.timelines.link.list(i)}function io({columnMode:n,...i}){const{_:s}=ue(),o=Ve(A),c=n?{}:Et(),{masto:r,instance:u}=le({instance:(i==null?void 0:i.instance)||c.instance}),{masto:l,instance:d}=le(),a=s({id:"cI3UEs",values:{instance:u}});et(a,"/:instance?/trending");const m=j(),b=u===d,[g,p]=$([]),[f,y]=$([]),v=j();async function w(W){var Y;if(W||!v.current){if(v.current=il(r),Qe("@mastodon/trending-hashtags"))try{const{value:ce}=await nl(r);ce!=null&&ce.length&&p(ce)}catch{}if(Qe("@mastodon/trending-links"))try{const{value:ce}=await tl(r,u),M=(Y=ce==null?void 0:ce.filter)==null?void 0:Y.call(ce,H=>H.type==="link");M!=null&&M.length&&y(M)}catch{}}const Z=await v.current.next();let{value:B}=Z;return B!=null&&B.length&&(W&&(m.current=B[0].id),B.forEach(ce=>{Je(ce,u)})),{...Z,value:B}}const[S,k]=$(!1),_=j(),[x,C]=$(null),I=!!x,E=j(),L=b&&Qe("@mastodon/trending-link-posts");ne(()=>{x&&E.current&&E.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[x]);const z=j();async function D(W){(W||!_.current)&&(k(!0),_.current=sl(r,{url:x})),z.current=x;const Z=await _.current.next();let{value:B}=Z;return B!=null&&B.length&&(B=Mt(B,"public"),B.forEach(Y=>{Je(Y,u)})),z.current===x&&k(!1),{...Z,value:B}}async function oe(){try{const W=await r.v1.trends.statuses.list({limit:1}).next();let{value:Z}=W;return Z=Mt(Z,"public"),Z!=null&&Z.length&&Z[0].id!==m.current?(m.current=Z[0].id,!0):!1}catch{return!1}}const ee=Te(()=>e(O,{children:[!!g.length&&e("div",{class:"filter-bar expandable",children:[e(T,{icon:"chart",class:"insignificant",size:"l"}),g.map((W,Z)=>{const{name:B,history:Y}=W,ce=Y.reduce((M,H)=>M+ +H.uses,0);return e(ge,{to:`/${u}/t/${B}`,children:[e("span",{dir:"auto",children:[e("span",{class:"more-insignificant",children:"#"}),B]}),e("span",{class:"filter-count",children:Xe(ce)})]},B)})]}),!!f.length&&e("div",{class:"links-bar",children:[e("header",{children:e("h3",{children:e(h,{id:"9veeTb"})})}),f.map(W=>{var Q,ke;const{authors:Z,authorName:B,authorUrl:Y,blurhash:ce,description:M,height:H,image:U,imageDescription:K,language:pe,providerName:J,providerUrl:ye,publishedAt:_e,title:q,url:re,width:Ae}=W,De=(ke=(Q=Z==null?void 0:Z[0])==null?void 0:Q.account)!=null&&ke.id?Z[0].account:null,Ne=q.length<30,Pe=!!(B||De),Ue=Pt.toUnicode(URL.parse(re).hostname.replace(/^www\./,"").replace(/\/$/,""));let Ce;if(ce){const Le=li(ce),fe=ki(Le);Ce=wi([.6,fe[1],fe[2]])}return e("div",{children:[e("a",{ref:x===re?E:null,href:re,target:"_blank",rel:"noopener noreferrer",class:`link-block ${I?x===re?"active":"inactive":""}`,style:Ce?{"--accent-color":`rgb(${Ce.join(",")})`,"--accent-alpha-color":`rgba(${Ce.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:U,alt:K,width:Ae,height:H,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:Ue})," ",!!_e&&e(O,{children:"· "}),!!_e&&e(O,{children:e(Zt,{datetime:_e,format:"micro"})})]}),!!q&&e("h1",{class:"title",lang:pe,dir:"auto",title:q,children:q})]}),!!M&&e("p",{class:`description ${Pe&&!Ne?"":"more-lines"}`,lang:pe,dir:"auto",title:M,children:M}),Pe&&e(O,{children:[e("hr",{}),e("p",{class:"byline",children:e("small",{children:e(h,{id:"aavdrC",values:{0:De?e(pt,{account:De,showAvatar:!0}):Y?e("a",{href:Y,target:"_blank",rel:"noopener noreferrer",children:B}):B}})})})]})]})]})}),L&&e("button",{type:"button",class:"small plain4 block",onClick:()=>{C(re)},disabled:re===x,children:[e(T,{icon:"comment2"})," ",e("span",{children:e(h,{id:"/bZzdR"})})," ",e(T,{icon:"chevron-down"})]})]},re)})]}),L&&!!f.length&&e("div",{class:`timeline-header-block ${I?"blended":""}`,children:I?e(O,{children:[e("div",{style:{width:50,flexShrink:0,textAlign:"center"},children:S?e(Be,{abrupt:!0}):e("button",{type:"button",class:"light",onClick:()=>{C(null)},children:e(T,{icon:"x",alt:s({id:"9Q/4xJ"})})})}),e("p",{children:e(h,{id:"BATCqf",values:{0:x.replace(/^https?:\/\/(www\.)?/i,"").replace(/\/$/,"")},components:{0:e("span",{class:"link-text"})}})})]}):e("p",{class:"insignificant",children:e(h,{id:"Vosm4k"})})})]}),[g,f,x,S]);return e(It,{title:a,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:e(h,{id:"4/iCqx"})}),e("div",{children:u})]}),id:"trending",instance:u,emptyText:s({id:"6HA9+s"}),errorText:s({id:"scd9lw"}),fetchItems:I?D:w,checkForUpdates:I?void 0:oe,checkForUpdatesInterval:5*60*1e3,useItemID:!0,headerStart:e(O,{}),boostsCarousel:o.settings.boostsCarousel,filterContext:"public",timelineStart:ee,refresh:x,clearWhenRefresh:!0,view:I?"link-mentions":void 0,headerEnd:e(lt,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(T,{icon:"more",size:"l",alt:s({id:"2FYpfJ"})})}),children:[e(Ie,{onClick:()=>{let W=prompt(s({id:"2MQ2cd"}));if(!/\./.test(W)){W&&alert(s({id:"7WddtO"}));return}W&&(W=W.toLowerCase().trim(),location.hash=`/${W}/trending`)},children:[e(T,{icon:"bus"})," ",e("span",{children:e(h,{id:"Sq04Yc"})})]}),d!==u&&e(Ie,{onClick:()=>{location.hash=`/${d}/trending`},children:[e(T,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(h,{id:"iAzCp4",values:{currentInstance:d},components:{0:e("b",{})}})})]})]})},u)}const es={block:"nearest",inline:"nearest",behavior:"smooth"};function ol(){const{_:n}=ue();et(n({id:"i0qMbr"}),"/");const i=Ve(A),{shortcuts:s}=i,o=s.map(c=>{if(!c)return null;const{type:r,...u}=c,l={following:_i,notifications:eo,list:Ks,public:ti,bookmarks:qs,favourites:Ys,hashtag:Vs,mentions:Xs,trending:io,search:to}[r];return!l||r==="search"&&!u.query||r==="list"&&!u.id?null:e(l,{...u,columnMode:!0},r+JSON.stringify(u))});return He(["1","2","3","4","5","6","7","8","9"],(c,r)=>{try{const u=parseInt(r.keys[0],10)-1,l=document.querySelectorAll("#columns > *")[u];l&&(l.focus(),l.scrollIntoView(es))}catch{}}),He(["[","]"],(c,r)=>{const u=r.keys[0],l=document.activeElement.closest("#columns > *"),d=$t(),a=d?"]":"[",m=d?"[":"]";let b;u===a?b=l?l.previousElementSibling:document.querySelectorAll("#columns > *")[0]:u===m&&(b=l?l.nextElementSibling:document.querySelectorAll("#columns > *")[1]),b&&(b.focus(),b.scrollIntoView(es))}),e("div",{id:"columns",onContextMenu:c=>{c.target.closest(".deck > header")&&!c.target.closest("a")&&!c.target.closest("button")&&(c.preventDefault(),A.showShortcutsSettings=!0)},onFocus:()=>{const c=document.activeElement.closest("#columns > *");c&&document.querySelectorAll("#columns > *").forEach(r=>{r.classList.toggle("focus",r===c)})},children:o})}function cl(){var s;const{_:n}=ue(),i=Ve(A);return __BENCHMARK.end("time-to-home"),ne(()=>{(async()=>{const o=await ft.drafts.keys();if(o.length){const c=_n();o.filter(u=>u.startsWith(c)).length&&(A.showDrafts=!0)}})()},[]),e(O,{children:(i.settings.shortcutsViewMode==="multi-column"||!i.settings.shortcutsViewMode&&i.settings.shortcutsColumnsMode)&&((s=i.shortcuts)!=null&&s.length)?e(ol,{}):e(_i,{title:n({id:"i0qMbr"}),path:"/",id:"home",headerStart:!1,headerEnd:e(al,{})})})}function al(){const{_:n}=ue(),i=Ve(A),s=j(),[o,c]=$(void 0);return e(O,{children:[e(ge,{ref:s,to:"/notifications",class:`button plain notifications-button ${i.notificationsShowNew?"has-badge":""} ${o||""}`,onClick:r=>{r.stopPropagation(),window.matchMedia("(min-width: calc(40em))").matches&&(r.preventDefault(),c(u=>u?void 0:"open"))},children:e(T,{icon:"notification",size:"l",alt:n({id:"iDNBZe"})})}),e(ll,{state:o,anchorRef:s,onClose:()=>c(void 0)})]})}const rl=5;function ll({anchorRef:n,state:i,onClose:s}){const{masto:o,instance:c}=le(),r=Ve(A),[u,l]=$("default"),d=ei();async function a(){const y=await d.next(),v=Zs(y.value);if(v!=null&&v.length){v.forEach(S=>{Je(S.status,c,{skipThreading:!0})});const w=Qs(v);A.notificationsLast=w[0],A.notifications=w,o.v1.markers.create({notifications:{lastReadId:w[0].id}}).catch(()=>{})}return A.notificationsShowNew=!1,A.notificationsLastFetchTime=Date.now(),y}const[m,b]=$(!1);function g(){return o.v1.followRequests.list({limit:1})}function p(){l("loading"),(async()=>{try{await a();const y=await g();b(!!(y!=null&&y.length)),l("default")}catch{l("error")}})()}ne(()=>{i==="open"&&p()},[i]);const f=j();return e(ks,{ref:f,menuClassName:"notifications-menu",state:i,anchorRef:n,onClose:s,portal:{target:document.body},containerProps:{onClick:()=>{var y,v;(v=(y=f.current)==null?void 0:y.closeMenu)==null||v.call(y)}},overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:"8 8 8 8",children:[e("header",{children:e("h2",{children:e(h,{id:"iDNBZe"})})}),e("main",{children:r.notifications.length?e(O,{children:r.notifications.slice(0,rl).map(y=>e(an,{instance:c,notification:y,disableContextMenu:!0},y._ids||y.id))}):u==="loading"?e("div",{class:"ui-state",children:e(Be,{abrupt:!0})}):u==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(h,{id:"5GFQTh"})}),e("p",{children:e("button",{type:"button",onClick:p,children:e(h,{id:"KDw4GX"})})})]})}),e("footer",{children:[e(ge,{to:"/mentions",class:"button plain",children:[e(T,{icon:"at"})," ",e("span",{children:e(h,{id:"/bZzdR"})})]}),e(ge,{to:"/notifications",class:"button plain2",children:[m?e(h,{id:"OdVhdR",components:{0:e("span",{class:"tag collapsed"}),1:e("span",{})}}):e("b",{children:e(h,{id:"gukqfD"})})," ",e(T,{icon:"arrow-right"})]})]})]})}const dl=ct(cl),ul=[/^\/@[^@\/]+\/(?:statuses|posts)\/([^\/]+)/i,/\/notes\/([^\/]+)/i,/^\/(?:notice|objects)\/([a-z0-9-]+)/i,/\/@[^@\/]+\/post\/([^\/]+)/i,/\/@[^@\/]+@?[^\/]+?\/([^\/]+)/i,/^\/p\/[^\/]+\/([^\/]+)/i];function so(n){const{hostname:i,pathname:s}=URL.parse(n);for(const o of ul){const[,c]=s.match(o)||[];if(c)return{instance:i,id:c}}return{}}function hl(n){const{instance:i,id:s}=so(n);return i&&s?`/${i}/s/${s}`:null}function fl(){const i=Wt().pathname.replace(/^\//,""),s=so(i),o=s!=null&&s.instance?`/${s.instance}/s/${s.id}`:null,[c,r]=$("loading");return yt(()=>{r("loading"),(async()=>{try{const{instance:u,id:l}=s;if(l){const{masto:d}=le({instance:u});if(await d.v1.statuses.$select(l).fetch()){window.location.hash=o+"?view=full";return}}}catch{}{const{masto:u,instance:l}=le(),d=await u.v2.search.fetch({q:i,limit:1,resolve:!0});if(d.statuses.length){const a=d.statuses[0];window.location.hash=`/${l}/s/${a.id}?view=full`}else if(d.accounts.length){const a=d.accounts[0];window.location.hash=`/${l}/a/${a.id}`}else o?window.location.hash=o+"?view=full":r("error")}})()},[o]),e("div",{class:"ui-state",tabIndex:"-1",children:[c==="loading"?e(O,{children:[e(Be,{abrupt:!0}),e("h2",{children:e(h,{id:"RTAr/z"})}),e("p",{children:e("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:i})})]}):e(O,{children:[e("h2",{children:e(h,{id:"ufzZSJ"})}),e("p",{children:e("a",{href:i,target:"_blank",rel:"noopener noreferrer",children:i})})]}),e("hr",{}),e("p",{children:e(ge,{to:"/",children:e(h,{id:"iWpEwy"})})})]})}function pl(){const{_:n}=ue();et(n({id:"h16FyT"}),"/l");const[i,s]=$("default"),[o,c]=Nt(a=>a+1,0),[r,u]=$([]);ne(()=>{s("loading"),(async()=>{try{const a=await Jn();u(a),s("default")}catch{s("error")}})()},[o]);const[l,d]=$(!1);return e("div",{id:"lists-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck",children:[e("header",{children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(zt,{}),e(ge,{to:"/",class:"button plain",children:e(T,{icon:"home",size:"l"})})]}),e("h1",{children:e(h,{id:"h16FyT"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>d(!0),children:e(T,{icon:"plus",size:"l",alt:n({id:"Sb2gYF"})})})})]})}),e("main",{children:r.length>0?e(O,{children:[e("ul",{class:"link-list",children:r.map(a=>e("li",{children:e(ge,{to:`/l/${a.id}`,children:e("span",{children:[e(T,{icon:"list"})," ",e("span",{children:a.title})]})})}))}),r.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(h,{id:"8prZNK",values:{0:r.length}})})})]}):i==="loading"?e("p",{class:"ui-state",children:e(Be,{})}):i==="error"?e("p",{class:"ui-state",children:e(h,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(h,{id:"IvPikw"})})})]}),l&&e(Ye,{onClick:a=>{a.target===a.currentTarget&&d(!1)},children:e(vi,{list:l==null?void 0:l.list,onClose:a=>{a.state==="success"&&c(),d(!1)}})})]})}const ml=""+new URL("instances-CwO9tuGQ.json",import.meta.url).href;function gl(n){return("0"+n.toString(16)).slice(-2)}function bl(){var n=new Uint32Array(28);return window.crypto.getRandomValues(n),Array.from(n,gl).join("")}function yl(n){const s=new TextEncoder().encode(n);return window.crypto.subtle.digest("SHA-256",s)}function vl(n){let i="";const s=new Uint8Array(n),o=s.byteLength;for(var c=0;c<o;c++)i+=String.fromCharCode(s[c]);return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function oo(n){const i=await yl(n);return vl(i)}async function wl({instanceURL:n}){var i;if(!n)return!1;try{const s=await fetch(`https://${n}/.well-known/oauth-authorization-server`);return!s.ok||s.status!==200?!1:!!((i=(await s.json()).code_challenge_methods_supported)!=null&&i.includes("S256"))}catch{return!1}}window.__generateCodeChallenge=oo;const kl={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{DEV:Sl,PHANPY_CLIENT_NAME:_l,PHANPY_WEBSITE:En}=kl,Dn="read write follow push",Cl=En?En.toLowerCase().includes(location.hostname):!1,Il=location.origin+location.pathname,Nn=Sl||!Cl?Il:En;async function Tl({instanceURL:n}){const i=new URLSearchParams({client_name:_l,redirect_uris:Nn,scopes:Dn,website:En});return await(await fetch(`https://${n}/api/v1/apps`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:i.toString()})).json()}async function xl({instanceURL:n,client_id:i}){const s=bl(),o=await oo(s),c=new URLSearchParams({client_id:i,code_challenge_method:"S256",code_challenge:o,redirect_uri:Nn,response_type:"code",scope:Dn});return[`https://${n}/oauth/authorize?${c.toString()}`,s]}async function Al({instanceURL:n,client_id:i}){const s=new URLSearchParams({client_id:i,scope:Dn,redirect_uri:Nn,response_type:"code"});return`https://${n}/oauth/authorize?${s.toString()}`}async function El({instanceURL:n,client_id:i,client_secret:s,code:o,code_verifier:c}){const r=new URLSearchParams({client_id:i,redirect_uri:Nn,grant_type:"authorization_code",code:o,scope:Dn});return s&&r.append("client_secret",s),c&&r.append("code_verifier",c),await(await fetch(`https://${n}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:r.toString()})).json()}const Rl={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:Ll}=Rl;function $l(){var k,_;const{_:n}=ue();et("Log in");const i=j(),s=we.local.get("instanceURL"),[o,c]=$("default"),[r]=gt(),u=r.get("instance"),l=r.get("submit"),[d,a]=$(u||(s==null?void 0:s.toLowerCase())||""),[m,b]=$([]),g=j();ne(()=>{(async()=>{try{const C=await(await fetch(ml)).json();b(C),g.current=new Vo(C)}catch{}})()},[]);const p=x=>{x&&(async()=>{try{const I=await(await fetch(`https://${x}/.well-known/host-meta`)).text(),D=new DOMParser().parseFromString(I,"text/xml").getElementsByTagName("Link")[0].getAttribute("template"),oe=URL.parse(D),{host:ee}=oe;x!==ee&&(x=ee)}catch{}we.local.set("instanceURL",x),c("loading");try{const{client_id:C,client_secret:I,vapid_key:E}=await Tl({instanceURL:x});if(await wl({instanceURL:x}))if(C&&I){we.sessionCookie.set("clientID",C),we.sessionCookie.set("clientSecret",I),we.sessionCookie.set("vapidKey",E);const[z,D]=await xl({instanceURL:x,client_id:C});we.sessionCookie.set("codeVerifier",D),location.href=z}else alert(n({id:"ZP1FIA"}));else C&&I?(we.sessionCookie.set("clientID",C),we.sessionCookie.set("clientSecret",I),we.sessionCookie.set("vapidKey",E),location.href=await Al({instanceURL:x,client_id:C})):alert(n({id:"ZP1FIA"}));c("default")}catch{c("error")}})()},f=d?d.replace(/^https?:\/\//,"").replace(/\/+$/,"").replace(/^@?[^@]+@/,"").trim():null,y=/[^\s\r\n\t\/\\]+\.[^\s\r\n\t\/\\]+/.test(f)&&!/[\s\/\\@]/.test(f),v=f?(_=(k=g.current)==null?void 0:k.search(f,{limit:10}))==null?void 0:_.map(x=>x.item):[],w=y?f:v!=null&&v.length?v[0]:d?m.find(x=>x.includes(d)):null,S=x=>{x.preventDefault(),p(w)};return l&&ne(()=>{p(u||w)},[]),e("main",{id:"login",style:{textAlign:"center"},children:e("form",{onSubmit:S,children:[e("h1",{children:[e("img",{src:gi,alt:"",width:"80",height:"80"}),e("br",{}),e(h,{id:"sQia9P"})]}),e("label",{children:[e("p",{children:e(h,{id:"kyAi7k"})}),e("input",{value:d,required:!0,type:"text",class:"large",id:"instanceURL",ref:i,disabled:o==="loading",autocorrect:"off",autocapitalize:"off",autocomplete:"off",spellCheck:!1,placeholder:n({id:"u3gOdY"}),onInput:x=>{a(x.target.value)},dir:"auto"}),(v==null?void 0:v.length)>0?e("ul",{id:"instances-suggestions",children:v.map((x,C)=>e("li",{children:e("button",{type:"button",class:"plain5",onClick:()=>{p(x)},children:x})}))}):e("div",{id:"instances-eg",children:e(h,{id:"/OvbEC"})})]}),o==="error"&&e("p",{class:"error",children:e(h,{id:"rmBHZn"})}),e("div",{children:[e("button",{disabled:o==="loading"||!d||!w,children:n(w?{id:"2xahsi",values:{selectedInstanceText:w}}:{id:"xGVfLh"})})," "]}),e(Be,{hidden:o!=="loading"}),e("hr",{}),!Ll&&e("p",{children:e("a",{href:"https://joinmastodon.org/servers",target:"_blank",children:e(h,{id:"LcOiWS"})})}),e("p",{children:e(ge,{to:"/",children:e(h,{id:"iWpEwy"})})}),e(bi,{})]})})}const Ml={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:ts}=Ml,pn=40,Dl=10,Nl=5;let ni={},vn={},wn={};function kn(n){delete vn[n],delete wn[n]}const Qt={block:"nearest",inline:"center",behavior:"smooth"},ns=".status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)",is=/\/s\//i;function Pl(n){var x;const{_:i}=ue(),{id:s}=n,{masto:o,instance:c}=le({instance:n.instance}),r=Ve(A),[u,l]=gt(),d=u.get("media"),a=u.get("media-only"),m=parseInt(d||a,10);let b=m>0;const g=u.get("mediaStatusID"),p=ps(g,c);g&&!p&&(b=!1);const f=b&&!!a,y=ot(s,c),[v,w]=$(A.statuses[y]);ne(()=>{A.statuses[y]&&w(A.statuses[y])},[y]);const S=Te(()=>{const{prevLocation:C}=A,I=((C==null?void 0:C.pathname)||"")+((C==null?void 0:C.search)||""),E=sn("/:instance/s/:id",I)||sn("/s/:id",I);return!I||E?"/":I},[]);ne(()=>{!v&&b&&(async()=>{try{const C=await o.v1.statuses.$select(s).fetch();Je(C,c),w(C)}catch{alert("Unable to load post."),location.hash=S}})()},[b]);const k=g?(x=r.statuses[ot(g,c)])==null?void 0:x.mediaAttachments:v==null?void 0:v.mediaAttachments,_=rt(()=>{!window.matchMedia("(min-width: calc(40em + 350px))").matches&&r.prevLocation?history.back():f?location.hash=S:(u.delete("media"),u.delete("mediaStatusID"),l(u))},[f,S,r.prevLocation]);return ne(()=>{let C=setTimeout(()=>{const I=document.querySelector(".carousel");I&&I.focus()},100);return()=>clearTimeout(C)},[f]),ne(()=>{const C=document.querySelectorAll(".deck-container");return C.forEach(I=>{I.setAttribute("inert","")}),()=>{C.forEach(I=>{I.removeAttribute("inert")})}},[]),e("div",{class:"deck-backdrop",children:[b?k!=null&&k.length?e(Us,{mediaAttachments:k,statusID:g||s,instance:c,lang:v==null?void 0:v.language,index:m-1,onClose:_}):e("div",{class:"media-modal-container loading",children:e(Be,{abrupt:!0})}):e(ge,{to:S}),!f&&e(zl,{id:s,instance:n.instance,closeLink:S})]})}function Ol(n){const{linkable:i,to:s,onClick:o,...c}=n;return i?e(ge,{class:"status-link",to:s,onClick:o,...c}):e("div",{class:"status-focus",tabIndex:0,...c})}function ss(n,i){return new Date(i.created_at)-new Date(n.created_at)}function zl({id:n,closeLink:i="/",instance:s}){var X,Se;const{_:o}=ue(),[c,r]=gt(),u=c.get("media"),l=c.get("mediaStatusID"),d=parseInt(u,10)>0,a=j(!A.prevLocation&&(history.length===1||"navigation"in window&&((Se=(X=navigation==null?void 0:navigation.entries)==null?void 0:X.call(navigation))==null?void 0:Se.length)===1)),[m,b]=$(c.get("view")||a.current?"full":null),g=!!parseInt(c.get("translate")),{masto:p,instance:f}=le({instance:s}),{masto:y,instance:v,authenticated:w}=le(),S=f===v,k=Ve(A),[_,x]=$([]),[C,I]=$("default"),E=j(),L=ot(n,f),z=j(0),D=j();ne(()=>{var P;(P=D.current)==null||P.focus()},[]),ne(()=>{var te;const P=Cs(()=>{if(!D.current)return;const{scrollTop:de}=D.current;C!=="loading"&&(wn[n]=de)},50);return(te=D.current)==null||te.addEventListener("scroll",P,{passive:!0}),P(),()=>{var de;P.cancel(),(de=D.current)==null||de.removeEventListener("scroll",P)}},[n,C!=="loading"]);const oe=j(),ee=j(),W=({reloadHero:P}={})=>{I("loading");let te;const de=vn[n];if(de){const N=de.filter(ae=>A.statuses[L]);x(N)}else x([{id:n}]);return(async()=>{var be,Re;const N=()=>Ri(()=>p.v1.statuses.$select(n).fetch(),{retries:4}),ae=Ri(()=>p.v1.statuses.$select(n).context.fetch(),{retries:8}),xe=!!k.statuses[L];let F=k.statuses[L];if(!(xe&&!P))try{F=await N(),Je(F,f),await new Promise(R=>{setTimeout(R,100)})}catch{I("error");return}try{let R=function(ve,ze){const tt=ze+1;return tt>Me&&(Me=ze),ve==null?void 0:ve.map(Ee=>({id:Ee.id,account:Ee.account,repliesCount:Ee.repliesCount,content:Ee.content,weight:nn(Ee),level:tt,replies:R(Ee.__replies,tt)}))};const V=await ae,{ancestors:se,descendants:G}=V;se.sort(ss),G.sort(ss),z.current=(G==null?void 0:G.length)||0;const ie=new Set;se.forEach(ve=>{Je(ve,f,{skipThreading:!0}),ve.inReplyToId&&!se.find(ze=>ze.id===ve.inReplyToId)&&ie.add(ve.inReplyToId)});const Oe=se.every(ve=>ve.account.id===F.account.id),$e=[];G.forEach(ve=>{if(Je(ve,f,{skipThreading:!0}),ve.inReplyToId&&!G.find(ze=>ze.id===ve.inReplyToId)&&ve.inReplyToId!==F.id&&ie.add(ve.inReplyToId),ve.inReplyToAccountId===ve.account.id)$e.push(ve);else if(ve.inReplyToId===F.id)$e.push(ve);else if(!ve.inReplyToAccountId&&$e.find(ze=>ze.id===ve.inReplyToId&&ze.account.id===F.account.id)&&ve.account.id===F.account.id)$e.push(ve);else{const ze=G.find(tt=>tt.id===ve.inReplyToId);ze&&(ze.__replies||(ze.__replies=[]),ze.__replies.push(ve))}}),$e.sort((ve,ze)=>{const tt=F.account.id;return ve.account.id===tt&&ze.account.id!==tt?-1:ze.account.id===tt&&ve.account.id!==tt?1:0}),ie.size;let Me=1;const Fe=[...se.map(ve=>({id:ve.id,ancestor:!0,isThread:Oe,accountID:ve.account.id,account:ve.account,repliesCount:ve.repliesCount,weight:nn(ve)})),{id:n,accountID:F.account.id,weight:nn(F)},...$e.map(ve=>({id:ve.id,account:ve.account,accountID:ve.account.id,descendant:!0,thread:ve.account.id===F.account.id,weight:nn(ve),level:1,replies:R(ve.__replies,1)}))];I("default"),oe.current={offsetTop:(be=E.current)==null?void 0:be.offsetTop,scrollTop:(Re=D.current)==null?void 0:Re.scrollTop};const je=se.length||0;je>=K&&pe(je+1),x(Fe),vn[n]=Fe,So(F,f)}catch{I("error")}})(),ee.current=Date.now(),()=>{clearTimeout(te)}};ne(W,[n,p]);const[Z,B]=$(!1);ne(()=>{let P=setInterval(()=>{const te=Date.now();ee.current&&te-ee.current>=6e4&&B(!0)},6e4);return()=>{clearInterval(P)}},[]),yt(()=>{var te,de;if(!_.length)return;const P=wn[n];if(P)D.current.scrollTop=P;else if(oe.current){const N={offsetTop:(te=E.current)==null?void 0:te.offsetTop,scrollTop:(de=D.current)==null?void 0:de.scrollTop},ae=N.offsetTop-oe.current.offsetTop+N.scrollTop;D.current.scrollTop=ae}else _.length===1&&(D.current.scrollTop=0);oe.current=null},[_]),ne(()=>{k.reloadStatusPage<=0||(async()=>{try{const{instanceURL:P}=si(),te=`https://${P}/api/v1/statuses/${n}/context`;return await(await caches.open("api")).delete(te,{ignoreVary:!0}),W({reloadHero:!0})}catch{}})()},[k.reloadStatusPage]),ne(()=>()=>{wn={},A.reloadStatusPage=0,vn={},ni={},ii.clear()},[]);const Y=k.statuses[L]||k.statuses[n],ce=Te(()=>{if(!Y)return"";const{account:P}=Y,te=document.createElement("div");return te.innerHTML=P.displayName,te.innerText.trim()},[Y]),M=Te(()=>{if(!Y)return"";let P=di(Y);return P.length>64&&(P=P.slice(0,64)+"…"),P},[Y]);et(ce&&M?`${ce}: "${M}"`:o({id:"post.title"}),"/:instance?/s/:id");const H=Te(()=>{if(!Y)return;const{url:P}=Y;if(P)return URL.parse(P).hostname},[Y]),U=Te(()=>{if(H)return H===f},[H,f]),[K,pe]=$(pn),J=Te(()=>_.length-K,[_.length,K]),ye=_.some(P=>P.descendant),_e=_.filter(P=>P.ancestor),[q,re]=$(!0),Ae=Te(()=>{if(!E.current||q)return null;const{top:P}=E.current.getBoundingClientRect();return P>0?"down":"up"},[q]);He("esc",()=>{location.hash=i},{enabled:!d,ignoreEventWhen:P=>!!document.querySelector("#modal-container > *")}),He("backspace",()=>{location.hash=i}),He("j",()=>{const P=document.activeElement.closest(".status-link, .status-focus"),te=P==null?void 0:P.getBoundingClientRect(),de=Array.from(D.current.querySelectorAll(ns));if(P&&te.top<D.current.clientHeight&&te.bottom>0){const N=de.indexOf(P);let ae=de[N+1];ae&&(ae.focus(),ae.scrollIntoView(Qt))}else{const N=de.find(ae=>{const xe=ae.getBoundingClientRect();return xe.top>=44&&xe.left>=0});N&&(N.focus(),N.scrollIntoView(Qt))}}),He("k",()=>{const P=document.activeElement.closest(".status-link, .status-focus"),te=P==null?void 0:P.getBoundingClientRect(),de=Array.from(D.current.querySelectorAll(ns));if(P&&te.top<D.current.clientHeight&&te.bottom>0){const N=de.indexOf(P);let ae=de[N-1];ae&&(ae.focus(),ae.scrollIntoView(Qt))}else{const N=de.find(ae=>{const xe=ae.getBoundingClientRect();return xe.top>=44&&xe.left>=0});N&&(N.focus(),N.scrollIntoView(Qt))}}),He("x",()=>{const P=document.activeElement.closest(".status-link, .status-focus");if(P){const te=P.nextElementSibling;te&&te.tagName.toLowerCase()==="details"&&(te.open=!te.open)}});const[De,Ne]=$(!1),Pe=j(d?"media+status":"status"),Ue=rt((P,te,de,N)=>{P.preventDefault(),P.stopPropagation(),r({media:te+1,mediaStatusID:N.id})},[n]),Ce=rt((P,te)=>{kn(te.id)},[]);ne(()=>{let P;return l&&d&&(P=setTimeout(()=>{var de;const te=(de=D.current)==null?void 0:de.querySelector(`.status-link[href*="/${l}"]`);te&&te.scrollIntoView(Qt)},400)),()=>{clearTimeout(P)}},[l,d]);const Q=rt((P,te)=>{const{id:de,ancestor:N,isThread:ae,descendant:xe,thread:F,replies:be,repliesCount:Re,weight:R,level:V}=P,se=de===n;return e("li",{ref:se?E:null,class:`${N?"ancestor":""} ${xe?"descendant":""} ${F?"thread":""} ${se?"hero":""}`,children:[se?e(O,{children:[e(_t,{threshold:.1,onChange:ie=>{queueMicrotask(()=>{requestAnimationFrame(()=>{re(ie)})})},class:"status-focus",tabIndex:0,children:e(Ke,{statusID:de,instance:f,withinContext:!0,size:"l",enableTranslate:!0,forceTranslate:g})}),C!=="loading"&&!w?e("div",{class:"post-status-banner",children:[e("p",{children:e(h,{id:"Vyeh4F"})}),e(ge,{to:ts?`/login?instance=${ts}&submit=1`:"/login",class:"button",children:e(h,{id:"sQia9P"})})]}):!S&&e("div",{class:"post-status-banner",children:[e("p",{children:e(h,{id:"j5roNG",values:{instance:f},components:{0:e("b",{})}})}),e("button",{type:"button",disabled:C==="loading",onClick:()=>{I("loading"),(async()=>{try{const ie=await y.v2.search.fetch({q:Y.url,type:"statuses",resolve:!0,limit:1});if(ie.statuses.length){const Oe=ie.statuses[0];location.hash=v?`/${v}/s/${Oe.id}`:`/s/${Oe.id}`}else throw new Error("No results")}catch(ie){I("default"),alert(o({id:"DnepCE",values:{e:ie}}))}})()},children:[e(T,{icon:"transfer"})," ",e(h,{id:"ejAVrO"})]})]})]}):e(Ol,{linkable:ae||N,to:f?`/${f}/s/${de}`:`/s/${de}`,onClick:()=>{kn(de)},children:[te===0&&N?e(_t,{threshold:.5,onChange:ie=>{queueMicrotask(()=>{requestAnimationFrame(()=>{Ne(ie)})})},children:e(Ke,{statusID:de,instance:f,withinContext:!0,size:F||N?"m":"s",enableTranslate:!0,onMediaClick:Ue,onStatusLinkClick:Ce})}):e(Ke,{statusID:de,instance:f,withinContext:!0,size:F||N?"m":"s",enableTranslate:!0,onMediaClick:Ue,onStatusLinkClick:Ce,showActionsBar:!!xe}),N&&Re>1&&e("div",{class:"replies-link",children:[e(T,{icon:"comment2",alt:o({id:"N8UzTV"})})," ",e("span",{title:Re,children:Xe(Re)})]})," "]}),xe&&(be==null?void 0:be.length)>0&&e(co,{instance:f,replies:be,hasParentThread:F,level:V,accWeight:R,openAll:z.current<Dl,parentLink:{to:f?`/${f}/s/${de}`:`/s/${de}`,onClick:()=>kn(de)}}),C==="loading"&&se&&!!(Y!=null&&Y.repliesCount)&&!ye&&e("div",{class:"status-loading",children:e(Be,{abrupt:Y.repliesCount>=3})}),C==="error"&&se&&!!(Y!=null&&Y.repliesCount)&&!ye&&e("div",{class:"status-error",children:[e(h,{id:"HQJU6W"}),e("br",{}),e("button",{type:"button",class:"plain",onClick:()=>{A.reloadStatusPage++},children:e(h,{id:"KDw4GX"})})]})]},de)},[n,f,C,w,S,g,Ue,Ce,ye]),ke=Te(()=>{var P;if("navigation"in window&&(navigation!=null&&navigation.entries)){const te=navigation.entries()[navigation.currentEntry.index-1];if(te!=null&&te.url)return is.test(te.url)}return is.test((P=A.prevLocation)==null?void 0:P.pathname)},[L]),Le=Te(()=>{if(!J)return[];const P=[];function te(de){P.push(de.id),de.replies&&de.replies.forEach(te)}return _.slice(K).forEach(te),P.map(de=>ot(de,f))},[J,_,K,f]),fe=Te(()=>_.slice(0,K).map(Q),[_,K,Q]);return ne(()=>{let P=setTimeout(()=>{if(!E.current)return;const te=E.current.querySelector(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)");te&&te.click()},1e3);return()=>clearTimeout(P)},[n]),e("div",{tabIndex:"-1",ref:D,class:`status-deck deck contained ${_.length>1?"padded-bottom":""} ${Pe.current==="status"&&!a.current?"slide-in":""} ${m?`deck-view-${m}`:""}`,onAnimationEnd:P=>{Pe.current==="status"&&(Pe.current=null)},children:[e("header",{class:`${C==="loading"?"loading":""}`,onDblClick:P=>{A.reloadStatusPage++},children:e("div",{class:"header-grid header-grid-2",children:[e("h1",{children:[ke&&e("button",{type:"button",class:"plain deck-back",onClick:()=>{history.back()},children:e(T,{icon:"chevron-left",size:"xl",alt:o({id:"iH8pgl"})})}),!q&&Y&&C!=="loading"?e(O,{children:[e("span",{class:"hero-heading",children:[e(pt,{account:Y.account,instance:f,showAvatar:!0,short:!0})," ",e("span",{class:"insignificant",children:["•"," ",e(Zt,{datetime:Y.createdAt,format:"micro"})]})]})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:P=>{P.preventDefault(),P.stopPropagation(),E.current.scrollIntoView({behavior:"smooth",block:"start"})},title:o({id:"NCy+Nw"}),children:e(T,{icon:Ae==="down"?"arrow-down":"arrow-up"})})]}):e(O,{children:[e(h,{id:"post.title"})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:P=>{P.preventDefault(),P.stopPropagation(),D.current.scrollTo({top:0,behavior:"smooth"})},hidden:!_e.length||De,title:o({id:"R8CUl0",values:{0:_e.length}}),children:[e(T,{icon:"arrow-up"}),_e.filter((P,te,de)=>de.findIndex(N=>N.accountID===P.accountID)===te).slice(0,3).map(P=>e(ht,{url:P.account.avatar,alt:P.account.displayName},P.account.id)),_e.length>3&&e(O,{children:[" ",e("span",{class:"insignificant",children:Xe(_e.length)})]})]})]})]}),e("div",{class:"header-side",children:[e("button",{type:"button",class:"plain4 button-switch-view",style:{display:m==="full"?"":"none"},onClick:()=>{b(null),c.delete("media"),c.delete("media-only"),c.delete("view"),r(c)},title:o({id:"+/xYEI"}),children:e(T,{icon:"layout4",size:"l"})}),Z&&e("button",{type:"button",class:"plain button-refresh",onClick:()=>{A.reloadStatusPage++,B(!1)},children:e(T,{icon:"refresh",size:"l",alt:o({id:"lCF0wC"})})}),e(lt,{align:"end",portal:{target:D.current},menuButton:e("button",{type:"button",class:"button plain4",children:e(T,{icon:"more",alt:o({id:"2FYpfJ"}),size:"xl"})}),children:[e(Ie,{disabled:C==="loading",onClick:()=>{A.reloadStatusPage++},children:[e(T,{icon:"refresh"}),e("span",{children:e(h,{id:"lCF0wC"})})]}),e(Ie,{className:"menu-switch-view",onClick:()=>{b(m==="full"?null:"full"),c.delete("media"),c.delete("media-only"),m==="full"?c.delete("view"):c.set("view","full"),r(c)},children:[e(T,{icon:{"":"layout5",full:"layout4"}[m||""]}),e("span",{children:o(m==="full"?{id:"+/xYEI"}:{id:"2LiWsE"})})]}),e(Ie,{onClick:()=>{Array.from(D.current.querySelectorAll(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)")).forEach(te=>{te.click()})},children:[e(T,{icon:"eye-open"})," ",e("span",{children:e(h,{id:"8r8KmB"})})]}),e(Ze,{}),e(_s,{className:"plain",children:e(h,{id:"Rsjgm0"})}),e(Ie,{disabled:!H||U,onClick:()=>{const P=hl(Y.url);P?location.hash=P:alert(o({id:"9J6biQ"}))},children:[e(T,{icon:"transfer"}),e("small",{class:"menu-double-lines",children:o(H?{id:"tElD3e",values:{1:Pt.toUnicode(H)}}:{id:"lb07+k"})})]})]}),e(ge,{class:"button plain deck-close",to:i,children:e(T,{icon:"x",size:"xl",alt:o({id:"yz7wBu"})})})]})]})}),_.length&&Y?e("ul",{class:`timeline flat contextual grow ${C==="loading"?"loading":""}`,children:[fe,J>0&&e("li",{class:"descendant descendant-more",children:e("button",{type:"button",class:"plain block show-more",disabled:C==="loading",onClick:()=>pe(P=>P+pn),style:{marginBlockEnd:"6em"},"data-state-post-ids":Le.join(" "),children:[e("div",{class:"ib avatars-bunch",children:_.slice(K,K+5).map(P=>e(ht,{url:P.account.avatarStatic},P.id))})," ",e("div",{class:"ib",children:[e(h,{id:"uXRAkV"})," ",e("span",{class:"tag",children:J>pn?`${pn}+`:J})]})]})})]}):e(O,{children:[C==="loading"&&e("ul",{class:"timeline flat contextual grow loading",children:e("li",{children:e(Ke,{skeleton:!0,size:"l"})})}),C==="error"&&e("p",{class:"ui-state",children:[e(h,{id:"JWxodU"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>{A.reloadStatusPage++},children:e(h,{id:"KDw4GX"})})]})]})]})}function co({replies:n,instance:i,hasParentThread:s,level:o,accWeight:c,openAll:r,parentLink:u}){const{_:l}=ue(),[d,a]=gt(),m=I=>I.reduce((E,L)=>{const{repliesCount:z,replies:D}=L,oe=(D==null?void 0:D.length)||z;return E+oe+m(D||[])},0),b=n.length+m(n),g=n.length===b,p=n.map(I=>I.account).filter((I,E,L)=>L.findIndex(z=>z.id===I.id)===E).slice(0,3),f=Te(()=>n==null?void 0:n.reduce((I,E)=>I+(E==null?void 0:E.weight),c),[c,n==null?void 0:n.length]);let y=!1;(r||f<=Nl||!s&&b===1&&nn(n[0])<2)&&(y=!0);const v=ni[n[0].id],w=rt((I,E,L,z)=>{I.preventDefault(),I.stopPropagation(),a({media:E+1,mediaStatusID:z.id})},[]),S=j();yt(()=>{var E;function I(L){L.target.dataset.scrollLeft=L.target.scrollLeft}return(E=S.current)==null||E.addEventListener("scroll",I,{passive:!0}),()=>{var L;(L=S.current)==null||L.removeEventListener("scroll",I)}},[]);const[k,_]=$(v||y);ne(()=>{let I;return!v&&!y&&(I=setTimeout(()=>_(!0),100)),()=>clearTimeout(I)},[v,y]);const x=y?"div":"details",C=x==="details";return e(x,{ref:S,class:"replies",open:C?v||y:void 0,onToggle:C?I=>{const{open:E}=I.target;ni[n[0].id]=E}:void 0,style:{"--comments-level":o},"data-comments-level":o,"data-comments-level-overflow":o>4,children:[!y&&e("summary",{class:"replies-summary",hidden:y,children:[e("span",{class:"avatars",children:p.map(I=>e(ht,{url:I.avatarStatic,title:`${I.displayName} @${I.username}`,squircle:I==null?void 0:I.bot},I.id))}),e("span",{class:"replies-counts",children:[e("b",{children:e(h,{id:"DOQUen",values:{0:n.length,1:Xe(n.length)},components:{0:e("span",{title:n.length})}})}),!g&&b>1&&e(O,{children:[" ","·"," ",e("span",{children:e(h,{id:"qSQQSe",values:{0:Xe(b),totalComments:b},components:{0:e("span",{title:b})}})})]})]}),e(T,{icon:"chevron-down",class:"replies-summary-chevron"}),!!u&&e(ge,{class:"replies-parent-link",to:u.to,onClick:u.onClick,title:l({id:"ZlV82A"}),children:"»"})]}),k&&e("ul",{children:n.map(I=>{var E,L;return e("li",{children:[e("div",{class:"status-focus",tabIndex:0,children:[e(Ke,{statusID:I.id,instance:i,withinContext:!0,size:"s",enableTranslate:!0,onMediaClick:w,showActionsBar:!0}),!((E=I.replies)!=null&&E.length)&&I.repliesCount>0&&e("div",{class:"replies-link",children:[e(T,{icon:"comment2",alt:l({id:"N8UzTV"})})," ",e("span",{title:I.repliesCount,children:Xe(I.repliesCount)})]})]}),((L=I.replies)==null?void 0:L.length)&&e(co,{instance:i,replies:I.replies,level:I.level,accWeight:y?f:I.weight,openAll:r,parentLink:{to:i?`/${i}/s/${I.id}`:`/s/${I.id}`,onClick:()=>{kn(I.id)}}})]},I.id)})})]})}const Ul=140,Bl=35,Fl=70,Hl=140,ii=new Map;function nn(n){var p,f;const i=ii.get(n.id);if(i)return i;const{spoilerText:s,content:o,mediaAttachments:c,poll:r,card:u}=n,l=Ss(s+o),d=c!=null&&c.length?Ul:0,a=(((p=r==null?void 0:r.options)==null?void 0:p.length)||0)*Bl,m=u&&(c!=null&&c.length||(f=r==null?void 0:r.options)!=null&&f.length)?0:Fl,g=(l+d+a+m)/Hl;return ii.set(n.id,g),g}const ql=ct(Pl);function Yl(){const n=Et(),{id:i,instance:s}=n;return e(ql,{id:i,instance:s})}const jl=""+new URL("boosts-carousel-YjmjXTE6.jpg",import.meta.url).href,Vl=""+new URL("grouped-notifications-xYMFVY91.jpg",import.meta.url).href,Kl=""+new URL("multi-column-ETnJNDVb.jpg",import.meta.url).href,Gl=""+new URL("multi-hashtag-timeline-x-SDVR4g.jpg",import.meta.url).href,Wl=""+new URL("nested-comments-thread-Ib-fZGS3.jpg",import.meta.url).href,Zl="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xml:space='preserve'%20fill-rule='evenodd'%20stroke-linejoin='round'%20stroke-miterlimit='2'%20clip-rule='evenodd'%20viewBox='0%200%20102%2028'%3e%3cpath%20fill='none'%20d='M0%200h101.5v27.5H0z'/%3e%3cg%20fill-rule='nonzero'%3e%3cpath%20fill='url(%23a)'%20d='M2.32%2021.85c1.4%200%202.21-.85%202.21-2.3v-4.64H8.5c4.45%200%207.54-2.9%207.54-7.24%200-4.35-2.98-7.24-7.32-7.24h-6.4C.93.43.11%201.28.11%202.73v16.82c0%201.45.82%202.3%202.21%202.3Zm2.21-10.4V3.94h3c2.54%200%204%201.34%204%203.75s-1.47%203.76-4%203.76h-3Z'/%3e%3cpath%20fill='url(%23b)'%20d='M20.52%2021.88c1.25%200%202.13-.76%202.13-2.23v-7.04c0-2.07%201.2-3.49%203.21-3.49%201.95%200%202.95%201.23%202.95%203.25v7.28c0%201.47.89%202.23%202.13%202.23%201.26%200%202.14-.76%202.14-2.23v-8.18c0-3.64-1.99-5.9-5.48-5.9-2.38%200-4.1%201.12-4.93%203.1h-.09V2.3c0-1.38-.78-2.2-2.1-2.2-1.31%200-2.1.82-2.1%202.2v17.34c0%201.47.9%202.23%202.14%202.23Z'/%3e%3cpath%20fill='url(%23c)'%20d='M40.45%2021.82c1.96%200%203.93-.98%204.8-2.65h.1v.8c.08%201.27.89%201.91%202.05%201.91%201.21%200%202.08-.73%202.08-2.15v-8.95c0-3.17-2.63-5.25-6.65-5.25-3.26%200-5.78%201.16-6.5%203.04-.15.32-.23.63-.23.96%200%20.97.75%201.64%201.79%201.64.69%200%201.23-.26%201.7-.79.95-1.23%201.74-1.65%203.04-1.65%201.62%200%202.64.85%202.64%202.31v1.04l-3.95.24c-3.93.23-6.13%201.88-6.13%204.74%200%202.83%202.27%204.76%205.26%204.76Zm1.4-3.09c-1.43%200-2.4-.73-2.4-1.9%200-1.12.91-1.83%202.51-1.95l3.31-.2v1.14c0%201.7-1.54%202.91-3.41%202.91Z'/%3e%3cpath%20fill='url(%23d)'%20d='M54.37%2021.88c1.26%200%202.14-.76%202.14-2.23v-7.09c0-2.03%201.21-3.44%203.13-3.44s2.89%201.17%202.89%203.22v7.31c0%201.47.88%202.23%202.14%202.23%201.24%200%202.13-.76%202.13-2.23v-8.2c0-3.68-1.96-5.87-5.45-5.87-2.41%200-4%201.07-4.83%203.01h-.09v-.87c0-1.35-.85-2.17-2.14-2.17-1.28%200-2.06.82-2.06%202.15v11.95c0%201.47.9%202.23%202.14%202.23Z'/%3e%3cpath%20fill='url(%23e)'%20d='M71.65%2027.17c1.26%200%202.14-.76%202.14-2.23v-6h.09a5.15%205.15%200%200%200%204.88%202.88c3.92%200%206.35-3.05%206.35-8.1%200-5.07-2.44-8.1-6.43-8.1a5.12%205.12%200%200%200-4.86%202.99h-.09v-.85c0-1.45-.88-2.21-2.1-2.21-1.24%200-2.11.76-2.11%202.2v17.2c0%201.46.89%202.22%202.13%202.22Zm5.6-8.8c-2.1%200-3.47-1.8-3.47-4.65%200-2.81%201.37-4.67%203.47-4.67%202.14%200%203.49%201.83%203.49%204.67%200%202.86-1.35%204.66-3.5%204.66Z'/%3e%3cpath%20fill='url(%23f)'%20d='M89.61%2027.39c3.44%200%205.26-1.5%206.73-5.55l4.81-13.1a4%204%200%200%200%20.24-1.26c0-1.13-.85-1.93-2.08-1.93-1.1%200-1.71.51-2.07%201.7l-3.4%2010.9h-.08L90.35%207.28c-.36-1.25-.94-1.73-2.07-1.73-1.26%200-2.21.83-2.21%201.99%200%20.35.09.82.25%201.26l5%2013.21-.21.56c-.52%201.1-1.32%201.42-2.07%201.42l-.75-.01c-.96%200-1.56.54-1.56%201.4%200%201.29%201%202%202.88%202Z'/%3e%3c/g%3e%3cdefs%3e%3cradialGradient%20id='a'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='b'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='c'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='d'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='e'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3cradialGradient%20id='f'%20cx='0'%20cy='0'%20r='1'%20gradientTransform='rotate(28.51%20.06%20.22)%20scale(57.6252)'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23a4bff7'/%3e%3cstop%20offset='1'%20stop-color='%236081e6'/%3e%3c/radialGradient%3e%3c/defs%3e%3c/svg%3e",Xl={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:en,PHANPY_WEBSITE:os,PHANPY_PRIVACY_POLICY_URL:Jl,PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL:cs}=Xl,as=os?os.replace(/https?:\/\//g,"").replace(/\/$/,""):null,rs=`${"2024-12-28T11:12:09.380Z".slice(0,10).replace(/-/g,".")}.119d4b0`;function ao(){const{_:n}=ue();return et(null,["/","/welcome"]),e("main",{id:"welcome",children:[e("div",{class:"hero-container",children:[e("div",{class:"hero-content",children:[e("h1",{children:[e("img",{src:gi,alt:"",width:"160",height:"160",style:{aspectRatio:"1/1",marginBlockEnd:-16}}),e("img",{src:Zl,alt:"Phanpy",width:"200"})]}),e("p",{class:"desc",children:e(h,{id:"Ogtv0V"})}),e("p",{children:e(ge,{to:en?`/login?instance=${en}&submit=1`:"/login",class:"button",children:n(en?{id:"sQia9P"}:{id:"ZLoGls"})})}),en&&cs&&e("p",{children:e("a",{href:cs,class:"button plain5",children:e(h,{id:"e+RpCP"})})}),!en&&e("p",{class:"insignificant",children:e("small",{children:e(h,{id:"fvAsUK",components:{0:e("br",{})}})})})]}),(as||rs)&&e("p",{class:"app-site-version",children:e("small",{children:[as," ",rs]})}),e("p",{children:e(h,{id:"BskFI2",components:{0:e("a",{href:"https://github.com/cheeaun/phanpy",target:"_blank"}),1:e("a",{href:"https://mastodon.social/@cheeaun",target:"_blank",onClick:i=>{i.preventDefault(),A.showAccount="cheeaun@mastodon.social"}}),2:e("a",{href:Jl,target:"_blank"})}})}),e("div",{children:e(bi,{})})]}),e("div",{id:"why-container",children:e("div",{class:"sections",children:[e("section",{children:[e("img",{src:jl,alt:n({id:"S5cYrQ"}),loading:"lazy"}),e("h4",{children:e(h,{id:"Tu+sCN"})}),e("p",{children:e(h,{id:"e2uVlo"})})]}),e("section",{children:[e("img",{src:Wl,alt:n({id:"CGQ27z"}),loading:"lazy"}),e("h4",{children:e(h,{id:"cYE45+"})}),e("p",{children:e(h,{id:"Pc7QKh"})})]}),e("section",{children:[e("img",{src:Vl,alt:n({id:"rnrM7k"}),loading:"lazy"}),e("h4",{children:e(h,{id:"4RRMre"})}),e("p",{children:e(h,{id:"8GMtDr"})})]}),e("section",{children:[e("img",{src:Kl,alt:n({id:"VLKtvP"}),loading:"lazy"}),e("h4",{children:e(h,{id:"pEkad9"})}),e("p",{children:e(h,{id:"t7Py5R"})})]}),e("section",{children:[e("img",{src:Gl,alt:n({id:"wOax6E"}),loading:"lazy"}),e("h4",{children:e(h,{id:"Wi1Ov0"})}),e("p",{children:e(h,{id:"tS2i+h"})})]})]})})]})}const Ql=window.alert;window.__nativeAlert||(window.__nativeAlert=Ql);window.alert=function(n){n instanceof Error&&(n!=null&&n.message)&&(n=n.message),typeof n!="string"&&(n=JSON.stringify(n));const i=Ko({text:n,className:"alert",gravity:"top",position:"center",duration:1e4,offset:{y:48},onClick:()=>{i.hideToast()}});i.showToast()};window.__STATES__=A;window.__STATES_STATS__=()=>{const n=["statuses","accounts","spoilers","unfurledLinks","statusQuotes"],i={};n.forEach(c=>{i[c]=Object.keys(A[c]).length});const{statuses:s}=A,o=[];for(const c in s)document.querySelector(`[data-state-post-id~="${c}"], [data-state-post-ids~="${c}"]`)||o.push(c)};setInterval(()=>{if(!window.__IDLE__)return;const{statuses:n,unfurledLinks:i,notifications:s}=A;let o=0;const{instance:c}=le();for(const r in n){if(!window.__IDLE__)break;try{const u=document.querySelector(`[data-state-post-id~="${r}"], [data-state-post-ids~="${r}"]`),l=s.some(d=>{var a;return r===ot((a=d.status)==null?void 0:a.id,c)});if(!u&&!l){delete A.statuses[r],delete A.statusQuotes[r];for(const d in i){const a=i[d];if(ot(a.id,a.instance)===r){delete A.unfurledLinks[d];break}}o++}}catch{}}},15*60*1e3);setTimeout(()=>{for(const n in Bt)setTimeout(()=>{var i,s,o,c,r,u;Array.isArray(Bt[n])?(s=(i=Bt[n])[0])==null||s.call(i):typeof Bt[n]=="object"?(c=(o=Bt[n]).module)==null||c.call(o):(u=(r=Bt)[n])==null||u.call(r)},1)},5e3);(()=>{window.__IDLE__=!0;const n=["mousemove","mousedown","resize","keydown","touchstart","pointerdown","pointermove","wheel"],i=()=>{window.__IDLE__=!0},o=Cs(i,3e3),c=()=>{window.__IDLE__=!1,o()};n.forEach(r=>{window.addEventListener(r,c,{passive:!0,capture:!0})}),window.addEventListener("blur",i,{passive:!0}),document.documentElement.addEventListener("mouseleave",r=>{!r.relatedTarget&&!r.toElement&&i()},{passive:!0})})();const ed=/iPad|iPhone|iPod/.test(navigator.userAgent);ed&&document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible"){if(document.getElementsByClassName("media-modal-container").length>0)return;const i=we.local.get("theme");let s;if(i){if(s=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),s){const o=s.content,c=i==="light"?s.dataset.themeLightColorTemp:s.dataset.themeDarkColorTemp;s.content=c||"",setTimeout(()=>{s.content=o},10)}}else{const o=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light";if(s=document.querySelector(`meta[name="theme-color"][media*="${o}"]`),s){const c=s.dataset.content,r=s.dataset.contentTemp;s.content=r||"",setTimeout(()=>{s.content=c},10)}}}});{const n=we.local.get("theme");if(n){document.documentElement.classList.add(`is-${n}`),document.querySelector('meta[name="color-scheme"]').setAttribute("content",n||"dark light");const s=document.querySelector('meta[data-theme-setting="manual"]');s&&(s.name="theme-color",s.content=n==="light"?s.dataset.themeLightColor:s.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(c=>{c.name=""})}const i=we.local.get("textSize");i&&document.documentElement.style.setProperty("--text-size",`${i}px`)}us(A,n=>{var i;for(const[s,o,c,r]of n){if(o.join(".")==="settings.shortcutsViewMode"){const u=document.getElementById("app");u&&(u.dataset.shortcutsViewMode=(i=A.shortcuts)!=null&&i.length?c:"")}o.join(".")==="settings.cloakMode"&&document.body.classList.toggle("cloak",c)}});const mn=new Map;window.__BENCH_RESULTS=new Map;window.__BENCHMARK={start(n){},end(n){}};function td(){const[n,i]=$(!1),[s,o]=$("loading");__BENCHMARK.start("app-init"),__BENCHMARK.start("time-to-following"),__BENCHMARK.start("time-to-home"),__BENCHMARK.start("time-to-isLoggedIn"),ue(),ne(()=>{const r=we.local.get("instanceURL"),u=decodeURIComponent((window.location.search.match(/code=([^&]+)/)||[,""])[1]);if(u){window.history.replaceState({},document.title,window.location.pathname||"/");const l=we.sessionCookie.get("clientID"),d=we.sessionCookie.get("clientSecret"),a=we.sessionCookie.get("vapidKey"),m=we.sessionCookie.get("codeVerifier");(async()=>{o("loading");const{access_token:b}=await El({instanceURL:r,client_id:l,client_secret:d,code:u,code_verifier:m||void 0});if(b){const g=_o({instance:r,accessToken:b});await Promise.allSettled([On(g),zn(g,r),Co(g,r,b,a)]),Ti(),window.__IGNORE_GET_ACCOUNT_ERROR__=!0,i(!0),o("default")}else o("error");__BENCHMARK.end("app-init")})()}else{window.__IGNORE_GET_ACCOUNT_ERROR__=!0;const l=decodeURIComponent((window.location.search.match(/account=([^&]+)/)||[,""])[1]);let d;if(l&&(d=Io(l),d&&(Sn(d.info.id),window.history.replaceState({},document.title,window.location.pathname||"/"))),d||(d=si()),d){Sn(d.info.id);const{client:a}=le({account:d}),{instance:m}=a;Ti(),o("loading"),(async()=>{try{To()&&xo(m)?(On(a),zn(a,m)):await Promise.allSettled([On(a),zn(a,m)])}catch{}finally{i(!0),o("default"),__BENCHMARK.end("app-init")}})()}else o("default"),__BENCHMARK.end("app-init")}we.sessionCookie.del("clientID"),we.sessionCookie.del("clientSecret"),we.sessionCookie.del("codeVerifier")},[]);let c=Wt();return A.currentLocation=c.pathname,ne(Xn,[c,n]),/\/https?:/.test(c.pathname)?e(fl,{}):s==="loading"?e(Be,{id:"loader-root"}):e(O,{children:[e(id,{isLoggedIn:n}),e(sd,{isLoggedIn:n}),e(ci,{children:e(Ge,{path:"/:instance?/s/:id",element:e(Yl,{})})}),n&&e(Xo,{}),n&&e(Ua,{}),e($a,{}),n&&e(Pa,{}),e(Zo,{isLoggedIn:n}),e(Oa,{onClose:Xn}),e(Jo,{})]})}function nd({isLoggedIn:n}){return n&&__BENCHMARK.end("time-to-isLoggedIn"),n?e(dl,{}):e(ao,{})}const id=ct(({isLoggedIn:n})=>{const i=Wt(),s=Te(()=>{const{pathname:o}=i;return!/^\/(login|welcome)/i.test(o)},[i]);return e(ci,{location:s||i,children:[e(Ge,{path:"/",element:e(nd,{isLoggedIn:n})}),e(Ge,{path:"/login",element:e($l,{})}),e(Ge,{path:"/welcome",element:e(ao,{})})]})});function ls(){return A.prevLocation||null}function sd({isLoggedIn:n}){const i=Wt(),s=j(ls());return Te(()=>sn("/:instance/s/:id",i.pathname)||sn("/s/:id",i.pathname),[i.pathname,sn])?s.current||(s.current=ls()):s.current=null,e(ci,{location:s.current||i,children:[n&&e(O,{children:[e(Ge,{path:"/notifications",element:e(eo,{})}),e(Ge,{path:"/mentions",element:e(Xs,{})}),e(Ge,{path:"/following",element:e(_i,{})}),e(Ge,{path:"/b",element:e(qs,{})}),e(Ge,{path:"/f",element:e(Ys,{})}),e(Ge,{path:"/l",children:[e(Ge,{index:!0,element:e(pl,{})}),e(Ge,{path:":id",element:e(Ks,{})})]}),e(Ge,{path:"/fh",element:e(Ar,{})}),e(Ge,{path:"/ft",element:e(Cr,{})}),e(Ge,{path:"/catchup",element:e(hr,{})}),e(Ge,{path:"/annual_report/:year",element:e(sr,{})})]}),e(Ge,{path:"/:instance?/t/:hashtag",element:e(Vs,{})}),e(Ge,{path:"/:instance?/a/:id",element:e(nr,{})}),e(Ge,{path:"/:instance?/p",children:[e(Ge,{index:!0,element:e(ti,{})}),e(Ge,{path:"l",element:e(ti,{local:!0})})]}),e(Ge,{path:"/:instance?/trending",element:e(io,{})}),e(Ge,{path:"/:instance?/search",element:e(to,{})})]})}Ao();Lo(e(Eo,{i18n:he,children:e(Ro,{children:e(td,{})})}),document.getElementById("app"));setTimeout(()=>{try{Object.keys(localStorage).forEach(n=>{n.startsWith("iconify")&&localStorage.removeItem(n)}),Object.keys(sessionStorage).forEach(n=>{n.startsWith("iconify")&&sessionStorage.removeItem(n)}),localStorage.removeItem("settings:boostsCarousel")}catch{}},5e3);if("serviceWorker"in navigator&&typeof caches<"u"){const i=["icons"];let s=!1;const o=1e4,c=60*60*1e3;async function r(){if(window.__IDLE__)try{const u=await caches.keys();for(const l of u){if(i.includes(l))continue;const d=await caches.open(l),a=await d.keys();if(a.length>50){const m=a.slice(50);for(const b of m)await d.delete(b)}}s=!0}catch{}setTimeout(r,s?c:o)}setTimeout(r,o)}window.__CLOAK__=()=>{document.body.classList.toggle("cloak")};
|
||
//# sourceMappingURL=main-B7dDrG0m.js.map
|