Files
phanpy-cz/assets/main-BIy8J6P1.js
2026-02-07 19:49:28 +01:00

31 lines
356 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./dom-BGTnaPi8.js","./pwa-viewport-7HQOd5MC.js","./ScheduledAtField-B9b7q7O5.js","./ICONS-C5h6VnP9.js","./mock-home-Qu-AgQUK.js","./year-in-posts-DZVzhOlC.js"])))=>i.map(i=>d[i]);
import{Q as $c,u as e,x as ho,A as K,y as G,M as lt,a as ne,d as R,s as E,b as oe,c as Je,p as Ct,e as We,q as st,g as kt,k as N,T as m,f as on,h as Mt,i as jt,j as Xn,l as ke,m as Ce,L as Mc,C as bi,n as Pc,o as Dc,r as Qn,t as Ui,v as gs,w as Qt,z as li,B as Be,E as Nc,F as Oc,G as Ki,H as he,I as Jn,J as ei,_ as St,K as di,N as fo,O as Oh,P as po,R as Hi,S as zc,U as Bc,V as wn,W as ht,X as qc,Y as Fc,Z as _t,$ as Uc,a0 as ji,a1 as Vi,a2 as qt,a3 as et,a4 as mo,a5 as go,a6 as Kc,a7 as yo,a8 as Hc,a9 as jc,aa as bn,ab as Vc,ac as Yc,ad as vo,ae as Wc,af as wi,ag as ki,ah as Gc,ai as ys,aj as Zc,ak as Xc,al as Qc,am as Yi,an as Ze,ao as bo,ap as Jc,aq as ea,ar as ta,as as na,at as ia,au as sa,av as oa}from"./pwa-viewport-7HQOd5MC.js";import{u as Wi,d as Ke,s as re,o as vs,a as ca,V as wo,b as ko,I,C as Gi,M as Ve,c as Ye,S as xn,e as ge,f as ui,R as Tt,n as rt,g as So,h as Fe,A as ut,N as mt,i as ft,j as vt,L as ye,l as zt,k as aa,m as Co,p as Wt,q as ra,r as Bh,t as Qe,v as hi,w as gt,x as bs,T as _o,y as at,z as Li,B as Io,E as xo,D as Xe,F as wt,G as je,H as $t,J as la,K as da,O as Vt,P as Zi,Q as Ao,U as ua,W as cn,X as ha,Y as fa,Z as fi,_ as pa,$ as Gt,a0 as ma,a1 as ga,a2 as To,a3 as ya,a4 as Xi,a5 as va,a6 as ba,a7 as wa,a8 as ka,a9 as Sa,aa as Eo,ab as Ca,ac as _a,ad as ws,ae as Ia,af as xa}from"./ScheduledAtField-B9b7q7O5.js";import{ICONS as en}from"./ICONS-C5h6VnP9.js";var Ro=Aa;function Aa(n,i,s){var o=null,c=null,a=function(){o&&(clearTimeout(o),c=null,o=null)},u=function(){var l=c;a(),l&&l()},d=function(){if(!i)return n.apply(this,arguments);var l=this,r=arguments,h=s&&!o;if(a(),c=function(){n.apply(l,r)},o=setTimeout(function(){if(o=null,!h){var f=c;return c=null,f()}},i),h)return c()};return d.cancel=a,d.flush=u,d}(function(n,i){"use strict";typeof n.CustomEvent!="function"&&(n.CustomEvent=function(y,g){g=g||{bubbles:!1,cancelable:!1,detail:void 0};var w=i.createEvent("CustomEvent");return w.initCustomEvent(y,g.bubbles,g.cancelable,g.detail),w},n.CustomEvent.prototype=n.Event.prototype),i.addEventListener("touchstart",h,!1),i.addEventListener("touchmove",f,!1),i.addEventListener("touchend",r,!1);var s=null,o=null,c=null,a=null,u=null,d=null,l=0;function r(y){if(d===y.target){var g=parseInt(p(d,"data-swipe-threshold","20"),10),w=p(d,"data-swipe-unit","px"),k=parseInt(p(d,"data-swipe-timeout","500"),10),b=Date.now()-u,v="",_=y.changedTouches||y.touches||[];if(w==="vh"&&(g=Math.round(g/100*i.documentElement.clientHeight)),w==="vw"&&(g=Math.round(g/100*i.documentElement.clientWidth)),Math.abs(c)>Math.abs(a)?Math.abs(c)>g&&b<k&&(c>0?v="swiped-left":v="swiped-right"):Math.abs(a)>g&&b<k&&(a>0?v="swiped-up":v="swiped-down"),v!==""){var S={dir:v.replace(/swiped-/,""),touchType:(_[0]||{}).touchType||"direct",fingers:l,xStart:parseInt(s,10),xEnd:parseInt((_[0]||{}).clientX||-1,10),yStart:parseInt(o,10),yEnd:parseInt((_[0]||{}).clientY||-1,10)};d.dispatchEvent(new CustomEvent("swiped",{bubbles:!0,cancelable:!0,detail:S})),d.dispatchEvent(new CustomEvent(v,{bubbles:!0,cancelable:!0,detail:S}))}s=null,o=null,u=null}}function h(y){y.target.getAttribute("data-swipe-ignore")!=="true"&&(d=y.target,u=Date.now(),s=y.touches[0].clientX,o=y.touches[0].clientY,c=0,a=0,l=y.touches.length)}function f(y){if(!(!s||!o)){var g=y.touches[0].clientX,w=y.touches[0].clientY;c=s-g,a=o-w}}function p(y,g,w){for(;y&&y!==i.documentElement;){var k=y.getAttribute(g);if(k)return k;y=y.parentNode}return w}})(window,document);const Lo=$c(!1);function Ta({children:n,value:i}){return e(Lo.Provider,{value:i,children:n})}function Qi(){return ho(Lo)}function an(n=()=>{},i=[]){const s=K(n);G(()=>{s.current=n},[i]),G(()=>{const o=()=>{const c=document.hidden||document.visibilityState==="hidden";s.current(!c)};return document.addEventListener("visibilitychange",o),()=>document.removeEventListener("visibilitychange",o)},[])}const Ea=1e3*3,ks=2e4,Ra=lt(function(){const i=Qi(),{_:s}=ne(),[o,c]=R(!0),a=K();an(r=>{clearTimeout(a.current),r?c(!0):a.current=setTimeout(()=>{c(!1)},ks)});const u=async(r,h,f)=>{if(E.notificationsLast){const p=r.v1.notifications.list({limit:1,sinceId:E.notificationsLast.id}).values(),{value:y}=await p.next();if(y?.length)if(f)E.notificationsShowNew=!0;else{let g;try{g=(await r.v1.markers.fetch({timeline:"notifications"}))?.notifications?.lastReadId}catch{}g?E.notificationsShowNew=y[0].id!==g:E.notificationsShowNew=!0}}};G(()=>{let r,h,f;if(i&&o){const{masto:p,streaming:y,instance:g}=oe();(async()=>{await u(p,g);let w=!1;y&&(h=setTimeout(()=>{(async()=>{try{w=!0,r=y.user.notification.subscribe();for await(const k of r){if(!r||!o)break;k.event==="notification"&&Je(k.payload,g,{skipThreading:!0}),E.notificationsShowNew=!0}}catch{w=!1}w||(f=setInterval(()=>{u(p,g,!0)},ks))})()},Ea))})()}return()=>{r?.unsubscribe?.(),r=null,clearTimeout(h),clearInterval(f)}},[o,i]);const d=K(),l=()=>{d.current=Date.now(),fetch("./version.json").then(r=>r.json()).then(r=>{r&&(E.appVersion=r)}).catch(r=>{})};return Wi(l,o&&1e3*60*30),an(r=>{r&&(d.current?Date.now()-d.current>1e3*60*60&&l():l())}),Ke("shift+alt+k",r=>{if(!r.shiftKey||!r.altKey)return;const h=E.settings.cloakMode;E.settings.cloakMode=!h,re({text:s(h?{id:"oguMwa"}:{id:"IXZLPs"})})},{ignoreEventWhen:r=>r.metaKey||r.ctrlKey}),null}),La=Ct(async(n,i)=>{const s=n.v1.accounts.$select(i).statuses.list({limit:3,exclude_replies:!0,exclude_reblogs:!0}).values(),{value:o}=await s.next();return o||[]},{expires:6e4});function $a(){const{_:n}=ne(),i=We(E),{masto:s}=oe(),[o,c]=R(!1),[a,u]=R([]),[d,l]=R(!1),r=K(null),h=K(null),f=i.settings.shortcutsViewMode==="multi-column";function p(k){if(k.key&&k.key.toLowerCase()!=="c")return;if(i.composerState.minimized){E.composerState.minimized=!1,vs();return}const b=document.querySelectorAll("data.compose-data"),v=!f&&b.length===1?JSON.parse(b[0].value):void 0;k.shiftKey?ca(v)||(E.showCompose=v||!0):(vs(),E.showCompose=v||!0)}Ke("c, shift+c",p,{useKey:!0,ignoreEventWhen:k=>!!document.querySelector("#modal-container > *")||k.metaKey||k.ctrlKey||k.altKey});const y=wo(()=>{c(!0)},{threshold:600}),g=st(async()=>{try{l(!0);const k=kt();if(!k)return;const b=await La(s,k);u(b)}catch{}finally{l(!1)}},[s]),w=st(k=>{ko({replyToStatus:k}),c(!1)},[]);return G(()=>{o&&g()},[g,o]),e(N,{children:[e("button",{ref:r,type:"button",id:"compose-button",onClick:p,onContextMenu:k=>{k.preventDefault(),c(!0)},...y(),class:`${i.composerState.minimized?"min":""} ${i.composerState.publishing?"loading":""} ${i.composerState.publishingError?"error":""}`,children:e(I,{icon:"quill",size:"xl",alt:n({id:"QOhkyl"})})}),e(Gi,{ref:h,state:o?"open":void 0,anchorRef:r,onClose:()=>c(!1),direction:"top",gap:8,unmountOnClose:!0,portal:{target:document.body},boundingBoxPadding:So(),containerProps:{style:{zIndex:19},onClick:()=>{h.current?.closeMenu?.()}},submenuOpenDelay:600,children:[e(Ve,{to:"/sp",children:[e(I,{icon:"schedule"})," ",e("span",{children:e(m,{id:"+GkIdc"})})]}),e(Ye,{}),e(xn,{align:"end",direction:"top",shift:-8,disabled:d||a.length===0,label:e(N,{children:[e(I,{icon:"comment"})," ",e("span",{className:"menu-grow",children:e(m,{id:"LwOr4P"})}),d?"…":e(I,{icon:"chevron-right"})]}),children:a.length>0&&a.map(k=>{const b=new Date(k.createdAt),v=Date.now()-b.getTime()<864e5;return e(ge,{onClick:()=>w(k),children:e("small",{children:[e("div",{class:"menu-post-text",children:ui(k)}),e("span",{className:"more-insignificant",children:[v&&e(N,{children:[e(Tt,{datetime:b,format:"micro"})," ",""," "]}),e("time",{className:"created",dateTime:b.toISOString(),title:b.toLocaleString(),children:rt(k.createdAt)})]})]})},k.id)})})]})]})}function dn({key1:n,key2:i}){return e(m,{id:"Qh+0sm",values:{key1:n,key2:i},components:{0:e("kbd",{}),1:e("kbd",{})}})}const Ma=lt(function(){const{_:i}=ne(),s=We(E);function o(){E.showKeyboardShortcutsHelp=!1}return Ke("?",()=>{E.showKeyboardShortcutsHelp=!0},{useKey:!0,ignoreModifiers:!0,ignoreEventWhen:c=>/\/catchup/i.test(location.hash)||c.metaKey||c.ctrlKey||c.altKey}),!!s.showKeyboardShortcutsHelp&&e(Fe,{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(I,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(m,{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(m,{id:"mzjGX4",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"S5ez7Y"}),keys:e(m,{id:"Fd8FaU",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"VkLESX"}),keys:e("kbd",{children:"."})},{action:i({id:"jsFF8C"}),keys:e("kbd",{children:"Enter"})},{action:i({id:"9VPqHP"}),keys:e("kbd",{children:"o"})},{action:e(m,{id:"41gejM",components:{0:e("br",{})}}),keys:e("kbd",{children:"x"})},{action:i({id:"jAj8rv"}),keys:e(m,{id:"evz6c6",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"duF1lx"}),keys:e(m,{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(m,{id:"+Cxvld",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"1pKapz"}),keys:e(m,{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(m,{id:"XpQLJF",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"cqi4Mx"}),keys:e(m,{id:"84WuL2",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"kulphB"}),keys:e(m,{id:"yrz6Ck",components:{0:e("kbd",{}),1:e("kbd",{})}})},{action:i({id:"ZhhOwV"}),keys:e("kbd",{children:"q"})},{action:i({id:"PZlHt8"}),keys:e("kbd",{children:"d"})},{action:i({id:"C7ujRh"}),keys:e(m,{id:"v4TbMP",components:{0:e("kbd",{}),1:e("kbd",{}),2:e("kbd",{})}})},{action:i({id:"UmuIdg"}),keys:e(dn,{key1:"g",key2:"h"})},{action:i({id:"0YgcH9"}),keys:e(dn,{key1:"g",key2:"n"})},{action:i({id:"mT57+Q"}),keys:e(dn,{key1:"g",key2:"s"})},{action:i({id:"T1/8PL"}),keys:e(dn,{key1:"g",key2:"p"})},{action:i({id:"29r697"}),keys:e(dn,{key1:"g",key2:"b"})}].map(({action:c,className:a,keys:u})=>e("tr",{children:[e("th",{class:a,children:c}),e("td",{children:u})]},c))})})})]})})}),$i=new Set,ot=new WeakMap,Zt=new WeakMap,yt=new WeakMap,kn=new WeakMap,Si=new WeakMap,yn=new WeakMap,Yt=new WeakMap,Bt=new WeakMap,sn=new WeakSet;let dt,Ji=0,es=0;const Rt="__aa_tgt",Sn="__aa_del",ti="__aa_new",$o=n=>{const i=Oa(n);i&&i.forEach(s=>za(s))},Pa=n=>{n.forEach(i=>{i.target===dt&&Da(),ot.has(i.target)&&Jt(i.target)})};function Mo(n){const i=n.getBoundingClientRect(),s=dt?.clientWidth||0,o=dt?.clientHeight||0;return i.bottom<0||i.top>o||i.right<0||i.left>s}function ts(n){const i=kn.get(n);i?.disconnect();let s=ot.get(n),o=0;const c=5;s||(s=rn(n),ot.set(n,s));const{offsetWidth:a,offsetHeight:u}=dt,l=[s.top-c,a-(s.left+c+s.width),u-(s.top+c+s.height),s.left-c].map(h=>`${-1*Math.floor(h)}px`).join(" "),r=new IntersectionObserver(()=>{++o>1&&Jt(n)},{root:dt,threshold:1,rootMargin:l});r.observe(n),kn.set(n,r)}function Jt(n,i=!0){clearTimeout(Bt.get(n));const s=pi(n),o=i?Cn(s)?500:s.duration:0;Bt.set(n,setTimeout(async()=>{const c=yt.get(n);try{await c?.finished,ot.set(n,rn(n)),ts(n)}catch{}},o))}function Da(){clearTimeout(Bt.get(dt)),Bt.set(dt,setTimeout(()=>{$i.forEach(n=>qn(n,i=>Po(()=>Jt(i))))},100))}function Na(n){setTimeout(()=>{yn.set(n,setInterval(()=>Po(Jt.bind(null,n)),2e3))},Math.round(2e3*Math.random()))}function Po(n){typeof requestIdleCallback=="function"?requestIdleCallback(()=>n()):requestAnimationFrame(()=>n())}let Et;const Do=typeof window<"u"&&"ResizeObserver"in window;Do&&(dt=document.documentElement,new MutationObserver($o),Et=new ResizeObserver(Pa),window.addEventListener("scroll",()=>{es=window.scrollY,Ji=window.scrollX}),Et.observe(dt));function Oa(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(Ci(c.target),!o.has(c.target)){o.add(c.target);for(let a=0;a<c.target.children.length;a++){const u=c.target.children.item(a);if(u){if(Sn in u)return!1;Ci(c.target,u),o.add(u)}}}if(c.removedNodes.length)for(let a=0;a<c.removedNodes.length;a++){const u=c.removedNodes[a];if(Sn in u)return!1;u instanceof Element&&(o.add(u),Ci(c.target,u),Zt.set(u,[c.previousSibling,c.nextSibling]))}}return o},new Set)}function Ci(n,i){!i&&!(Rt in n)?Object.defineProperty(n,Rt,{value:n}):i&&!(Rt in i)&&Object.defineProperty(i,Rt,{value:n})}function za(n){var i,s;const o=n.isConnected,c=ot.has(n);o&&Zt.has(n)&&Zt.delete(n),((i=yt.get(n))===null||i===void 0?void 0:i.playState)!=="finished"&&((s=yt.get(n))===null||s===void 0||s.cancel()),ti in n?Ss(n):c&&o?qa(n):c&&!o?Fa(n):Ss(n)}function At(n){return Number(n.replace(/[^0-9.\-]/g,""))}function Ba(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 rn(n){const i=n.getBoundingClientRect(),{x:s,y:o}=Ba(n);return{top:i.top+o,left:i.left+s,width:i.width,height:i.height}}function No(n,i,s){let o=i.width,c=i.height,a=s.width,u=s.height;const d=getComputedStyle(n);if(d.getPropertyValue("box-sizing")==="content-box"){const r=At(d.paddingTop)+At(d.paddingBottom)+At(d.borderTopWidth)+At(d.borderBottomWidth),h=At(d.paddingLeft)+At(d.paddingRight)+At(d.borderRightWidth)+At(d.borderLeftWidth);o-=h,a-=h,c-=r,u-=r}return[o,a,c,u].map(Math.round)}function pi(n){return Rt in n&&Yt.has(n[Rt])?Yt.get(n[Rt]):{duration:250,easing:"ease-in-out"}}function Oo(n){if(Rt in n)return n[Rt]}function ns(n){const i=Oo(n);return i?sn.has(i):!1}function qn(n,...i){i.forEach(s=>s(n,Yt.has(n)));for(let s=0;s<n.children.length;s++){const o=n.children.item(s);o&&i.forEach(c=>c(o,Yt.has(o)))}}function is(n){return Array.isArray(n)?n:[n]}function Cn(n){return typeof n=="function"}function qa(n){const i=ot.get(n),s=rn(n);if(!ns(n))return ot.set(n,s);if(Mo(n)){ot.set(n,s),ts(n);return}let o;if(!i)return;const c=pi(n);if(typeof c!="function"){let a=i.left-s.left,u=i.top-s.top;const d=i.left+i.width-(s.left+s.width);i.top+i.height-(s.top+s.height)==0&&(u=0),d==0&&(a=0);const[r,h,f,p]=No(n,i,s),y={transform:`translate(${a}px, ${u}px)`},g={transform:"translate(0, 0)"};r!==h&&(y.width=`${r}px`,g.width=`${h}px`),f!==p&&(y.height=`${f}px`,g.height=`${p}px`),o=n.animate([y,g],{duration:c.duration,easing:c.easing})}else{const[a]=is(c(n,"remain",i,s));o=new Animation(a),o.play()}yt.set(n,o),ot.set(n,s),o.addEventListener("finish",Jt.bind(null,n,!1),{once:!0})}function Ss(n){ti in n&&delete n[ti];const i=rn(n);ot.set(n,i);const s=pi(n);if(!ns(n))return;if(Mo(n)){ts(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]=is(s(n,"add",i));o=new Animation(c),o.play()}yt.set(n,o),o.addEventListener("finish",Jt.bind(null,n,!1),{once:!0})}function Cs(n,i){var s;n.remove(),ot.delete(n),Zt.delete(n),yt.delete(n),(s=kn.get(n))===null||s===void 0||s.disconnect(),setTimeout(()=>{if(Sn in n&&delete n[Sn],Object.defineProperty(n,ti,{value:!0,configurable:!0}),i&&n instanceof HTMLElement)for(const o in i)n.style[o]=""},0)}function Fa(n){var i;if(!Zt.has(n)||!ot.has(n))return;const[s,o]=Zt.get(n);Object.defineProperty(n,Sn,{value:!0,configurable:!0});const c=window.scrollX,a=window.scrollY;if(o&&o.parentNode&&o.parentNode instanceof Element?o.parentNode.insertBefore(n,o):s&&s.parentNode?s.parentNode.appendChild(n):(i=Oo(n))===null||i===void 0||i.appendChild(n),!ns(n))return Cs(n);const[u,d,l,r]=Ka(n),h=pi(n),f=ot.get(n);(c!==Ji||a!==es)&&Ua(n,c,a,h);let p,y={position:"absolute",top:`${u}px`,left:`${d}px`,width:`${l}px`,height:`${r}px`,margin:"0",pointerEvents:"none",transformOrigin:"center",zIndex:"100"};if(!Cn(h))Object.assign(n.style,y),p=n.animate([{transform:"scale(1)",opacity:1},{transform:"scale(.98)",opacity:0}],{duration:h.duration,easing:"ease-out"});else{const[g,w]=is(h(n,"remove",f));w?.styleReset!==!1&&(y=w?.styleReset||y,Object.assign(n.style,y)),p=new Animation(g),p.play()}yt.set(n,p),p.addEventListener("finish",()=>Cs(n,y),{once:!0})}function Ua(n,i,s,o){const c=Ji-i,a=es-s,u=document.documentElement.style.scrollBehavior;if(getComputedStyle(dt).scrollBehavior==="smooth"&&(document.documentElement.style.scrollBehavior="auto"),window.scrollTo(window.scrollX+c,window.scrollY+a),!n.parentElement)return;const l=n.parentElement;let r=l.clientHeight,h=l.clientWidth;const f=performance.now();function p(){requestAnimationFrame(()=>{if(!Cn(o)){const y=r-l.clientHeight,g=h-l.clientWidth;f+o.duration>performance.now()?(window.scrollTo({left:window.scrollX-g,top:window.scrollY-y}),r=l.clientHeight,h=l.clientWidth,p()):document.documentElement.style.scrollBehavior=u}})}p()}function Ka(n){var i;const s=ot.get(n),[o,,c]=No(n,s,rn(n));let a=n.parentElement;for(;a&&(getComputedStyle(a).position==="static"||a instanceof HTMLBodyElement);)a=a.parentElement;a||(a=document.body);const u=getComputedStyle(a),d=!yt.has(n)||((i=yt.get(n))===null||i===void 0?void 0:i.playState)==="finished"?rn(a):ot.get(a),l=Math.round(s.top-d.top)-At(u.borderTopWidth),r=Math.round(s.left-d.left)-At(u.borderLeftWidth);return[l,r,o,c]}function zo(n,i={}){if(Do&&Et&&!(window.matchMedia("(prefers-reduced-motion: reduce)").matches&&!Cn(i)&&!i.disrespectUserMotionPreference)){sn.add(n),getComputedStyle(n).position==="static"&&Object.assign(n.style,{position:"relative"}),qn(n,Jt,Na,u=>Et?.observe(u)),Cn(i)?Yt.set(n,i):Yt.set(n,{duration:250,easing:"ease-in-out",...i});const a=new MutationObserver($o);a.observe(n,{childList:!0}),Si.set(n,a),$i.add(n)}return Object.freeze({parent:n,enable:()=>{sn.add(n)},disable:()=>{sn.delete(n),qn(n,o=>{const c=yt.get(o);try{c?.cancel()}catch{}yt.delete(o);const a=Bt.get(o);a&&clearTimeout(a),Bt.delete(o);const u=yn.get(o);u&&clearInterval(u),yn.delete(o)})},isEnabled:()=>sn.has(n),destroy:()=>{sn.delete(n),$i.delete(n),Yt.delete(n);const o=Si.get(n);o?.disconnect(),Si.delete(n),qn(n,c=>{Et?.unobserve(c);const a=yt.get(c);try{a?.cancel()}catch{}yt.delete(c);const u=kn.get(c);u?.disconnect(),kn.delete(c);const d=yn.get(c);d&&clearInterval(d),yn.delete(c);const l=Bt.get(c);l&&clearTimeout(l),Bt.delete(c),ot.delete(c),Zt.delete(c)})}})}function mi(n){const i=K(null),[s,o]=R(),c=a=>{s&&(a?s.enable():s.disable())};return G(()=>{i.current instanceof HTMLElement&&o(zo(i.current,n||{}))},[]),G(()=>()=>{var a;(a=s?.destroy)===null||a===void 0||a.call(s)},[s]),[i,c]}function Ha(n){return("0"+n.toString(16)).slice(-2)}function ja(){var n=new Uint32Array(28);return window.crypto.getRandomValues(n),Array.from(n,Ha).join("")}function Va(n){const s=new TextEncoder().encode(n);return window.crypto.subtle.digest("SHA-256",s)}function Ya(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 Bo(n){const i=await Va(n);return Ya(i)}async function Wa({instanceURL:n}){if(!n)return!1;try{const i=await fetch(`https://${n}/.well-known/oauth-authorization-server`);return!i.ok||i.status!==200?!1:!!(await i.json()).code_challenge_methods_supported?.includes("S256")}catch{return!1}}window.__generateCodeChallenge=Bo;const Ga={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{DEV:ss,PHANPY_CLIENT_NAME:Za,PHANPY_WEBSITE:ni}=Ga,os="read write follow push",Xa=ni?ni.toLowerCase().includes(location.hostname):!1,Qa=location.origin+location.pathname,_n=ss||!Xa?Qa:ni;async function Ja({instanceURL:n}){const i=new URLSearchParams({client_name:Za,redirect_uris:_n,scopes:os,website:ni||_n});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 er({instanceURL:n,client_id:i,forceLogin:s=!1}){const o=ja(),c=await Bo(o),a=new URLSearchParams({client_id:i,code_challenge_method:"S256",code_challenge:c,redirect_uri:_n,response_type:"code",scope:os});return s&&a.append("force_login",!0),[`https://${n}/oauth/authorize?${a.toString()}`,o]}async function tr({instanceURL:n,client_id:i,forceLogin:s=!1}){const o=new URLSearchParams({client_id:i,scope:os,redirect_uri:_n,response_type:"code"});return s&&o.append("force_login",!0),`https://${n}/oauth/authorize?${o.toString()}`}async function nr({instanceURL:n,client_id:i,client_secret:s,code:o,code_verifier:c}){const a=new URLSearchParams({client_id:i,redirect_uri:_n,grant_type:"authorization_code",code:o});return s&&a.append("client_secret",s),c&&a.append("code_verifier",c),await(await fetch(`https://${n}/oauth/token`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:a.toString()})).json()}async function ir({instanceURL:n,client_id:i,client_secret:s,token:o}){try{const c=new URLSearchParams({client_id:i,client_secret:s,token:o});return(await fetch(`https://${n}/oauth/revoke`,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:c.toString(),keepalive:!0})).ok}catch{return!1}}const sr=window.matchMedia("(display-mode: standalone)").matches;function or({onClose:n}){const{_:i}=ne(),{masto:s}=oe(),o=on(),c=kt(),a=o.length>1,[u,d]=Mt(r=>r+1,0),[l]=mi();return e("div",{id:"accounts-container",class:"sheet",tabIndex:"-1",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(I,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:e("h2",{children:e(m,{id:"bPwFdf"})})}),e("main",{children:e("section",{children:[e("ul",{class:"accounts-list",ref:l,children:o.map((r,h)=>{const f=r.info.id===c,p=h===0,y=!r.accessToken;return e("li",{children:[e("div",{children:[a&&e("span",{class:`current ${f?"is-current":""}`,children:e(I,{icon:"check-circle",alt:i({id:"Hp1l6f"})})}),e(ut,{url:r.info.avatarStatic,size:"xxl",onDblClick:async()=>{if(f)try{const g=await s.v1.accounts.$select(r.info.id).fetch();r.info=g,jt(o),d()}catch{}}}),e(mt,{account:a?{...r.info,acct:/@/.test(r.info.acct)?r.info.acct:`${r.info.acct}@${r.instanceURL}`}:r.info,showAcct:!0,onClick:()=>{y?(location.href=`/#/login?instance=${r.instanceURL}`,n()):f?E.showAccount=`${r.info.username}@${r.instanceURL}`:(Xn(r.info.id),location.reload())}})]}),e("div",{class:"actions",children:[y&&e("span",{class:"tag",children:e(m,{id:"mxY4xF"})}),p&&a&&e(N,{children:[e("span",{class:"tag",children:e(m,{id:"ovBPCi"})})," "]}),e(ft,{align:"end",menuButton:e("button",{type:"button",class:"plain more-button",children:e(I,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[a&&e(N,{children:[e(ge,{disabled:f||y,onClick:()=>{Xn(r.info.id),location.reload()},children:[e(I,{icon:"transfer"})," ",e(m,{id:"3t/Nrv"})]}),!sr&&!f&&!y&&e(Ve,{href:`./?account=${r.info.id}`,target:"_blank",children:[e(I,{icon:"external"}),e("span",{children:e(m,{id:"PZgZtY"})})]}),e(Ye,{})]}),e(ge,{onClick:()=>{E.showAccount=`${r.info.username}@${r.instanceURL}`},children:[e(I,{icon:"user"}),e("span",{children:e(m,{id:"40z2Fm"})})]}),e(Ye,{}),a&&e(N,{children:[e(ge,{disabled:p||y,onClick:()=>{o.splice(h,1),o.unshift(r),jt(o),d()},children:[e(I,{icon:"check-circle"}),e("span",{children:e(m,{id:"PPcets"})})]}),e(ge,{disabled:h<=1,onClick:()=>{o.splice(h,1),o.splice(h-1,0,r),jt(o),d()},children:[e(I,{icon:"arrow-up"}),e("span",{children:e(m,{id:"QyioBP"})})]}),e(ge,{disabled:h===0||h===o.length-1,onClick:()=>{o.splice(h,1),o.splice(h+1,0,r),jt(o),d()},children:[e(I,{icon:"arrow-down"}),e("span",{children:e(m,{id:"3Ib6FN"})})]}),e(Ye,{})]}),e(vt,{subMenu:!0,confirmLabel:e(N,{children:[e(I,{icon:"exit"}),e("span",{children:e(m,{id:"k08LxG",values:{0:r.info.acct},components:{0:e("span",{class:"bidi-isolate"})}})})]}),disabled:!f||y,menuItemClassName:"danger",onClick:async()=>{await ir({instanceURL:r.instanceURL,client_id:r.clientId,client_secret:r.clientSecret,token:r.accessToken}),o.splice(h,1),jt(o);try{ke.session.get("currentAccount")===r.info.id&&ke.session.del("currentAccount")}catch{}location.href=location.pathname||"/"},children:[e(I,{icon:"exit"}),e("span",{children:e(m,{id:"CXk1bI"})})]}),!!r?.createdAt&&e("div",{class:"footer",children:[e(I,{icon:"account-add"}),e("span",{children:e(m,{id:"+9E7iR",values:{0:rt(r.createdAt)},components:{0:e(Tt,{datetime:r.createdAt})}})})]})]})]})]},r.info.id)})}),e("p",{children:e(ye,{to:"/login",class:"button plain2",onClick:n,children:[e(I,{icon:"plus"})," ",e("span",{children:e(m,{id:"Is7/PB"})})]})}),a&&e("p",{children:e("small",{children:e(m,{id:"52x24e",components:{0:e("i",{})}})})}),e("p",{children:e("button",{type:"button",class:"light",onClick:()=>E.showImportExportAccounts=!0,children:e(m,{id:"bgVLbt"})})})]})})]})}const cs="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='%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";class cr extends HTMLElement{connectedCallback(){if(this.button=this.querySelector("button"),window.matchMedia("(display-mode: standalone)").matches){this.button.remove();return}if(!navigator.install){this.button.remove();return}this.button.addEventListener("click",async i=>{await navigator.install()})}}customElements.define("button-install",cr);const ar={"zh-CN":"zh-Hans","zh-TW":"zh-Hant","pt-BR":"pt-BR"};function as(){const{i18n:n}=ne(),i=Ce(()=>Mc.map(s=>{const o=ar[s]||s.replace(/-[a-z]+$/i,""),c=zt({code:o,locale:s,fallback:bi.find(u=>u.code===s)?.nativeName}),a=zt({code:o,locale:n.locale,fallback:bi.find(u=>u.code===s)?.name});return{code:s,regionlessCode:o,_common:a,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||Dc,onChange:s=>{ke.local.set("lang",s.target.value),Pc(s.target.value)},children:[i.map(({code:s,regionlessCode:o,native:c})=>{const a=zt({code:o,locale:n.locale,fallback:bi.find(d=>d.code===s)?.name});return e("option",{value:s,"data-regionless-code":o,children:!!a&&a!==c?`${c} - ${a}`:c},s)}),void 0]})]})}function _s(n){const{masto:i}=oe();return i.v1.push.subscription.create(n)}function rr(){const{masto:n}=oe();return n.v1.push.subscription.fetch()}function lr(n){const{masto:i}=oe();return i.v1.push.subscription.update(n)}function dr(){const{masto:n}=oe();return n.v1.push.subscription.remove()}function gi(){return"serviceWorker"in navigator&&"PushManager"in window}function ur(){return navigator.serviceWorker.getRegistration()}async function rs(){const n=await ur(),i=n?await n.pushManager.getSubscription():void 0;return{registration:n,subscription:i}}function qo(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 a=0;a<o.length;++a)c[a]=o.charCodeAt(a);return c}async function hr(){if(!gi())return;const{subscription:n}=await rs();let i=null;try{i=await rr()}catch(s){if(!/(not found|unknown)/i.test(s.message))throw s}if(i&&n){const s=i.endpoint===n.endpoint,o=Qn(),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=Qn();if(s){const{applicationServerKey:o}=n.options,c=qo(s).toString(),a=new Uint8Array(o).toString();if(!(c===a))throw await n.unsubscribe(),new Error("Subscription key and vapid key changed")}}return{subscription:n,backendSubscription:i}}async function Is({data:n,policy:i}){if(!gi())return;let{registration:s,subscription:o}=await rs(),c=null;if(o)try{c=await lr({data:n,policy:i})}catch{c=await _s({subscription:o,data:n,policy:i})}else{const a=Qn();if(!a)throw new Error("No server key found");o=await s.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:qo(a)}),c=await _s({subscription:o,data:n,policy:i})}return{subscription:o,backendSubscription:c}}async function xs(){if(!gi())return;const{subscription:n}=await rs();n&&(await dr(),await n.unsubscribe())}const fr={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},Fn=16,ii=[14,15,16,17,18,19,20],Ln=ii[0],$n=ii[ii.length-1],{PHANPY_WEBSITE:As,PHANPY_PRIVACY_POLICY_URL:pr,PHANPY_TRANSLANG_INSTANCES:mr,PHANPY_IMG_ALT_API_URL:gr,PHANPY_GIPHY_API_KEY:yr,PHANPY_CLIENT_NAME:vr}=fr,Ts=Object.entries(aa.tl).map(([n,i])=>({code:n,name:i})),br="TransLang API";function wr({onClose:n}){const{_:i}=ne(),s=We(E),o=ke.local.get("theme")||"auto",c=K(),a=s.settings.contentTranslationTargetLanguage||null,u=Co(),d=zt(u),l=ke.local.get("textSize")||Fn,[r,h]=R(Ui()),{masto:f,authenticated:p,instance:y}=oe(),[g,w]=R(ke.local.get("experiments-tabBarV2")??!1),k=r["posting:default:visibility"]==="private";return e("div",{id:"settings-container",class:"sheet",tabIndex:"-1",style:{"--current-text-size":`${l}px`},children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(I,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(m,{id:"Tz0i8g"})})}),e("main",{children:[e("section",{children:e("ul",{children:[e("li",{children:[e("div",{children:e("label",{children:e(m,{id:"aAIQg2"})})}),e("div",{children:e("form",{ref:c,onInput:b=>{b.preventDefault();const _=new FormData(c.current).get("theme"),S=document.documentElement;if(_==="auto"){S.classList.remove("is-light","is-dark");const x=document.querySelector('meta[data-theme-setting="manual"]');x&&(x.name=""),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(A=>{A.name="theme-color"})}else{S.classList.toggle("is-light",_==="light"),S.classList.toggle("is-dark",_==="dark");const x=document.querySelector('meta[data-theme-setting="manual"]');x&&(x.name="theme-color",x.content=_==="light"?x.dataset.themeLightColor:x.dataset.themeDarkColor),document.querySelectorAll('meta[data-theme-setting="auto"]').forEach(A=>{A.name=""})}document.querySelector('meta[name="color-scheme"]').setAttribute("content",_==="auto"?"light dark":_),_==="auto"?ke.local.del("theme"):ke.local.set("theme",_)},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(m,{id:"1njn7W"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"dark",defaultChecked:o==="dark"}),e("span",{children:e(m,{id:"pvnfJD"})})]}),e("label",{children:[e("input",{type:"radio",name:"theme",value:"auto",defaultChecked:o!=="light"&&o!=="dark"}),e("span",{children:e(m,{id:"R9Khdg"})})]})]})})})]}),e("li",{children:[e("div",{children:e("label",{children:e(m,{id:"7r6sCa"})})}),e(kr,{currentTextSize:l})]}),e("li",{children:[e("span",{children:[e("label",{children:e(m,{id:"CeJHfb"})})," ",e("small",{children:e("a",{href:"https://crowdin.com/project/phanpy",target:"_blank",rel:"noopener",children:e(m,{id:"FFmj1D"})})})]}),e(as,{})]})]})}),p&&e(N,{children:[e("h3",{children:e(m,{id:"PcoS3v"})}),e("section",{children:e("ul",{children:[e("li",{children:[e("label",{for:"posting-privacy-field",children:[e(m,{id:"NAjVvt"})," ",e(I,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})]}),e("select",{id:"posting-privacy-field",value:r["posting:default:visibility"]||"public",onChange:b=>{const{value:v}=b.target;(async()=>{try{await f.v1.accounts.updateCredentials({source:{privacy:v}});const _={...r,"posting:default:visibility":v};v==="private"&&(_["posting:default:quote_policy"]="nobody"),h(_),gs(_),re(i({id:"4uflEE"}))}catch{alert(i({id:"hFs2qq"}))}})()},children:[e("option",{value:"public",children:e(m,{id:"7d1a0d"})}),e("option",{value:"unlisted",children:e(m,{id:"pPYeIN"})}),e("option",{value:"private",children:e(m,{id:"x5LEuB"})})]})]}),Wt()&&e("li",{children:[e("label",{for:"posting-quote-policy-field",children:[e(m,{id:"eKInue"})," ",e(I,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})]}),e("select",{id:"posting-quote-policy-field",value:k?"nobody":r["posting:default:quote_policy"]||"public",disabled:k,onChange:b=>{const{value:v}=b.target;(async()=>{try{await f.v1.accounts.updateCredentials({source:{quote_policy:v}});const _={...r,"posting:default:quote_policy":v};h(_),gs(_),re(i({id:"3P1r1z"}))}catch{alert(i({id:"hEe3YR"}))}})()},children:[e("option",{value:"public",disabled:k,children:e(m,{id:"hDWXuG"})}),e("option",{value:"followers",disabled:k,children:e(m,{id:"9Ko+Xp"})}),e("option",{value:"nobody",children:e(m,{id:"+bAQ3S"})})]})]})]})}),e("p",{class:"section-postnote",children:[e(I,{icon:"cloud",alt:i({id:"N2FcBE"}),class:"synced-icon"})," ",e("small",{children:e(m,{id:"cR6K65",values:{instance:y},components:{0:e("a",{href:`https://${y}/`,target:"_blank",rel:"noopener"})}})})]})]}),e("h3",{children:e(m,{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:b=>{E.settings.autoRefresh=b.target.checked}})," ",e(m,{id:"0mC0SF"})]})}),e("li",{class:"block",children:e("label",{children:[e("input",{type:"checkbox",checked:s.settings.boostsCarousel,onChange:b=>{E.settings.boostsCarousel=b.target.checked}})," ",e(m,{id:"TSbnoW"})]})}),!!mr&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.contentTranslation,onChange:b=>{const{checked:v}=b.target;E.settings.contentTranslation=v,v||(E.settings.contentTranslationTargetLanguage=null)}})," ",e(m,{id:"0SdaOt"})]}),e("div",{class:`sub-section ${s.settings.contentTranslation?"":"more-insignificant"}`,children:[e("div",{children:e("label",{children:[e(m,{id:"zXCa9e"})," ",e("select",{value:a||"",disabled:!s.settings.contentTranslation,style:{width:"10em"},onChange:b=>{E.settings.contentTranslationTargetLanguage=b.target.value||null},children:[e("option",{value:"",children:e(m,{id:"jNCSyx",values:{systemTargetLanguageText:d}})}),e("option",{disabled:!0,children:"──────────"}),Ts.map(b=>{const v=zt({code:b.code,fallback:b.name}),_=zt({code:b.code,locale:b.code}),S=_&&v!==_;return e("option",{value:b.code,children:S?`${_} - ${v}`:v})})]})]})}),e("hr",{}),e("div",{class:"checkbox-fieldset",children:[e(m,{id:"cc0NrU",values:{0:s.settings.contentTranslationHideLanguages.length}}),e("div",{class:"checkbox-fields",children:Ts.map(b=>{const v=zt({code:b.code,fallback:b.name}),_=zt({code:b.code,locale:b.code}),S=_&&v!==_;return e("label",{children:[e("input",{type:"checkbox",checked:s.settings.contentTranslationHideLanguages.includes(b.code),onChange:x=>{const{checked:C}=x.target;C?E.settings.contentTranslationHideLanguages.push(b.code):E.settings.contentTranslationHideLanguages=s.settings.contentTranslationHideLanguages.filter(A=>A!==b.code)}})," ",S?e("span",{children:[_," ",e("span",{class:"insignificant ib",children:["- ",v]})]}):v]})})})]}),e("p",{class:"insignificant",children:e("small",{children:e(m,{id:"7I3sDQ",values:{TRANSLATION_API_NAME:br},components:{0:e("a",{href:"https://github.com/cheeaun/translang-api",target:"_blank",rel:"noopener"})}})})}),e("hr",{}),e("div",{children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.contentTranslationAutoInline,disabled:!s.settings.contentTranslation,onChange:b=>{E.settings.contentTranslationAutoInline=b.target.checked}})," ",e(m,{id:"gURvmk"})]}),e("p",{class:"insignificant",children:e("small",{children:e(m,{id:"PbHARL",components:{0:e("b",{})}})})})]})]})]}),!!yr&&p&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.composerGIFPicker,onChange:b=>{E.settings.composerGIFPicker=b.target.checked}})," ",e(m,{id:"D7/2jB"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(m,{id:"/CLBTL",components:{0:e("a",{href:"https://developers.giphy.com/",target:"_blank",rel:"noopener"})}})})})]}),!!gr&&p&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.mediaAltGenerator,onChange:b=>{E.settings.mediaAltGenerator=b.target.checked}})," ",e(m,{id:"9q5uor"})," ",e(I,{icon:"sparkles2",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(m,{id:"faZ9RI"})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(m,{id:"fHZgvt",components:{0:e("a",{href:"https://github.com/cheeaun/img-alt-api",target:"_blank",rel:"noopener"})}})})})]}),p&&e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.shortcutSettingsCloudImportExport,onChange:b=>{E.settings.shortcutSettingsCloudImportExport=b.target.checked}})," ",e(m,{id:"570qTm"})," ",e(I,{icon:"cloud",class:"more-insignificant"})]}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(m,{id:"0tZAhT",components:{0:e("br",{})}})})}),e("div",{class:"sub-section insignificant",children:e("small",{children:e(m,{id:"Iq3FHt"})})})]}),e("li",{class:"block",children:[e("label",{children:[e("input",{type:"checkbox",checked:s.settings.cloakMode,onChange:b=>{E.settings.cloakMode=b.target.checked}})," ",e(m,{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(m,{id:"T/hglb"})})})]}),p&&e("li",{children:e("button",{type:"button",class:"light",onClick:()=>{E.showDrafts=!0,E.showSettings=!1},children:e(m,{id:"krk5ws"})})}),e("li",{children:e(ye,{to:"/yip",onClick:n,class:"button light",children:"Year in Posts"})}),e("li",{children:e("button-install",{children:e("button",{type:"button",class:"light",children:e(m,{id:"vOsY+K",values:{CLIENT_NAME:vr}})})})})]})}),p&&e(Sr,{onClose:n}),e("h3",{children:e(m,{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:cs,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",onClick:b=>{b.preventDefault(),E.showAccount="phanpy@hachyderm.io"},children:"@phanpy"}),e("br",{}),e(m,{id:"AZ2EoP",components:{0:e("a",{href:"https://github.com/cheeaun/phanpy",target:"_blank",rel:"noopener"}),1:e("a",{href:"https://mastodon.social/@cheeaun",rel:"noopener",onClick:b=>{b.preventDefault(),E.showAccount="cheeaun@mastodon.social"}})}})]})]}),e("p",{children:[e("a",{href:"https://github.com/sponsors/cheeaun",target:"_blank",rel:"noopener",children:e(m,{id:"O4cLCR"})})," ","·"," ",e("a",{href:"https://www.buymeacoffee.com/cheeaun",target:"_blank",rel:"noopener",children:e(m,{id:"Ng063n"})})," ","·"," ",e("a",{href:"https://patreon.com/cheeaun",target:"_blank",rel:"noopener",children:"Patreon"})," ","·"," ",e("a",{href:"https://github.com/cheeaun/phanpy/blob/main/CHANGELOG.md",target:"_blank",rel:"noopener",children:e(m,{id:"3ePd3I"})})," ","·"," ",e("a",{href:pr,target:"_blank",rel:"noopener",children:e(m,{id:"LcET2C"})})]}),e("p",{children:[As&&e(N,{children:[e(m,{id:"pFnMHn",values:{0:As.replace(/https?:\/\//g,"").replace(/\/$/,"")},components:{0:e("span",{class:"insignificant"})}}),e("br",{})]}),e(m,{id:"6KkH+2",values:{0:e("span",{class:"ib insignificant",children:["(",e("a",{href:"https://github.com/cheeaun/phanpy/commit/8b98d5a",target:"_blank",rel:"noopener",children:e(Tt,{datetime:new Date("2026-01-31T12:54:18.004Z")})}),")"]})},components:{0:e("span",{class:"insignificant"}),1:e("input",{type:"text",class:"version-string",readOnly:!0,size:"18",value:`${"2026-01-31T12:53:41.000Z".slice(0,10).replace(/-/g,".")}.8b98d5a`,onClick:b=>{b.target.select();try{navigator.clipboard.writeText(b.target.value),re(i({id:"PiPfua"}))}catch{re(i({id:"gdxreD"}))}}})}})]})]}),void 0]})]})}function kr({currentTextSize:n}){const i=K(null),[s,o]=R(n),[c]=ra(s,1e3);return G(()=>{document.documentElement.style.setProperty("--text-size",`${c}px`),c===Fn?ke.local.del("textSize"):ke.local.set("textSize",c)},[c]),e("div",{class:`text-size-control ${s!==c?"loading":""}`,children:[e("button",{type:"button",style:{fontSize:Ln},class:`small light ${s===Fn?"default-size":""}`,disabled:s===Ln,onClick:()=>{o(Math.max(Ln,s-1))},children:e(m,{id:"J6ypuD"})})," ",e("input",{ref:i,type:"range",min:Ln,max:$n,step:"1",value:s,list:"sizes",onChange:a=>{const u=parseInt(a.target.value,10);o(u)}})," ",e("button",{type:"button",style:{fontSize:$n},class:`small light ${s===Fn?"default-size":""}`,disabled:s===$n,onClick:()=>{o(Math.min($n,s+1))},children:e(m,{id:"J6ypuD"})}),e("datalist",{id:"sizes",children:ii.map(a=>e("option",{value:a}))})]})}function Sr({onClose:n}){const{_:i}=ne();if(!gi())return null;const{instance:s}=oe(),[o,c]=R("default"),a=K(),[u,d]=R(!1),[l,r]=R(!1),h=K();G(()=>{(async()=>{c("loading");try{const{subscription:p,backendSubscription:y}=await hr();if(y?.policy&&y.policy!=="none"){d(!0);const{alerts:g,policy:w}=y;h.current=w;const{elements:k}=a.current,b=k.namedItem("policy");b&&(b.value=w),Object.entries(g).forEach(([v,_])=>{const S=k.namedItem(v);S?.type==="checkbox"&&(S.checked=!!_)})}c("default")}catch(p){/outside.*authorized/i.test(p.message)?r(!0):alert(p?.message||p),c("error")}})()},[]);const f=o==="loading";return e("form",{ref:a,onChange:()=>{setTimeout(()=>{const p=Object.fromEntries(new FormData(a.current)),y=!!p["policy-allow"],g={data:{policy:p.policy,alerts:{mention:!!p.mention,favourite:!!p.favourite,reblog:!!p.reblog,follow:!!p.follow,follow_request:!!p.followRequest,poll:!!p.poll,update:!!p.update,status:!!p.status}}};let w=0;Object.keys(g.data.alerts).forEach(b=>{g.data.alerts[b]?w++:delete g.data.alerts[b]});const k=h.current!==g.data.policy;y&&w>0?k?xs().then(()=>{Is(g)}).catch(b=>{alert(i({id:"I6pdY3"}))}):Is(g).catch(b=>{alert(i({id:"I6pdY3"}))}):xs().catch(b=>{alert(i({id:"q1zFd+"}))})},100)},children:[e("h3",{children:e(m,{id:"WUHLnz"})}),e("section",{children:e("ul",{children:e("li",{children:[e("label",{children:[e("input",{type:"checkbox",disabled:f||l,name:"policy-allow",checked:u,onChange:async p=>{const{checked:y}=p.target;if(y){const g=await Notification.requestPermission();g==="granted"?d(!0):(d(!1),g==="denied"&&alert(i({id:"6LUsk7"})))}else d(!1)}})," ",e(m,{id:"qYNCa1",values:{0:[{value:"all",label:i({id:"+niKJH"})},{value:"followed",label:i({id:"x2NYtp"})},{value:"follower",label:i({id:"PBFNgg"})}].map(p=>e("option",{value:p.value,children:p.label}))},components:{0:e("select",{name:"policy",disabled:f||l||!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(p=>e("li",{children:e("label",{children:[e("input",{type:"checkbox",name:p.value})," ",p.label]})}))})})})}),l&&e("div",{class:"sub-section",children:e("p",{children:e(m,{id:"8d0b8B",components:{0:e(ye,{to:`/login?instance=${s}`,onClick:n}),1:e("b",{})}})})})]})})}),e("p",{class:"section-postnote",children:e("small",{children:e(m,{id:"z96cOX",components:{0:e("b",{})}})})})]})}const Mi=()=>{let n=setTimeout(()=>{const i=document.getElementById("columns");if(i){const s=i.querySelector(".deck-container.focus");if(s)s.focus();else{const o=Array.from(i.querySelectorAll(".deck-container")).find(c=>c.getBoundingClientRect().left>=0);o?o.focus():i.querySelector(".deck-container")?.focus?.()}}else{const s=document.querySelectorAll("#modal-container > *");if(s?.length){const u=s[s.length-1],d=u.querySelector('[tabindex="-1"]')||u;if(d){d.focus();return}}if(document.querySelector(".deck-backdrop"))return;const c=document.querySelectorAll(".deck-container"),a=c[c.length-1];a&&a.tabIndex===-1&&a.focus()}},100);return()=>clearTimeout(n)};function Fo(n){if(!n)return;const i=Qt(),s=K(i.pathname);G(()=>{s.current&&i.pathname!==s.current&&n?.()},[i.pathname,n])}function Cr({acct:n,instance:i}){let[s,o]=n.split("@");o||(o=i);const c=li.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(m,{id:"silO9A"})]})," ",e("span",{class:"ib",children:[e("span",{class:"handle-legend-icon server"})," ",e(m,{id:"rZgCpJ"})]})]})]})}const _r=["image/jpeg","image/png","image/gif","image/webp"],Es=_r.join(",");function Ir({name:n,value:i,disabled:s,index:o}){const[c,a]=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",enterKeyHint:"done"})}),e("td",{children:e("input",{type:"text",name:`fields_attributes[${o}][value]`,defaultValue:i,disabled:s,maxLength:255,onChange:u=>a(!!u.currentTarget.value),dir:"auto",enterKeyHint:"done"})})]})}function xr({onClose:n=()=>{}}){const{_:i}=ne(),{masto:s}=oe(),[o,c]=R("loading"),[a,u]=R(null),[d,l]=R(null),[r,h]=R(null);G(()=>{(async()=>{try{const S=await s.v1.accounts.verifyCredentials();u(S),c("default")}catch{c("error")}})()},[]);const{displayName:f,source:p,avatar:y,header:g}=a||{},{note:w,fields:k}=p||{},b=K(null),v=[...y?[{type:"image",url:y}]:[],...r?[{type:"image",url:r}]:[]],_=[...g?[{type:"image",url:g}]:[],...d?[{type:"image",url:d}]:[]];return e("div",{class:"sheet",id:"edit-profile-container",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(I,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(m,{id:"9OpVZg"})})}),e("main",{children:o==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("form",{onSubmit:S=>{S.preventDefault();const x=new FormData(S.target),C=x.get("header"),A=x.get("avatar"),L=x.get("display_name"),P=x.get("note"),q=b.current.querySelectorAll('input[name^="fields_attributes"]'),z=[];q.forEach(H=>{const ee=H.name,[te,Z,X]=ee.match(/fields_attributes\[(\d+)\]\[(.+)\]/)||[],j=H.value?H.value.trim():"";Z&&X&&j&&(z[Z]||(z[Z]={}),z[Z][X]=j)}),z.forEach(H=>{H.name&&!H.value&&(H.value="")}),(async()=>{try{const H=await s.v1.accounts.updateCredentials({header:C,avatar:A,displayName:L,note:P,fieldsAttributes:z});n?.({state:"success",account:H})}catch(H){alert(H?.message||i({id:"FwMMx0"}))}})()},children:[e("div",{class:"edit-profile-media-container",children:[e("label",{children:[e(m,{id:"C5zXYJ"})," ",e("input",{type:"file",name:"header",accept:Es,onChange:S=>{const x=S.target.files[0];if(x){const C=URL.createObjectURL(x);l(C)}}})]}),e("div",{class:"edit-profile-media-field",children:[g?e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{E.showMediaModal={mediaAttachments:_,mediaIndex:0}},children:e("img",{src:g,alt:""})}):e("div",{class:"edit-media"}),d&&e(N,{children:[e(I,{icon:"arrow-right"}),e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{E.showMediaModal={mediaAttachments:_,mediaIndex:1}},children:e("img",{src:d,alt:""})})]})]})]}),e("div",{class:"edit-profile-media-container",children:[e("label",{children:[e(m,{id:"4XF0BB"})," ",e("input",{type:"file",name:"avatar",accept:Es,onChange:S=>{const x=S.target.files[0];if(x){const C=URL.createObjectURL(x);h(C)}}})]}),e("div",{class:"edit-profile-media-field",children:[y?e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{E.showMediaModal={mediaAttachments:v,mediaIndex:0}},children:e("img",{src:y,alt:""})}):e("div",{class:"edit-media"}),r&&e(N,{children:[e(I,{icon:"arrow-right"}),e("div",{class:"edit-media",tabIndex:"0",onClick:()=>{E.showMediaModal={mediaAttachments:v,mediaIndex:1}},children:e("img",{src:r,alt:""})})]})]})]}),e("p",{children:e("label",{children:[e(m,{id:"6YtxFj"})," ",e("input",{type:"text",name:"display_name",defaultValue:f,maxLength:30,disabled:o==="loading",dir:"auto",enterKeyHint:"done"})]})}),e("p",{children:e("label",{children:[e(m,{id:"E+oKCO"}),e("textarea",{defaultValue:w,name:"note",maxLength:500,rows:"5",disabled:o==="loading",dir:"auto"})]})}),e("p",{children:e(m,{id:"T4I119"})}),e("table",{ref:b,children:[e("thead",{children:e("tr",{children:[e("th",{children:e(m,{id:"87a/t/"})}),e("th",{children:e(m,{id:"4b3oEV"})})]})}),e("tbody",{children:Array.from({length:Math.max(4,k.length)}).map((S,x)=>{const{name:C="",value:A=""}=k[x]||{};return e(Ir,{name:C,value:A,index:x,disabled:o==="loading"},x)})})]}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:o==="loading",onClick:()=>{n?.()},children:e(m,{id:"dEgA5A"})}),e("button",{type:"submit",disabled:o==="loading",children:e(m,{id:"tfDRzk"})})]})]})})]})}const Ar=80;function Tr({accountID:n,info:i,open:s=!1,onlyOpenIfHasEndorsements:o=!1}){const{masto:c}=oe(),a=K(),[u,d]=R("default"),[l,r]=R([]),[h,f]=R({});return G(()=>{Qe("@mastodon/endorsements")&&s&&(async()=>{d("loading");try{const y=await c.v1.accounts.$select(n).endorsements.list({limit:Ar});if(!y.length){d("default");return}r(y),d("default"),setTimeout(()=>{a.current.scrollIntoView({behavior:"smooth",block:"nearest"})},300);const g=await hi(y,h);g&&f(g)}catch{d("error")}})()},[s,n]),(o?s&&l.length>0:s)?e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e("div",{class:"endorsements-container",ref:a,children:[e("h3",{children:e(m,{id:"UIfdY1",values:{0:i.username}})}),u==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):l.length>0?e("ul",{class:`endorsements ${l.length>10?"expanded":""}`,children:l.map(y=>e("li",{children:e(gt,{account:y,showStats:!0,avatarSize:"xxl",relationship:h[y.id]},y.id)}))}):e("p",{class:"ui-state insignificant",children:e(m,{id:"AgkUZa"})})]})})}):null}async function Er(n){const{masto:i}=oe({instance:n});return!!(await i.v2.search.list({q:"from:me",type:"statuses",limit:1}))?.statuses?.length}const Uo=Ct(Er),Ko=1e3*60,Rr=1440*60*1e3,Pi=Ct(async()=>{const{masto:n}=oe(),i=await n.v1.lists.list();return i.sort((s,o)=>s.title.localeCompare(o.title)),i.length&&setTimeout(()=>{ke.account.set("lists",{lists:i,updatedAt:Date.now()})},1),i},{expires:Ko});async function An(){try{const{lists:n,updatedAt:i}=ke.account.get("lists")||{};return n?.length?(Date.now()-i>Rr&&Pi(),n):await Pi()}catch{return[]}}const Lr=Ct(n=>{const{masto:i}=oe();return i.v1.lists.$select(n).fetch()},{expires:Ko});async function Ho(n){const{lists:i}=ke.account.get("lists")||{};if(i?.length){const s=i.find(o=>o.id===n);if(s)return s}try{return Lr(n)}catch{return null}}async function $r(n){return(await Ho(n))?.title||""}function Mr(n){const{lists:i}=ke.account.get("lists")||{};i?.length&&(i.push(n),i.sort((s,o)=>s.title.localeCompare(o.title)),ke.account.set("lists",{lists:i,updatedAt:Date.now()}))}function Pr(n){const{lists:i}=ke.account.get("lists")||{};if(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)),ke.account.set("lists",{lists:i,updatedAt:Date.now()}))}}function Dr(n){const{lists:i}=ke.account.get("lists")||{};if(i?.length){const s=i.findIndex(o=>o.id===n);s!==-1&&(i.splice(s,1),ke.account.set("lists",{lists:i,updatedAt:Date.now()}))}}function Xt({insignificant:n}){const{_:i}=ne();return e(I,{icon:"filter",size:"xs",class:`list-exclusive-badge ${n?"insignificant":""}`,title:i({id:"FNptcJ"})})}function ls({list:n,onClose:i}){const{_:s}=ne(),{masto:o}=oe(),[c,a]=R("default"),u=!!n,d=K(),l=K(),r=K();G(()=>{u&&(d.current.value=n.title,l.current.value=n.repliesPolicy,r.current&&(r.current.checked=n.exclusive))},[u]);const h=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(I,{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:f=>{f.preventDefault();const p=new FormData(f.target),y=p.get("title"),g=p.get("replies_policy"),w=p.get("exclusive")==="on";a("loading"),(async()=>{try{let k;u?k=await o.v1.lists.$select(n.id).update({title:y,replies_policy:g,exclusive:w}):k=await o.v1.lists.create({title:y,replies_policy:g,exclusive:w}),a("default"),i?.({state:"success",list:k}),setTimeout(()=>{u?Pr(k):Mr(k)},1)}catch{a("error"),alert(s(u?{id:"R7ep1i"}:{id:"KPoj8w"}))}})()},children:[e("div",{class:"list-form-row",children:e("label",{for:"list-title",children:[e(m,{id:"6YtxFj"})," ",e("input",{ref:d,type:"text",id:"list-title",name:"title",required:!0,disabled:c==="loading",dir:"auto"})]})}),e("div",{class:"list-form-row",children:e("select",{ref:l,name:"replies_policy",required:!0,disabled:c==="loading",children:[e("option",{value:"list",children:e(m,{id:"ei6pnR"})}),e("option",{value:"followed",children:e(m,{id:"Mr53YX"})}),e("option",{value:"none",children:e(m,{id:"PM7llw"})})]})}),h&&e("div",{class:"list-form-row",children:e("label",{class:"label-block",children:[e("input",{ref:r,type:"checkbox",name:"exclusive",disabled:c==="loading"})," ",e(Xt,{insignificant:!0})," ",e(m,{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(vt,{disabled:c==="loading",align:"end",menuItemClassName:"danger",confirmLabel:s({id:"+kQ/cY"}),onClick:()=>{a("loading"),(async()=>{try{await o.v1.lists.$select(n.id).remove(),a("default"),i?.({state:"deleted"}),setTimeout(()=>{Dr(n.id)},1)}catch{a("error"),alert(s({id:"tqUaGL"}))}})()},children:e("button",{type:"button",class:"light danger",disabled:c==="loading",children:e(m,{id:"Jb6/SB"})})})]})]})})]})}function Nr({accountID:n,onClose:i}){const{_:s}=ne(),{masto:o}=oe(),[c,a]=R("default"),[u,d]=R([]),[l,r]=R([]),[h,f]=Mt(g=>g+1,0);G(()=>{a("loading"),(async()=>{try{const g=await An();d(g);const w=await o.v1.accounts.$select(n).lists.list();r(w),a("default")}catch{a("error")}})()},[h]);const[p,y]=R(!1);return e("div",{class:"sheet",id:"list-add-remove-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(I,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(m,{id:"sJ2yQc"})})}),e("main",{children:[u.length>0?e("ul",{class:"list-add-remove",children:u.map(g=>{const w=l.some(k=>k.id===g.id);return e("li",{children:e("button",{type:"button",class:`light ${w?"checked":""}`,disabled:c==="loading",onClick:()=>{a("loading"),(async()=>{try{w?await o.v1.lists.$select(g.id).accounts.remove({accountIds:[n]}):await o.v1.lists.$select(g.id).accounts.create({accountIds:[n]}),f()}catch{a("error"),alert(s(w?{id:"7KnEYa"}:{id:"Tba8uO"}))}})()},children:[e(I,{icon:"check-circle",alt:"☑️"}),e("span",{children:g.title})]})})})}):c==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):c==="error"?e("p",{class:"ui-state",children:e(m,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(m,{id:"/MJ7gZ"})}),e("button",{type:"button",class:"plain2",onClick:()=>y(!0),disabled:c!=="default",children:[e(I,{icon:"plus",size:"l"})," ",e("span",{children:e(m,{id:"Sb2gYF"})})]})]}),p&&e(Fe,{onClick:g=>{g.target===g.currentTarget&&y(!1)},children:e(ls,{list:p?.list,onClose:g=>{g.state==="success"&&f(),y(!1)}})})]})}function Or({account:n,note:i,onRelationshipChange:s=()=>{},onClose:o=()=>{}}){const{_:c}=ne(),{masto:a}=oe(),[u,d]=R("default"),l=K(null);return G(()=>{let r;return l.current&&!i&&(r=setTimeout(()=>{l.current.focus?.()},100)),()=>{clearTimeout(r)}},[]),e("div",{class:"sheet",id:"private-note-container",children:[!!o&&e("button",{type:"button",class:"sheet-close",onClick:o,children:e(I,{icon:"x",alt:c({id:"yz7wBu"})})}),e("header",{children:[e("b",{children:e(m,{id:"1DBGsz"})})," ",e("small",{class:"insignificant",children:e(m,{id:"XHVHK2"})})]}),e("main",{children:e("form",{onSubmit:r=>{r.preventDefault();const f=new FormData(r.target).get("note");f?.trim()!==i?.trim()&&(d("loading"),(async()=>{try{const p=await a.v1.accounts.$select(n?.id).note.create({comment:f});d("default"),s(p),o()}catch(p){d("error"),alert(p?.message||c({id:"ot8LpF"}))}})())},children:[e("textarea",{ref:l,name:"note",disabled:u==="loading",dir:"auto",children:i}),e("footer",{children:[e("button",{type:"button",class:"light",disabled:u==="loading",onClick:()=>{o?.()},children:e(m,{id:"dEgA5A"})}),e("span",{children:[e(Be,{abrupt:!0,hidden:u!=="loading"}),e("button",{disabled:u==="loading",type:"submit",children:e(m,{id:"SrwrEj"})})]})]})]})})]})}function zr({note:n,fields:i,onClose:s}){const{_:o}=ne(),c=i?.map(({name:u,value:d})=>`${u}
${bs(d)}`).join(`
`)||"",a=bs(n)+(c?`
${c}`:"");return e("div",{class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(I,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(m,{id:"9groMz"})})}),e("main",{children:[e("p",{style:{whiteSpace:"pre-wrap"},children:a}),e(_o,{forceTranslate:!0,text:a})]})]})}const Br=[300,1800,3600,3600*6,3600*24,3600*24*3,3600*24*7,3600*24*30,0],tn={0:{id:"9ZP9cc"},300:at(5,"minute"),1800:at(30,"minute"),3600:at(1,"hour"),21600:at(6,"hour"),86400:at(1,"day"),259200:at(3,"day"),604800:at(1,"week"),2592e3:at(30,"day")};function qr({info:n,instance:i,standalone:s,authenticated:o,onRelationshipChange:c=()=>{},setShowEditProfile:a=()=>{},showEndorsements:u=!1,renderEndorsements:d=!1,setRenderEndorsements:l=()=>{}}){if(!n)return null;const{_:r,_:h}=ne(),{masto:f,instance:p,authenticated:y}=oe(),g=i===p,[w,k]=R("default"),[b,v]=R(null),{id:_,acct:S,url:x,username:C,locked:A,lastStatusAt:L,note:P,fields:q,moved:z}=n,H=K(_),{following:ee,showingReblogs:te,notifying:Z,followedBy:X,blocking:j,blockedBy:W,muting:$,mutingNotifications:J,requested:V,domainBlocking:ve,endorsed:we,note:U}=b||{},[Y,fe]=R(null),[be,Ie]=R(!1),ze=S.includes("@")?S:`${S}@${i}`,_e=Qe("@mastodon/endorsements");G(()=>{if(n){const M=kt();let me;(async()=>{if(g&&o)me=_;else if(!g&&y){const Pe=n.acct.includes("@");try{const D=await f.v2.search.list({q:Pe?n.acct:`${n.username}@${i}`,type:"accounts",limit:1,resolve:!0});D.accounts.length&&(me=D.accounts[0].id,fe(D.accounts[0]))}catch{}}if(!me)return;if(M===me){Ie(!0);return}H.current=me,k("loading");const Ne=f.v1.accounts.relationships.fetch({id:[me]});try{const Pe=await Ne;if(k("default"),Pe.length){const D=Pe[0];v(D),c({relationship:D,currentID:me})}}catch{k("error")}})()}},[n,o]),G(()=>{n&&be&&Nc(n)},[n,be]);const xe=w==="loading",[Ae,qe]=R(!1),[Ue,He]=R(!1),[Ge,ae]=R(!1),[$e,Se]=R([]),[ie,Oe]=R(!1);G(()=>{y&&(async()=>{const M=await Uo(p);Oe(M)})()},[p,y]);let{headerStatic:Te,avatarStatic:Re}=n;return(!Te||/missing\.png$/.test(Te))&&Re&&!/missing\.png$/.test(Re)&&(Te=Re),e(N,{children:[e("div",{class:"actions",children:[e("span",{children:[X?e("span",{class:"tag",children:e(m,{id:"p3UO/y"})}):L?e("small",{class:"insignificant",children:e(m,{id:"F3cM1G",values:{0:rt(L,{hideTime:!0})},components:{0:e("span",{class:"ib"})}})}):e("span",{}),$&&e("span",{class:"tag danger",children:e(m,{id:"+IJm1Z"})}),j&&e("span",{class:"tag danger",children:e(m,{id:"32TndD"})})]})," ",e("span",{class:"buttons",children:[!!U&&e("button",{type:"button",class:"private-note-tag",title:h({id:"1DBGsz"}),onClick:()=>{ae(!0)},dir:"auto",children:e("span",{children:U})}),y&&be&&e("button",{type:"button",class:"plain",onClick:()=>{E.showQrCodeModal={text:x,arena:Re,backgroundMask:Te,caption:S.includes("@")?S:`${S}@${i}`,onScannerClick:Di}},children:e(I,{icon:"qrcode",alt:h({id:"gCX4Z9"})})}),e(ft,{portal:{target:document.body},containerProps:{style:{zIndex:1001}},align:"center",position:"anchor",overflow:"auto",menuButton:e("button",{type:"button",class:"plain4",disabled:xe,children:e(I,{icon:"more2",size:"l",alt:h({id:"2FYpfJ"})})}),onMenuChange:M=>{ee&&M.open&&(async()=>{try{const me=await f.v1.accounts.$select(H.current).lists.list();Se(me)}catch{}})()},children:[y&&!be?e(N,{children:[e(ge,{onClick:()=>{ko({draftStatus:{status:`@${Y?.acct||S} `}})},children:[e(I,{icon:"at"}),e("span",{children:e(m,{id:"3LkfZu",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]}),ie&&e(ge,{onClick:()=>{E.showSearchCommand={query:`from:${S} `}},children:[e(I,{icon:"search"}),e("span",{children:e(m,{id:"LCX3ys",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]}),e(ge,{onClick:()=>{qe(!0)},children:[e(I,{icon:"translate"}),e("span",{children:e(m,{id:"R8mSiS"})})]}),Qe("@mastodon/profile-private-note")&&e(ge,{onClick:()=>{ae(!0)},children:[e(I,{icon:"note"}),e("span",{children:h(U?{id:"+kQy/G"}:{id:"GquPwe"})})]}),ee&&!!b&&e(N,{children:[e(ge,{onClick:()=>{k("loading"),(async()=>{try{const M=await f.v1.accounts.$select(H.current).follow({notify:!Z});M&&v(M),k("default"),re(M.notifying?h({id:"jL3N0G",values:{username:C}}):h({id:"0h4/9h",values:{username:C}}))}catch(M){alert(M),k("error")}})()},children:[e(I,{icon:"notification"}),e("span",{children:h(Z?{id:"osJmEN"}:{id:"I92Z+b"})})]}),e(ge,{onClick:()=>{k("loading"),(async()=>{try{const M=await f.v1.accounts.$select(H.current).follow({reblogs:!te});M&&v(M),k("default"),re(M.showingReblogs?h({id:"0X2KC8",values:{username:C}}):h({id:"cXWjH0",values:{username:C}}))}catch(M){alert(M),k("error")}})()},children:[e(I,{icon:"rocket"}),e("span",{children:h(te?{id:"GRUr8d"}:{id:"uREpT3"})})]})]}),_e&&ee&&e(ge,{onClick:()=>{k("loading"),(async()=>{try{if(we){const M=await f.v1.accounts.$select(Y?.id||_).unpin();v(M),k("default"),re(h({id:"pWFLFk",values:{username:C}}))}else{const M=await f.v1.accounts.$select(Y?.id||_).pin();v(M),k("default"),re(h({id:"xhiXaF",values:{username:C}}))}}catch{k("error"),we?re(h({id:"xHq5L2",values:{username:C}})):re(h({id:"Owr/5+",values:{username:C}}))}})()},children:[e(I,{icon:"endorsement"}),h(we?{id:"S9JvjK"}:{id:"UlJ3QN"})]}),u&&_e&&!d&&e(ge,{onClick:()=>l(!0),children:[e(I,{icon:"endorsement"}),e("span",{children:e(m,{id:"Qopbnd"})})]}),ee&&e(ge,{onClick:()=>{He(!0)},children:[e(I,{icon:"list"}),$e.length?e(N,{children:[e("small",{class:"menu-grow",children:[e(m,{id:"sJ2yQc"}),e("br",{}),e("span",{class:"more-insignificant",children:$e.map(M=>M.title).join(", ")})]}),e("small",{class:"more-insignificant",children:$e.length})]}):e("span",{children:e(m,{id:"sJ2yQc"})})]}),e(Ye,{})]}):e(N,{children:[ie&&be&&e(ge,{onClick:()=>{E.showSearchCommand={query:"from:me "}},children:[e(I,{icon:"search"}),e("span",{children:e(m,{id:"BmW9JG"})})]}),_e&&!d&&e(N,{children:e(ge,{onClick:()=>l(!0),children:[e(I,{icon:"endorsement"}),e(m,{id:"Qopbnd"})]})}),(ie&&be||_e&&!d)&&e(Ye,{})]}),e(ge,{onClick:()=>{const M=`@${Y?.acct||ze}`;try{navigator.clipboard.writeText(M),re(h({id:"zJoEwS"}))}catch{re(h({id:"BC0lSD"}))}},children:[e(I,{icon:"copy"}),e("small",{children:[e(m,{id:"27x6gl"}),e("br",{}),e("span",{class:"more-insignificant bidi-isolate",children:["@",Y?.acct||ze]})]})]}),e(ge,{href:x,target:"_blank",children:[e(I,{icon:"external"}),e("small",{class:"menu-double-lines",children:Fr(x)})]}),e("div",{class:"menu-horizontal",children:[e(ge,{onClick:()=>{try{navigator.clipboard.writeText(x),re(h({id:"edWbV6"}))}catch{re(h({id:"W1ewR0"}))}},children:[e(I,{icon:"link"}),e("span",{children:e(m,{id:"he3ygx"})})]}),navigator?.share&&navigator?.canShare?.({url:x})&&e(ge,{onClick:()=>{try{navigator.share({url:x})}catch{alert(h({id:"TtG3Uh"}))}},children:[e(I,{icon:"share"}),e("span",{children:e(m,{id:"LFKLqp"})})]})]}),e(ge,{onClick:()=>{E.showQrCodeModal={text:x,arena:Re,backgroundMask:Te,caption:S.includes("@")?S:`${S}@${i}`,onScannerClick:Di}},children:[e(I,{icon:"qrcode"}),e("span",{children:e(m,{id:"gCX4Z9"})})]}),!!b&&e(N,{children:[e(Ye,{}),$?e(ge,{onClick:()=>{k("loading"),(async()=>{try{const M=await f.v1.accounts.$select(Y?.id||_).unmute();v(M),k("default"),re(h({id:"B4Xkly",values:{username:C}})),E.reloadGenericAccounts.id="mute",E.reloadGenericAccounts.counter++}catch{k("error")}})()},children:[e(I,{icon:"unmute"}),e("span",{children:e(m,{id:"Q/HUhC",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(xn,{menuClassName:"menu-blur",openTrigger:"clickOnly",direction:"bottom",overflow:"auto",shift:16,label:e(N,{children:[e(I,{icon:"mute"}),e("span",{class:"menu-grow",children:e(m,{id:"xhPEH3",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})}),e("span",{style:{textOverflow:"clip"},children:[e(I,{icon:"time"}),e(I,{icon:"chevron-right"})]})]}),children:e("div",{class:"menu-wrap",children:Br.map(M=>e(ge,{onClick:()=>{k("loading"),(async()=>{try{const me=await f.v1.accounts.$select(Y?.id||_).mute({duration:M});v(me),k("default"),re(h({id:"/plB9m",values:{0:typeof tn[M]=="function"?tn[M]():r(tn[M]),username:C}})),E.reloadGenericAccounts.id="mute",E.reloadGenericAccounts.counter++}catch{k("error"),re(h({id:"vWGBjT",values:{username:C}}))}})()},children:typeof tn[M]=="function"?tn[M]():r(tn[M])}))})}),X&&e(vt,{subMenu:!0,menuItemClassName:"danger",confirmLabel:e(N,{children:[e(I,{icon:"user-x"}),e("span",{children:e(m,{id:"unyq2W",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]}),onClick:()=>{k("loading"),(async()=>{try{const M=await f.v1.accounts.$select(Y?.id||_).removeFromFollowers();v(M),k("default"),re(h({id:"AgkcM/",values:{username:C}})),E.reloadGenericAccounts.id="followers",E.reloadGenericAccounts.counter++}catch{k("error")}})()},children:[e(I,{icon:"user-x"}),e("span",{children:e(m,{id:"VCZ0OT"})})]}),e(vt,{subMenu:!0,confirm:!j,confirmLabel:e(N,{children:[e(I,{icon:"block"}),e("span",{children:e(m,{id:"aforS9",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{k("loading"),(async()=>{try{if(j){const M=await f.v1.accounts.$select(Y?.id||_).unblock();v(M),k("default"),re(h({id:"sI9N29",values:{username:C}}))}else{const M=await f.v1.accounts.$select(Y?.id||_).block();v(M),k("default"),re(h({id:"uYcYzu",values:{username:C}}))}E.reloadGenericAccounts.id="block",E.reloadGenericAccounts.counter++}catch{k("error"),j?re(h({id:"0tG4wG",values:{username:C}})):re(h({id:"pA+qEx",values:{username:C}}))}})()},children:j?e(N,{children:[e(I,{icon:"unblock"}),e("span",{children:e(m,{id:"/3LJfX",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]}):e(N,{children:[e(I,{icon:"block"}),e("span",{children:e(m,{id:"JRswkR",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]})}),e(ge,{className:"danger",onClick:()=>{E.showReportModal={account:Y||n}},children:[e(I,{icon:"flag"}),e("span",{children:e(m,{id:"qTJgpR",values:{username:C},components:{0:e("span",{class:"bidi-isolate"})}})})]})]}),y&&be&&s&&Qe("@mastodon/profile-edit")&&e(N,{children:[e(Ye,{}),e(ge,{onClick:()=>{a(!0)},children:[e(I,{icon:"pencil"}),e("span",{children:e(m,{id:"9OpVZg"})})]})]}),!1]}),!b&&w==="loading"&&e(Be,{abrupt:!0}),!!b&&!z&&e(vt,{confirm:ee||V,confirmLabel:e("span",{children:h(V?{id:"e7qQIH"}:{id:"eYsAQr",values:{0:n.acct||n.username}})}),menuItemClassName:"danger",align:"end",disabled:xe,onClick:()=>{k("loading"),(async()=>{try{let M;ee||V?M=await f.v1.accounts.$select(H.current).unfollow():M=await f.v1.accounts.$select(H.current).follow(),M&&(v(M),u&&_e&&!d&&M.following&&l("onlyOpenIfHasEndorsements")),k("default")}catch(M){alert(M),k("error")}})()},children:e("button",{type:"button",class:`${ee||V?"light swap":""}`,"data-swap-state":ee||V?"danger":"",disabled:xe,children:ee?e(N,{children:[e("span",{children:e(m,{id:"y6sq5j"})}),e("span",{children:e(m,{id:"HKrBPX"})})]}):V?e(N,{children:[e("span",{children:e(m,{id:"Yx0Ud8"})}),e("span",{children:e(m,{id:"yTVtKs"})})]}):A?e(N,{children:[e(I,{icon:"lock"})," ",e("span",{children:e(m,{id:"MKEPCY"})})]}):h({id:"MKEPCY"})})})]})]}),!!Ae&&e(Fe,{onClose:()=>{qe(!1)},children:e(zr,{note:P,fields:q,onClose:()=>qe(!1)})}),!!Ue&&e(Fe,{onClose:()=>{He(!1)},children:e(Nr,{accountID:H.current,onClose:()=>He(!1)})}),!!Ge&&e(Fe,{onClose:()=>{ae(!1)},children:e(Or,{account:n,note:U,onRelationshipChange:M=>{v(M)},onClose:()=>ae(!1)})})]})}function Fr(n){if(!n)return;const i=URL.parse(n);if(!i)return;const{host:s,pathname:o}=i,c=o.replace(/\/$/,"").replace(/^\//,"");return e(N,{children:[e("span",{class:"more-insignificant",children:[li.toUnicode(s),"/"]}),e("wbr",{}),e("span",{children:c})]})}const Rs=80,jo=1e3*60*10;function Ur(n,i){return i.v1.accounts.familiarFollowers.fetch({id:[n]})}const Kr=Ct(Ur,{expires:jo});async function Hr(n,i){const s=i.v1.accounts.$select(n).statuses.list({limit:20}).values().next(),{value:o}=await s,c={total:o.length,originals:0,replies:0,boosts:0,quotes:0};return o.forEach(a=>{a.reblog?c.boosts++:a.inReplyToId&&a.inReplyToAccountId!==a.account.id?c.replies++:Wt()&&(a.quote?.id||a.quote?.quotedStatus?.id)?c.quotes++:c.originals++}),o.length&&(c.daysSinceLastPost=Math.ceil((Date.now()-Date.parse(o[o.length-1].createdAt))/864e5)),c}const jr=Ct(Hr,{expires:jo}),Vr=n=>{try{return new URL(n),!0}catch{return!1}},Di=()=>{E.showQrScannerModal={checkValidity:Vr,actionableText:{id:"73lp8c"},onClose:({text:n}={})=>{n&&(Oc(),location.hash=`/${n}`)}}};function Vo({account:n,fetchAccount:i=()=>{},standalone:s,instance:o,authenticated:c,showEndorsements:a=!1}){const{i18n:u,_:d}=ne(),{masto:l,authenticated:r}=oe({instance:o}),{masto:h,instance:f}=oe(),[p,y]=R("default"),g=typeof n=="string",[w,k]=R(g?null:n),b=Ce(()=>o===f,[o,f]);G(()=>{if(!g){k(n);return}y("loading"),(async()=>{try{const O=await i();E.accounts[`${O.id}@${o}`]=O,k(O),y("default")}catch{k(null),y("error")}})()},[g,n,i]);const{acct:v,avatar:_,avatarStatic:S,bot:x,createdAt:C,displayName:A,emojis:L,fields:P,followersCount:q,followingCount:z,group:H,id:ee,lastStatusAt:te,locked:Z,note:X,statusesCount:j,url:W,username:$,memorial:J,moved:V,roles:ve,hideCollections:we}=w||{};let U=!1,{header:Y,headerStatic:fe}=w||{};(!Y||/missing\.png$/.test(Y))&&_&&!/missing\.png$/.test(_)&&(Y=_,U=!0,S&&!/missing\.png$/.test(S)&&(fe=S));const be=Ce(()=>ee===kt(),[ee]);G(()=>{const O=!!(w?.id&&w?.username&&w?.acct&&w?.avatar&&w?.avatarStatic&&w?.displayName&&w?.url);if(be&&o&&O){const le=on();let Ee=!1;le.forEach(pe=>{pe.info.id===w.id&&pe.instanceURL===o&&(pe.info=w,Ee=!0)}),Ee&&jt(le)}},[be,w,o]);const Ie=Ki(W),[ze,_e]=R([]),xe=K(),Ae=K([]);async function qe(O){(O||!xe.current)&&(xe.current=l.v1.accounts.$select(ee).followers.list({limit:Rs}).values());const le=await xe.current.next();if(be||!b)return le;const{value:Ee}=le;let pe=[];if(O){let Le=[];try{Le=await l.v1.accounts.familiarFollowers.fetch({id:[ee]})}catch{}Ae.current=Le?.[0]?.accounts||[],pe=[...Ae.current,...Ee.filter(F=>!Ae.current.some(de=>de.id===F.id))]}else Ee?.length&&(pe=Ee.filter(Le=>!Ae.current.some(F=>F.id===Le.id)));return{...le,value:pe}}const Ue=K();async function He(O){return(O||!Ue.current)&&(Ue.current=l.v1.accounts.$select(ee).following.list({limit:Rs}).values()),await Ue.current.next()}const Ge=s?"div":ye,ae=o?`/${o}/a/${ee}`:`/a/${ee}`,[$e,Se]=R([]),[ie,Oe]=R(),[Te,Re]=R("default"),M=!!ie?.total,me=async O=>{try{const le=await Kr(O,h);Se(le[0].accounts.slice(0,Yr))}catch{}},Ne=async()=>{if(ee){Re("loading");try{const O=await jr(ee,l);Oe(O),Re("default")}catch{Re("error")}}},Pe=st(({relationship:O,currentID:le})=>{O.following||(me(le),!s&&j>0&&Ne())},[s,ee,j]),D=st(O=>{O.id===ee&&(k(O),E.accounts[`${O.id}@${o}`]=O)},[ee,o]),se=g&&n&&/^https?:\/\//.test(n),[T,B]=R(!1),[Q,ce]=R(!1);return e(N,{children:[e("div",{tabIndex:"-1",class:`account-container ${p==="loading"?"skeleton":""}`,style:{"--header-color-1":ze[0],"--header-color-2":ze[1],"--header-color-3":ze[2],"--header-color-4":ze[3]},children:[p==="error"&&e("div",{class:"ui-state",children:[e("p",{children:e(m,{id:"44hICK"})}),g?e("p",{children:se?e("a",{href:n,target:"_blank",rel:"noopener",children:n}):e("code",{class:"insignificant",children:n})}):e("p",{children:e("a",{href:W,target:"_blank",rel:"noopener",children:[e(m,{id:"Aadw0+"})," ",e(I,{icon:"external"})]})})]}),p==="loading"?e(N,{children:[e("header",{children:e(gt,{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("div",{children:[e("span",{children:"██"})," ██████"]}),e("div",{children:[e("span",{children:"██"})," █████"]})]})]}),e("div",{class:"actions",children:[e("span",{}),e("span",{class:"buttons",children:e("button",{type:"button",class:"plain4",disabled:!0,children:e(I,{icon:"more2",size:"l"})})})]})]})]}):w&&e(N,{children:[!!V&&e("div",{class:"account-moved",children:[e("p",{children:e(m,{id:"C6cVP/",values:{displayName:A},components:{0:e("b",{})}})}),e(gt,{account:V,instance:o,onClick:O=>{O.stopPropagation(),E.showAccount=V}})]}),!!Y&&!/missing\.png$/.test(Y)&&e("img",{src:Y,alt:"",class:`header-banner ${U?"header-is-avatar":""}`,onError:O=>{O.target.crossOrigin?O.target.src!==fe?O.target.src=fe:(O.target.removeAttribute("crossorigin"),O.target.src=Y):O.target.src!==fe?O.target.src=fe:O.target.remove()},crossOrigin:"anonymous",onLoad:O=>{O.target.classList.add("loaded");try{const le=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),Ee=le.getContext("2d",{willReadFrequently:!0});le.width=O.target.width,le.height=O.target.height,Ee.imageSmoothingEnabled=!1,Ee.drawImage(O.target,0,0);const pe=10,F=[Ee.getImageData(0,0,pe,pe).data,Ee.getImageData(O.target.width-pe,0,pe,pe).data,Ee.getImageData(0,O.target.height-pe,pe,pe).data,Ee.getImageData(O.target.width-pe,O.target.height-pe,pe,pe).data].map(de=>{let De=0,Me=0,nt=0,tt=0;for(let Dt=0;Dt<de.length;Dt+=4)De+=de[Dt],Me+=de[Dt+1],nt+=de[Dt+2],tt+=de[Dt+3];const It=de.length/4;return[De/It,Me/It,nt/It,tt/It]}).map(de=>{const[De,Me,nt,tt]=Wr(de);return`rgba(${De}, ${Me}, ${nt}, ${tt})`});_e(F)}catch{}}}),e("header",{children:s?e(ft,{shift:window.matchMedia("(min-width: calc(40em))").matches?114:64,menuButton:e("div",{children:e(gt,{account:w,instance:o,avatarSize:"xxxl",onClick:()=>{}})}),children:[e("div",{class:"szh-menu__header",children:e(Cr,{acct:v,instance:o})}),e(ge,{onClick:()=>{const O=v.includes("@")?`@${v}`:`@${v}@${o}`;try{navigator.clipboard.writeText(O),re(d({id:"zJoEwS"}))}catch{re(d({id:"BC0lSD"}))}},children:[e(I,{icon:"link"}),e("span",{children:e(m,{id:"27x6gl"})})]}),e(ge,{onClick:()=>{E.showQrCodeModal={text:W,arena:S,backgroundMask:fe,caption:v.includes("@")?v:`${v}@${o}`,onScannerClick:Di}},children:[e(I,{icon:"qrcode"}),e("span",{children:e(m,{id:"gCX4Z9"})})]}),e(ge,{href:W,target:"_blank",children:[e(I,{icon:"external"}),e("span",{children:e(m,{id:"Bz5hLl"})})]}),e(Ye,{}),e(ge,{onClick:()=>{E.showMediaModal={mediaAttachments:[{type:"image",url:S}]}},children:[e(I,{icon:"user"}),e("span",{children:e(m,{id:"7WYl2I"})})]}),!!fe&&!U&&e(ge,{onClick:()=>{E.showMediaModal={mediaAttachments:[{type:"image",url:fe}]}},children:[e(I,{icon:"media"}),e("span",{children:e(m,{id:"ZNme5R"})})]}),r&&be&&Qe("@mastodon/profile-edit")&&e(N,{children:[e(Ye,{}),e(ge,{onClick:()=>{B(!0)},children:[e(I,{icon:"pencil"}),e("span",{children:e(m,{id:"9OpVZg"})})]})]})]}):e(gt,{account:w,instance:o,avatarSize:"xxxl",internal:!0})}),e("div",{class:"faux-header-bg","aria-hidden":"true"}),e("main",{children:[!!J&&e("span",{class:"tag",children:e(m,{id:"prdIOK"})}),!!x&&e("span",{class:"tag",children:[e(I,{icon:"bot"})," ",e(m,{id:"9Vdq+j"})]}),!!H&&e("span",{class:"tag",children:[e(I,{icon:"group"})," ",e(m,{id:"L8fEEm"})]}),e("div",{class:"note",dir:"auto",onClick:Io({instance:f}),dangerouslySetInnerHTML:{__html:Li(X,{emojis:L})}}),e("div",{class:"account-metadata-box",children:[P?.length>0&&e("div",{class:"profile-metadata",children:P.map(({name:O,value:le,verifiedAt:Ee},pe)=>e("div",{class:`profile-field ${Ee?"profile-verified":""}`,dir:"auto",children:[e("b",{children:[e(xo,{text:O,emojis:L})," ",!!Ee&&e(I,{icon:"check-circle",size:"s",alt:d({id:"QDEWii"})})]}),e("p",{dangerouslySetInnerHTML:{__html:Li(le,{emojis:L})}})]},O+pe))}),e("div",{class:"stats",children:[e(Ge,{tabIndex:0,to:ae,onClick:()=>{setTimeout(()=>{E.showGenericAccounts={id:"followers",heading:d({id:"x5LEuB"}),fetchAccounts:qe,instance:o,excludeRelationshipAttrs:be?["followedBy"]:[],blankCopy:we?d({id:"BRV/wh"}):void 0}},0)},children:[!!$e.length&&e("span",{class:"shazam-container-horizontal",children:e("span",{class:"shazam-container-inner stats-avatars-bunch",children:$e.map(O=>e(ut,{url:O.avatarStatic,size:"s",alt:`${O.displayName} @${O.acct}`,squircle:O?.bot}))})}),e(m,{id:"TbttfX",values:{0:Xe(q),1:Xe(q),followersCount:q},components:{0:e("span",{title:q}),1:e("span",{title:q})}})]}),e(Ge,{class:"insignificant",tabIndex:0,to:ae,onClick:()=>{setTimeout(()=>{E.showGenericAccounts={heading:d({id:"following.stats"}),fetchAccounts:He,instance:o,excludeRelationshipAttrs:be?["following"]:[],blankCopy:we?d({id:"BRV/wh"}):void 0}},0)},children:[e(m,{id:"SGcIK+",values:{0:Xe(z),followingCount:z},components:{0:e("span",{title:z})}}),e("br",{})]}),e(Ge,{class:"insignificant",to:ae,children:e(m,{id:"C4x3+X",values:{0:Xe(j),1:Xe(j),statusesCount:j},components:{0:e("span",{title:j}),1:e("span",{title:j})}})}),!!C&&e("div",{class:"insignificant",children:e(m,{id:"PCcEFZ",values:{0:rt(C,{hideTime:!0})},components:{0:e("time",{datetime:C})}})})]})]}),!!ie&&e(Ge,{to:ae,class:"account-metadata-box",onClick:void 0,children:e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:M?e("div",{class:"posting-stats",title:Wt()?d({id:"CKHUZ2",values:{0:(ie.originals/ie.total).toLocaleString(u.locale||void 0,{style:"percent"}),1:(ie.replies/ie.total).toLocaleString(u.locale||void 0,{style:"percent"}),2:(ie.quotes/ie.total).toLocaleString(u.locale||void 0,{style:"percent"}),3:(ie.boosts/ie.total).toLocaleString(u.locale||void 0,{style:"percent"})}}):d({id:"wiuWLe",values:{0:(ie.originals/ie.total).toLocaleString(u.locale||void 0,{style:"percent"}),1:(ie.replies/ie.total).toLocaleString(u.locale||void 0,{style:"percent"}),2:(ie.boosts/ie.total).toLocaleString(u.locale||void 0,{style:"percent"})}}),children:[e("div",{children:ie.daysSinceLastPost<365?he._({id:"oZUtTk",values:{0:ie.total,1:ie.daysSinceLastPost,2:ie.daysSinceLastPost,3:ie.daysSinceLastPost,4:ie.total,5:ie.total,6:ie.daysSinceLastPost}}):he._({id:"JvA7Mo",values:{0:ie.total,1:ie.total}})}),e("div",{class:"posting-stats-bar",children:[ie.originals>0&&e("div",{class:"posting-stats-bar-section posting-stats-bar-originals",style:{"--percentage":`${ie.originals/ie.total*100}%`}}),ie.replies>0&&e("div",{class:"posting-stats-bar-section posting-stats-bar-replies",style:{"--percentage":`${ie.replies/ie.total*100}%`}}),ie.quotes>0&&e("div",{class:"posting-stats-bar-section posting-stats-bar-quotes",style:{"--percentage":`${ie.quotes/ie.total*100}%`}}),ie.boosts>0&&e("div",{class:"posting-stats-bar-section posting-stats-bar-boosts",style:{"--percentage":`${ie.boosts/ie.total*100}%`}})]}),e("div",{class:"posting-stats-legends",children:[e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-bar-originals"})," ",e(m,{id:"HxF6Fk"})]})," ",e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-bar-replies"})," ",e(m,{id:"N8UzTV"})]})," ",Wt()&&e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-bar-quotes"})," ",e(m,{id:"eWLklq"})]}),e("span",{class:"ib",children:[e("span",{class:"posting-stats-legend-item posting-stats-bar-boosts"})," ",e(m,{id:"puY2t0"})]})]})]}):e("div",{class:"posting-stats",children:e(m,{id:"vl3XTJ"})})})})}),!V&&e("div",{class:"account-metadata-box",children:e("div",{class:"shazam-container no-animation",hidden:!!ie,children:e("div",{class:"shazam-container-inner",children:e("button",{type:"button",class:"posting-stats-button",disabled:Te==="loading",onClick:()=>{Ne()},children:[e("div",{class:`posting-stats-icon ${Te==="loading"?"loading":""}`}),e(m,{id:"PjP87f"})," "]})})})})]}),e("footer",{children:e(qr,{info:w,instance:o,standalone:s,authenticated:c,onRelationshipChange:Pe,onProfileUpdate:D,setShowEditProfile:B,showEndorsements:a,renderEndorsements:Q,setRenderEndorsements:ce})}),e(Tr,{accountID:ee,info:w,open:Q,onlyOpenIfHasEndorsements:Q==="onlyOpenIfHasEndorsements"})]})]}),!!T&&e(Fe,{onClose:()=>{B(!1)},children:e(xr,{onClose:({state:O,account:le}={})=>{B(!1),O==="success"&&le&&D(le)}})})]})}const Yr=3;function Wr([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 Gr({account:n,instance:i,onClose:s}){const{_:o}=ne(),{masto:c,instance:a,authenticated:u}=oe({instance:i}),d=typeof n=="string";return G(()=>{d||(E.accounts[`${n.id}@${a}`]=n)},[n]),Fo(s),e("div",{class:"sheet",children:[!!s&&e("button",{type:"button",class:"sheet-close outer",onClick:s,children:e(I,{icon:"x",alt:o({id:"yz7wBu"})})}),e(Vo,{instance:a,authenticated:u,account:n,fetchAccount:async()=>{if(d)try{return await c.v1.accounts.lookup({acct:n,skip_webfinger:!1})}catch{const r=await c.v2.search.list({q:n,type:"accounts",limit:u?1:11,resolve:u});if(r.accounts.length){const h=r.accounts.find(f=>f.url===n||n.startsWith(f.url));if(h)return h}if(/^https?:\/\/[^/]+\/@[^/]+$/.test(n)){const h=URL.parse(n);if(h){const{hostname:f,pathname:p}=h,y=p.replace(/^\//,"").replace(/\/$/,"")+"@"+f,g=await c.v2.search.list({q:y,type:"accounts",limit:1,resolve:u});if(g.accounts.length)return g.accounts[0]}}}else return n}})]})}function Zr({onClose:n}){const{_:i}=ne(),{masto:s}=oe(),[o,c]=R("default"),[a,u]=R([]),[d,l]=Mt(h=>h+1,0);G(()=>{c("loading"),(async()=>{try{const h=await wt.drafts.keys();if(h.length){const f=Jn(),p=h.filter(y=>y.startsWith(f));if(p.length){const y=await wt.drafts.getMany(p);y.sort((g,w)=>Date.parse(w.updatedAt)-Date.parse(g.updatedAt)),u(y)}else u([])}else u([]);c("default")}catch{c("error")}})()},[d]);const r=a?.length>0;return e("div",{class:"sheet",children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(I,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:[e("h2",{children:[e(m,{id:"krk5ws"})," ",e(Be,{abrupt:!0,hidden:o!=="loading"})]}),r&&e("div",{class:"insignificant",children:e(m,{id:"Ap/10+"})})]}),e("main",{children:r?e(N,{children:[e("ul",{class:"drafts-list",children:a.map(h=>{const{updatedAt:f,key:p,draftStatus:y,replyTo:g,quote:w}=h,k=new Date(f);return e("li",{children:[e("div",{class:"mini-draft-meta",children:[e("b",{children:[e(I,{icon:g?"reply":"quill",size:"s"})," ",e("time",{children:[!!g&&e(N,{children:[e("span",{class:"bidi-isolate",children:["@",g.account.acct]}),e("br",{})]}),rt(k)]})]}),e(vt,{confirmLabel:e("span",{children:e(m,{id:"/W5yFF"})}),menuItemClassName:"danger",align:"end",disabled:o==="loading",onClick:()=>{(async()=>{try{await wt.drafts.del(p),l()}catch{alert(i({id:"rEYoku"}))}})()},children:e("button",{type:"button",class:"small light",disabled:o==="loading",children:e(m,{id:"Jb6/SB"})})})]}),e("button",{type:"button",disabled:o==="loading",class:"draft-item",onClick:async()=>{let b,v;if(g?.id||w?.id){if(c("loading"),g)try{b=await s.v1.statuses.$select(g.id).fetch()}catch{alert(i({id:"tMwimH"})),c("default");return}if(w)try{v=await s.v1.statuses.$select(w.id).fetch()}catch{alert(i({id:"2oZ4Iw"})),c("default")}c("default")}window.__COMPOSE__={draftStatus:y,replyToStatus:b,quoteStatus:v},E.showCompose=!0,E.showDrafts=!1},children:e(Xr,{draft:h})})]},f)})}),a.length>1&&e("p",{children:e(vt,{confirmLabel:e("span",{children:e(m,{id:"3IakFR"})}),menuItemClassName:"danger",disabled:o==="loading",onClick:()=>{(async()=>{c("loading");try{await wt.drafts.delMany(a.map(h=>h.key)),c("default"),l()}catch{alert(i({id:"0J4sZq"})),c("error")}})()},children:e("button",{type:"button",class:"light danger",disabled:o==="loading",children:e(m,{id:"hOg+Mt"})})})})]}):e("p",{children:e(m,{id:"8iQ+jk"})})})]})}function Xr({draft:n}){const{_:i}=ne(),{draftStatus:s,replyTo:o,quote:c}=n,{status:a,spoilerText:u,poll:d,mediaAttachments:l}=s,r=d?.options?.length>0,h=l?.length>0,f=!!c?.id,p=r||h||f,y=Ce(()=>{if(!h)return;const g=l.find(b=>/image/.test(b.type));if(!g)return;const{file:w}=g;return URL.createObjectURL(w)},[h,l]);return e(N,{children:e("div",{class:"mini-draft",children:[p&&e("div",{class:`mini-draft-aside ${y?"has-image":""}`,style:y?{"--bg-image":`url(${y})`}:{},children:[r&&e(I,{icon:"poll",alt:i({id:"4WUbF1"})}),h&&e("span",{children:[e(I,{icon:"attachment",alt:i({id:"xYilR2"})})," ",e("small",{children:l?.length})]}),f&&e(I,{icon:"quote",alt:i({id:"ZhhOwV"})})]}),e("div",{class:"mini-draft-main",children:[!!u&&e("div",{class:"mini-draft-spoiler",children:u}),!!a&&e("div",{class:"mini-draft-status",children:a})]})]})})}function Qr({html:n,url:i,width:s,height:o,onClose:c=()=>{}}){const{_:a}=ne();return e("div",{class:"embed-modal-container",children:[e("div",{class:"top-controls",children:[e("button",{type:"button",class:"light",onClick:()=>c(),children:e(I,{icon:"x",alt:a({id:"yz7wBu"})})}),i&&e("a",{href:i,target:"_blank",rel:"noopener",class:"button plain",children:[e("span",{children:e(m,{id:"4/RpOy"})})," ",e(I,{icon:"external"})]})]}),e("div",{class:"embed-content",dangerouslySetInnerHTML:{__html:n},style:{"--width":s+"px","--height":o+"px","--aspect-ratio":`${s}/${o}`}})]})}function Jr({instance:n,excludeRelationshipAttrs:i=[],postID:s,onClose:o=()=>{},blankCopy:c}){const{_:a}=ne(),{masto:u,instance:d}=oe(),l=n?n===d:!0,r=We(E),[h,f]=R("default"),[p,y]=R(!1);if(Fo(o),!r.showGenericAccounts)return null;const{id:g,heading:w,fetchAccounts:k,accounts:b,showReactions:v}=r.showGenericAccounts,[_,S]=R(b?.length?b:[]),[x,C]=R({}),A=async z=>{if(!z?.length||!l)return;const H=await hi(z,x);H&&C({...x,...H})},L=z=>{k&&(z&&!_?.length&&S([]),f("loading"),(async()=>{try{const{done:H,value:ee}=await k(z);if(Array.isArray(ee)){if(z){const te=[];for(let Z=0;Z<ee.length;Z++){const X=ee[Z],j=te.find((W,$)=>W.id===X.id&&Z!==$);j?j._types.push(...X._types):te.push({_types:[],...X})}S(te)}else S(te=>{const Z=te;for(const X of ee){const j=Z.find(W=>W.id===X.id);j?j._types.push(...X._types):Z.push(X)}return Z});y(!H),A(ee)}else y(!1);f("default")}catch{f("error")}})())},P=K(!0);G(()=>{_?.length>0?k?(L(!0),P.current=!1):A(_):(L(!0),P.current=!1)},[k]),G(()=>{P.current||r.reloadGenericAccounts?.id===g&&L(!0)},[r.reloadGenericAccounts.counter]);const q=E.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(I,{icon:"x",alt:a({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:w||a({id:"bPwFdf"})})}),e("main",{children:[q&&e(ye,{to:`/${n||d}/s/${q.id}`,class:"post-preview",children:e(je,{status:q,size:"s",readOnly:!0})}),_.length>0?e(N,{children:[e("ul",{class:"accounts-list",children:_.map(z=>{const H=x[z.id],ee=`${z.id}-${z._types?.length||""}`;return e("li",{children:[v&&z._types?.length>0&&e("div",{class:"reactions-block",children:z._types.map(te=>e(I,{icon:{reblog:"rocket",favourite:"heart"}[te],class:`${te}-icon`}))}),e("div",{class:"account-relationships",children:e(gt,{account:z,showStats:!0,relationship:H,excludeRelationshipAttrs:i})})]},ee)})}),h==="default"?p?e($t,{onChange:z=>{z&&L()},children:e("button",{type:"button",class:"plain block",onClick:()=>L(),children:e(m,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(m,{id:"2EYeAZ"})}):h==="loading"&&e("p",{class:"ui-state",children:e(Be,{abrupt:!0})})]}):h==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):h==="error"?e("p",{class:"ui-state",children:e(m,{id:"AThL/k"})}):e("p",{class:"ui-state insignificant",children:c||a({id:"10OlfF"})})]})]})}function el({accounts:n,onClose:i}){const{_:s}=ne(),o=on(),{accountsToImport:c}=Ce(()=>{if(!n)return{accountsToImport:[]};const f={duplicate:0,new:1};return{accountsToImport:n.map(y=>{const w=o.find(k=>k.info.id===y.info.id&&k.instanceURL===y.instanceURL)?"duplicate":"new";return{...y,__status:w}}).sort((y,g)=>f[y.__status]-f[g.__status])}},[n,o]),[a,u]=R(()=>{const f={};return c.forEach(p=>{p.__status==="duplicate"?f[p.info.id+p.instanceURL]=!1:f[p.info.id+p.instanceURL]=!0}),f}),[d,l]=R("default"),r=()=>{l("importing");const f=[...o,...n.filter(p=>a[p.info.id+p.instanceURL])];jt(f),i(),E.showImportExportAccounts=!1,E.showAccounts=!0},h=Object.values(a).filter(Boolean).length;return e("div",{id:"import-accounts-selection-container",class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,disabled:d==="importing",children:e(I,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(m,{id:"jiFPsN"})})}),e("main",{children:e("div",{class:"import-selection",children:[c.filter(f=>f.__status!=="duplicate").length>3&&e("div",{class:"accounts-list-header",children:e("label",{class:"account-item",children:[e("input",{type:"checkbox",checked:c.filter(f=>f.__status!=="duplicate").length>0&&c.filter(f=>f.__status!=="duplicate").every(f=>a[f.info.id+f.instanceURL]),onChange:f=>{const p={...a},y=f.target.checked;c.forEach(g=>{g.__status!=="duplicate"&&(p[g.info.id+g.instanceURL]=y)}),u(p)},disabled:d==="importing"}),e("span",{class:"account-info",children:e(m,{id:"wgNoIs"})})]})}),e("ul",{class:"accounts-list",children:c.map(f=>{const p=f.info.id+f.instanceURL,y=a[p],{__status:g}=f;return e("li",{children:e("label",{class:"account-item",children:[e("input",{type:"checkbox",checked:y,onChange:w=>{u({...a,[p]:w.target.checked})},disabled:d==="importing"||g==="duplicate"}),e(ut,{url:f.info.avatarStatic,size:"xl"}),e("div",{class:"account-info",children:e(mt,{account:{...f.info,acct:/@/.test(f.info.acct)?f.info.acct:`${f.info.acct}@${f.instanceURL}`},showAcct:!0})}),e("div",{class:"account-meta",children:g==="duplicate"&&e("span",{class:"tag collapsed",children:e(m,{id:"5Lvp3B"})})})]})},p)})}),e("footer",{children:[e("button",{type:"button",class:"light",onClick:i,disabled:d==="importing",children:e(m,{id:"dEgA5A"})}),e(Be,{hidden:d!=="importing"}),e("button",{type:"button",disabled:h===0||d==="importing",onClick:r,children:e(m,{id:"0mebiX",values:{selectedCount:h}})})]})]})})]})}function tl({onClose:n}){const{_:i}=ne(),s=on(),[o,c]=R("default"),[a,u]=R(null),[d,l]=R(!1),r=async()=>{c("exporting");try{const b={accounts:on().map(L=>{const{accessToken:P,...q}=L;return q}),createdAt:Date.now()},v=JSON.stringify(b),_=new Blob([v],{type:"application/json"}),S=URL.createObjectURL(_),x=document.createElement("a");x.href=S;const C=new Date,A=`${C.getFullYear()}-${String(C.getMonth()+1).padStart(2,"0")}-${String(C.getDate()).padStart(2,"0")}_${String(C.getHours()).padStart(2,"0")}-${String(C.getMinutes()).padStart(2,"0")}`;x.download=`accounts-${A}.phanpy.json`,x.click(),URL.revokeObjectURL(S),n()}catch{re(i({id:"lpYill"})),c("error")}},h=async w=>{if(w){c("importing");try{const k=await w.text(),v=JSON.parse(k)?.accounts;if(!Array.isArray(v))throw new Error("Invalid backup file");u(v),c("default")}catch{re(i({id:"BEVzjL"})),c("error")}}},f=w=>{const k=w.target.files[0];h(k)};return e("div",{id:"import-export-accounts-container",class:"sheet",onDragOver:w=>{w.preventDefault(),l(!0)},onDragLeave:()=>{l(!1)},onDrop:w=>{w.preventDefault(),l(!1);const k=w.dataTransfer.files[0];h(k)},children:[!!n&&e("button",{type:"button",class:"sheet-close",onClick:n,children:e(I,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(m,{id:"k30qb8",components:{0:e("small",{class:"ib insignificant"})}})})}),e("main",{children:[e("section",{children:[e("label",{class:`section-button button-import button plain4 ${d?"drag-over":""}`,tabindex:"0",children:[e(I,{icon:"arrow-down-circle",size:"xxl"}),e("b",{children:e(m,{id:"l3s5ri"})}),e("input",{type:"file",accept:".json",onChange:f,disabled:o==="importing",style:{display:"none"}}),e("div",{children:e("small",{class:"insignificant",children:e(m,{id:"SdA74G"})})})]})," ",e("button",{type:"button",class:"section-button button-export plain4",onClick:r,disabled:o==="exporting"||s.length===0,children:[e(I,{icon:"arrow-up-circle",size:"xxl"}),e("b",{children:e(m,{id:"GS+Mus"})}),e("div",{children:e("small",{class:"insignificant",children:e(m,{id:"A7kMZX",values:{0:s.length}})})})]})]}),e("p",{class:"insignificant",children:e("small",{children:e(m,{id:"R+Pgtr"})})})]}),a&&e(Fe,{onClose:()=>{u(null)},children:e(el,{accounts:a,onClose:()=>{u(null)}})})]})}const nl=140;function il({alt:n,lang:i,onClose:s}){const{_:o}=ne(),c=We(E),[a,u]=R(!1),d=Co(!0),l=c.settings.contentTranslationHideLanguages||[],r=!!i&&i!==d&&!ei([i],[d])&&!l.find(h=>i===h||ei([i],[h]));return G(()=>{const h=n?.length>0&&n?.length<=nl;r&&h&&u(!0)},[r,n]),e("div",{class:"sheet",tabindex:"-1",children:[!!s&&e("button",{type:"button",class:"sheet-close outer",onClick:s,children:e(I,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:[e("h2",{children:e(m,{id:"5gfDMm"})}),e("div",{class:"header-side",children:e(ft,{align:"end",menuButton:e("button",{type:"button",class:"plain4",children:e(I,{icon:"more",alt:o({id:"2FYpfJ"}),size:"xl"})}),children:[e(ge,{disabled:a,onClick:()=>{u(!0)},children:[e(I,{icon:"translate"}),e("span",{children:e(m,{id:"pi8x/S"})})]}),la&&e(ge,{onClick:()=>{da(n,i)},children:[e(I,{icon:"speak"}),e("span",{children:e(m,{id:"yIBLq8"})})]})]})})]}),e("main",{lang:i,dir:"auto",children:[e("p",{style:{whiteSpace:"pre-wrap",textWrap:"pretty"},children:n}),(r||a)&&e(_o,{forceTranslate:a,sourceLanguage:i,text:n})]})]})}const{min:Fh,max:Uh}=Math;const Yo={};for(let n of["Boolean","Number","String","Function","Array","Date","RegExp","Undefined","Null"])Yo[`[object ${n}]`]=n.toLowerCase();function sl(n){return Yo[Object.prototype.toString.call(n)]||"object"}const ln=(n,i=null)=>n.length>=3?Array.prototype.slice.call(n):sl(n[0])=="object"&&i?i.split("").filter(s=>n[0][s]!==void 0).map(s=>n[0][s]):n[0].slice(0);const{PI:yi,min:Kh,max:Hh}=Math;const jh=yi*2,Vh=yi/3,ol=yi/180,cl=180/yi;function si(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,d)=>i.map(l=>l[d])),a=n.map(u=>c.map(d=>Array.isArray(u)?u.reduce((l,r,h)=>l+r*(d[h]||0),0):d.reduce((l,r)=>l+r*u,0)));return s===1&&(a=a[0]),o===1?a.map(u=>u[0]):a}const Wo={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 _i=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},al=(n,i,s)=>{const{MtxAdaptMa:o,MtxAdaptMaI:c,MtxXYZ2RGB:a,RefWhiteRGB:u,Xn:d,Yn:l,Zn:r}=Wo,h=d*o.m00+l*o.m10+r*o.m20,f=d*o.m01+l*o.m11+r*o.m21,p=d*o.m02+l*o.m12+r*o.m22,y=u.X*o.m00+u.Y*o.m10+u.Z*o.m20,g=u.X*o.m01+u.Y*o.m11+u.Z*o.m21,w=u.X*o.m02+u.Y*o.m12+u.Z*o.m22,k=(n*o.m00+i*o.m10+s*o.m20)*(y/h),b=(n*o.m01+i*o.m11+s*o.m21)*(g/f),v=(n*o.m02+i*o.m12+s*o.m22)*(w/p),_=k*c.m00+b*c.m10+v*c.m20,S=k*c.m01+b*c.m11+v*c.m21,x=k*c.m02+b*c.m12+v*c.m22,C=_i(_*a.m00+S*a.m10+x*a.m20),A=_i(_*a.m01+S*a.m11+x*a.m21),L=_i(_*a.m02+S*a.m12+x*a.m22);return[C*255,A*255,L*255]},ds=(...n)=>{n=ln(n,"lab");const[i,s,o,...c]=n,[a,u,d]=rl([i,s,o]),[l,r,h]=al(a,u,d);return[l,r,h,...c.length>0&&c[0]<1?[c[0]]:[]]};function rl(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=si(s,n);return si(i,o.map(c=>c**3))}function Ii(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 ll=(n,i,s)=>{n=Ii(n/255),i=Ii(i/255),s=Ii(s/255);const{MtxRGB2XYZ:o,MtxAdaptMa:c,MtxAdaptMaI:a,Xn:u,Yn:d,Zn:l,As:r,Bs:h,Cs:f}=Wo;let p=n*o.m00+i*o.m10+s*o.m20,y=n*o.m01+i*o.m11+s*o.m21,g=n*o.m02+i*o.m12+s*o.m22;const w=u*c.m00+d*c.m10+l*c.m20,k=u*c.m01+d*c.m11+l*c.m21,b=u*c.m02+d*c.m12+l*c.m22;let v=p*c.m00+y*c.m10+g*c.m20,_=p*c.m01+y*c.m11+g*c.m21,S=p*c.m02+y*c.m12+g*c.m22;return v*=w/r,_*=k/h,S*=b/f,p=v*a.m00+_*a.m10+S*a.m20,y=v*a.m01+_*a.m11+S*a.m21,g=v*a.m02+_*a.m12+S*a.m22,[p,y,g]},us=(...n)=>{const[i,s,o,...c]=ln(n,"rgb"),a=ll(i,s,o);return[...dl(a),...c.length>0&&c[0]<1?[c[0]]:[]]};function dl(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=si(i,n);return si(s,o.map(c=>Math.cbrt(c)))}const{sin:ul,cos:hl}=Math,fl=(...n)=>{let[i,s,o]=ln(n,"lch");return isNaN(o)&&(o=0),o=o*ol,[i,hl(o)*s,ul(o)*s]},xi=(...n)=>{n=ln(n,"lch");const[i,s,o,...c]=n,[a,u,d]=fl(i,s,o),[l,r,h]=ds(a,u,d);return[l,r,h,...c.length>0&&c[0]<1?[c[0]]:[]]},{sqrt:pl,atan2:ml,round:gl}=Math,yl=(...n)=>{const[i,s,o]=ln(n,"lab"),c=pl(s*s+o*o);let a=(ml(o,s)*cl+360)%360;return gl(c*1e4)===0&&(a=Number.NaN),[i,c,a]},vl=(...n)=>{const[i,s,o,...c]=ln(n,"rgb"),[a,u,d]=us(i,s,o),[l,r,h]=yl(a,u,d);return[l,r,h,...c.length>0&&c[0]<1?[c[0]]:[]]},bl={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_IMG_ALT_API_URL:Yh}=bl;function Go({mediaAttachments:n,statusID:i,instance:s,lang:o,index:c=0,onClose:a=()=>{}}){const{_:u}=ne(),[d,l]=R("default"),r=K(null),[h,f]=R(c),p=K(null);St(()=>{p.current?.scrollIntoView()},[]);const y=K(i);G(()=>{const S=c*r.current.clientWidth,x=y.current!==i;x&&(y.current=i),r.current.focus(),r.current.scrollTo({left:S*(Vt()?-1:1),behavior:x?"auto":"smooth"})},[c,i]);const[g,w]=R(!0);G(()=>{let S=x=>{a(x,h,n,r)};return r.current&&r.current.addEventListener("swiped-down",S),()=>{r.current&&r.current.removeEventListener("swiped-down",S)}},[h,n]),Ke("esc",S=>{a(S,h,n,r)},{ignoreEventWhen:S=>!!document.querySelector("#modal-container > *")||S.metaKey||S.ctrlKey||S.altKey||S.shiftKey,useKey:!0},[a,h,n]),G(()=>{let S=()=>{const{clientWidth:x,scrollLeft:C}=r.current,A=Math.round(Math.abs(C)/x);f(A)};return r.current&&r.current.addEventListener("scroll",S,{passive:!0}),()=>{r.current&&r.current.removeEventListener("scroll",S)}},[]),G(()=>{let S=setTimeout(()=>{r.current?.focus?.()},100);return()=>clearTimeout(S)},[]);const k=Ce(()=>n?.map(S=>{const{blurhash:x}=S;if(x){const C=Zi(x);return vl(C)}return null}),[n]),b=Ce(()=>k?.map(S=>S?{light:xi([.95,.01,S[2]]),dark:xi([.35,.01,S[2]]),default:xi([.6,S[1],S[2]])}:null)),v=Ce(()=>{const x=100/b.length,C=b.map((P,q)=>{const z=q*x+5,H=(q+1)*x-5;return P?.light&&P?.dark?{light:`
rgb(${P.light?.join(",")}) ${z}%,
rgb(${P.light?.join(",")}) ${H}%
`,dark:`
rgb(${P.dark?.join(",")}) ${z}%,
rgb(${P.dark?.join(",")}) ${H}%
`}:{light:`
transparent ${z}%,
transparent ${H}%
`,dark:`
transparent ${z}%,
transparent ${H}%
`}}),A=C.map(P=>P.light).join(", "),L=C.map(P=>P.dark).join(", ");return{light:A,dark:L}},[b]);let _=K(null);return G(()=>()=>{_.current?.hideToast?.()},[]),St(()=>{const S=b[h];let x,C;if(S){const A=ke.local.get("theme");if(A){const L=`rgb(${S[A].join(",")})`;x=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),x&&(C=x.content,x.content=L),document.documentElement.style.setProperty("--meta-theme-color",L)}else{const L=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",P=`rgb(${S[L].join(",")})`;x=document.querySelector(`meta[name="theme-color"][media*="${L}"]`),x&&(C=x.content,x.content=P),document.documentElement.style.setProperty("--meta-theme-color",P)}}return()=>{x&&C&&(x.content=C),document.documentElement.style.removeProperty("--meta-theme-color")}},[h,b]),e("div",{class:`media-modal-container media-modal-count-${n?.length}`,children:[e("div",{ref:r,tabIndex:"0","data-swipe-threshold":"44",class:"carousel",onClick:S=>{(S.target.classList.contains("carousel-item")||S.target.classList.contains("media")||S.target.classList.contains("media-zoom"))&&a(S,h,n,r)},style:n.length>1?{backgroundAttachment:"local","--accent-gradient-light":v?.light,"--accent-gradient-dark":v?.dark}:{},children:n?.map((S,x)=>{const C=n.length===1?b[x]:null;return e("div",{class:"carousel-item",style:C?{"--accent-color":`rgb(${C.default.join(",")})`,"--accent-light-color":`rgb(${C.light?.join(",")})`,"--accent-dark-color":`rgb(${C.dark?.join(",")})`,"--accent-alpha-color":`rgba(${C.default.join(",")}, 0.4)`}:{},tabindex:"0",ref:x===h?p:null,onClick:A=>{A.target.classList.contains("media")||w(!g)},children:[!!S.description&&e("button",{type:"button",class:"media-alt",hidden:!g,onClick:()=>{E.showMediaAlt={alt:S.description,lang:o}},children:[e("span",{class:"alt-badge",children:"ALT"}),e("span",{class:"media-alt-desc",lang:o,dir:"auto",children:S.description})]}),e(Ao,{media:S,showOriginal:!0,lang:o})]},S.id)})}),e("div",{class:"carousel-top-controls",hidden:!g,children:[e("span",{children:e("button",{type:"button",class:"carousel-button",onClick:S=>a(S,h,n,r),children:e(I,{icon:"x",alt:u({id:"yz7wBu"})})})}),n?.length>1?e("span",{class:"carousel-dots",children:n?.map((S,x)=>e("button",{type:"button",disabled:x===h,class:`carousel-dot ${x===h?"active":""}`,onClick:C=>{C.preventDefault(),C.stopPropagation();const A=r.current.clientWidth*x*(Vt()?-1:1);r.current.focus(),r.current.scrollTo({left:A,behavior:"smooth"})},children:e(I,{icon:"round",size:"s",alt:"⸱"})},S.id))}):e("span",{}),e("span",{children:[e(ft,{overflow:"auto",align:"end",position:"anchor",gap:4,menuClassName:"glass-menu",menuButton:e("button",{type:"button",class:"carousel-button",children:e(I,{icon:"more2",alt:u({id:"2FYpfJ"})})}),children:[e(Ve,{href:n[h]?.remoteUrl||n[h]?.url,class:"carousel-button",target:"_blank",title:u({id:"5hXGws"}),children:[e(I,{icon:"popout"}),e("span",{children:e(m,{id:"aDr7Vc"})})]}),!1]})," ",!!i&&e(ye,{to:`${s?`/${s}`:""}/s/${i}${window.matchMedia("(min-width: calc(40em + 350px))").matches?`?media=${h+1}`:""}`,class:"button carousel-button media-post-link",children:[e("span",{class:"button-label",children:[e(m,{id:"ISg5SQ"})," "]}),"»"]})]})]}),n?.length>1&&e("div",{class:"carousel-controls",hidden:!g,children:[e("button",{type:"button",class:"carousel-button",hidden:h===0,onClick:S=>{S.preventDefault(),S.stopPropagation(),r.current.focus(),r.current.scrollTo({left:r.current.clientWidth*(h-1)*(Vt()?-1:1),behavior:"smooth"})},children:e(I,{icon:"arrow-left",alt:u({id:"DHhJ7s"})})}),e("button",{type:"button",class:"carousel-button",hidden:h===n.length-1,onClick:S=>{S.preventDefault(),S.stopPropagation(),r.current.focus(),r.current.scrollTo({left:r.current.clientWidth*(h+1)*(Vt()?-1:1),behavior:"smooth"})},children:e(I,{icon:"arrow-right",alt:u({id:"hXzOVo"})})})]})]})}function wl({url:n,linkText:i,onClose:s}){const{_:o}=ne();if(!n)return null;let c=n;try{const d=URL.parse(n),l=d.protocol,r=d.hostname,h=n.slice(d.origin.length);c=e(N,{children:[l,"//",e("strong",{children:r}),h]})}catch{}const a=()=>{try{navigator.clipboard.writeText(n),re(o({id:"edWbV6"}))}catch{re(o({id:"W1ewR0"}))}},u=()=>{if(navigator.share&&navigator.canShare({url:n}))try{navigator.share({url:n})}catch{}};return e("div",{class:"sheet sheet-modal",id:"open-link-sheet",tabindex:"-1",children:[!!s&&e("button",{type:"button",class:"sheet-close",onClick:s,children:e(I,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{class:"header-grid",children:e("h2",{children:e(m,{id:"Gj4mrz"})})}),e("main",{children:[!!i&&e(N,{children:[e("p",{class:"link-text",children:[e(I,{icon:"cursor-hand",size:"xl"})," ",i]}),e("div",{class:"arrow",children:e(I,{icon:"arrow-down"})})]}),e("p",{class:"full-url",children:c})]}),e("footer",{children:[e("button",{type:"button",class:"light",onClick:s,children:e(m,{id:"dEgA5A"})}),e("span",{class:"spacer"}),e("button",{type:"button",class:"plain6",onClick:a,children:e(I,{icon:"copy",alt:o({id:"he3ygx"})})}),navigator.canShare&&navigator.canShare({url:n})&&e("button",{type:"button",class:"plain6",onClick:u,children:e(I,{icon:"share",alt:o({id:"LFKLqp"})})}),e("a",{class:"button",href:n,target:"_blank",rel:"noopener noreferrer",onClick:s,children:e(m,{id:"1TNIig"})})]})]})}const un={newline:10,reset:27};function kl(n){if(!Number.isSafeInteger(n))throw new Error(`integer expected: ${n}`)}function Zo(n){if(!Number.isSafeInteger(n)||n<1||n>40)throw new Error(`Invalid version=${n}. Expected number [1..40]`)}function Ot(n,i){return n.toString(2).padStart(i,"0")}function Ls(n,i){const s=n%i;return s>=0?s:i+s}function bt(n,i){return new Array(n).fill(i)}function Un(n){return n=n-(n>>>1&1431655765),n=(n&858993459)+(n>>>2&858993459),(n+(n>>>4)&252645135)*16843009>>>24}function $s(n){let i=0,s=0;for(const a of n)i=Math.max(i,a.length),s+=a.length;const o=new Uint8Array(s);let c=0;for(let a=0;a<i;a++)for(const u of n)a<u.length&&(o[c++]=u[a]);return o}function Xo(){let n,i=1/0;return{add(s,o){s>=i||(n=o,i=s)},get:()=>n,score:()=>i}}function Ms(n){return{has:i=>n.includes(i),decode:i=>{if(!Array.isArray(i)||i.length&&typeof i[0]!="string")throw new Error("alphabet.decode input should be array of strings");return i.map(s=>{if(typeof s!="string")throw new Error(`alphabet.decode: not string element=${s}`);const o=n.indexOf(s);if(o===-1)throw new Error(`Unknown letter: "${s}". Allowed: ${n}`);return o})},encode:i=>{if(!Array.isArray(i)||i.length&&typeof i[0]!="number")throw new Error("alphabet.encode input should be an array of numbers");return i.map(s=>{if(kl(s),s<0||s>=n.length)throw new Error(`Digit index outside alphabet: ${s} (alphabet: ${n.length})`);return n[s]})}}}function Ps(n){if(n.length!==32)throw new Error("expects 32 element matrix");const i=[1431655765,858993459,252645135,16711935,65535];for(let s=0;s<5;s++){const o=i[s]>>>0,c=1<<s,a=c<<1;for(let u=0;u<32;u+=a)for(let d=0;d<c;d++){const l=u+d,r=l+c,h=n[l]>>>0,f=n[r]>>>0,p=(h>>>c^f)&o;n[l]=(h^p<<c)>>>0,n[r]=(f^p)>>>0}}}const hn=n=>1<<(n&31)>>>0,Ut=(n,i)=>i===0?0:i===32?4294967295:(1<<i)-1<<n>>>0;class ct{static size(i,s){if(typeof i=="number"&&(i={height:i,width:i}),!Number.isSafeInteger(i.height)&&i.height!==1/0)throw new Error(`Bitmap: invalid height=${i.height} (${typeof i.height})`);if(!Number.isSafeInteger(i.width)&&i.width!==1/0)throw new Error(`Bitmap: invalid width=${i.width} (${typeof i.width})`);return s!==void 0&&(i={width:Math.min(i.width,s.width),height:Math.min(i.height,s.height)}),i}static fromString(i){i=i.replace(/^\n+/g,"").replace(/\n+$/g,"");const s=i.split(String.fromCharCode(un.newline)),o=s.length;let c;const a=[];for(const u of s){const d=u.split("").map(l=>{if(l==="X")return!0;if(l===" ")return!1;if(l!=="?")throw new Error(`Bitmap.fromString: unknown symbol=${l}`)});if(c!==void 0&&d.length!==c)throw new Error(`Bitmap.fromString different row sizes: width=${c} cur=${d.length}`);c=d.length,a.push(d)}return c===void 0&&(c=0),new ct({height:o,width:c},a)}defined;value;tailMask;words;fullWords;height;width;constructor(i,s){const{height:o,width:c}=ct.size(i);if(this.height=o,this.width=c,this.tailMask=Ut(0,c&31||32),this.words=Math.ceil(c/32)|0,this.fullWords=Math.floor(c/32)|0,this.value=new Uint32Array(this.words*o),this.defined=new Uint32Array(this.value.length),s){if(s.length!==o)throw new Error(`Bitmap: data height mismatch: exp=${o} got=${s.length}`);for(let a=0;a<o;a++){const u=s[a];if(!u||u.length!==c)throw new Error(`Bitmap: data width mismatch at y=${a}: exp=${c} got=${u?.length}`);for(let d=0;d<c;d++)this.set(d,a,u[d])}}}point(i){return this.get(i.x,i.y)}isInside(i){return 0<=i.x&&i.x<this.width&&0<=i.y&&i.y<this.height}size(i){if(!i)return{height:this.height,width:this.width};const{x:s,y:o}=this.xy(i);return{height:this.height-o,width:this.width-s}}xy(i){if(typeof i=="number"&&(i={x:i,y:i}),!Number.isSafeInteger(i.x))throw new Error(`Bitmap: invalid x=${i.x}`);if(!Number.isSafeInteger(i.y))throw new Error(`Bitmap: invalid y=${i.y}`);return i.x=Ls(i.x,this.width),i.y=Ls(i.y,this.height),i}wordIndex(i,s){return s*this.words+(i>>>5)}bitIndex(i,s){return{word:this.wordIndex(i,s),bit:i&31}}isDefined(i,s){const o=this.wordIndex(i,s),c=hn(i);return(this.defined[o]&c)!==0}get(i,s){const o=this.wordIndex(i,s),c=hn(i);return(this.value[o]&c)!==0}maskWord(i,s,o){const{defined:c,value:a}=this;c[i]|=s,a[i]=a[i]&~s|-o&s}set(i,s,o){o!==void 0&&this.maskWord(this.wordIndex(i,s),hn(i),o)}fillRectConst(i,s,o,c,a){if(o<=0||c<=0||a===void 0)return;const{value:u,defined:d,words:l}=this,r=i>>>5,h=i+o-1>>>5,f=i&31,p=i+o-1&31;for(let y=0;y<c;y++){const g=(s+y)*l;if(r===h){const w=Ut(f,p-f+1);this.maskWord(g+r,w,a);continue}this.maskWord(g+r,Ut(f,32-f),a);for(let w=r+1;w<h;w++)d[g+w]=4294967295,u[g+w]=a?4294967295:0;this.maskWord(g+h,Ut(0,p+1),a)}}rectWords(i,s,o,c,a){for(let u=0;u<c;u++){const d=s+u;for(let l=0;l<o;){const r=i+l,{bit:h,word:f}=this.bitIndex(r,d),p=Math.min(32-h,o-l);a(f,r,l,u,p),l+=p}}}rect(i,s,o){const{x:c,y:a}=this.xy(i),{height:u,width:d}=ct.size(s,this.size({x:c,y:a}));if(typeof o!="function")return this.fillRectConst(c,a,d,u,o),this;const{defined:l,value:r}=this;return this.rectWords(c,a,d,u,(h,f,p,y,g)=>{let w=0,k=r[h];for(let b=0;b<g;b++){const v=hn(f+b),_=o({x:p+b,y},(k&v)!==0);_!==void 0&&(w|=v,k=k&~v|-_&v)}l[h]|=w,r[h]=k}),this}rectRead(i,s,o){const{x:c,y:a}=this.xy(i),{height:u,width:d}=ct.size(s,this.size({x:c,y:a})),{value:l}=this;return this.rectWords(c,a,d,u,(r,h,f,p,y)=>{const g=l[r];for(let w=0;w<y;w++){const k=hn(h+w);o({x:f+w,y:p},(g&k)!==0)}}),this}hLine(i,s,o){return this.rect(i,{width:s,height:1},o)}vLine(i,s,o){return this.rect(i,{width:1,height:s},o)}border(i=2,s){const o=this.height+2*i,c=this.width+2*i,a=new ct({height:o,width:c});return a.rect(0,1/0,s),a.embed({x:i,y:i},this),a}embed(i,s){const{x:o,y:c}=this.xy(i),{height:a,width:u}=ct.size(s.size(),this.size({x:o,y:c}));if(u<=0||a<=0)return this;const{value:d,defined:l}=this,{words:r,value:h}=s;for(let f=0;f<a;f++){const p=f*r;for(let y=0;y<u;){const g=o+y,{word:w,bit:k}=this.bitIndex(g,c+f),{word:b,bit:v}=s.bitIndex(y,f),_=Math.min(32-k,u-y),S=h[b],x=v&&b+1<p+r?h[b+1]:0,C=v?(S>>>v|x<<32-v)>>>0:S,A=Ut(k,_),L=(C&Ut(0,_))<<k>>>0;l[w]|=A,d[w]=d[w]&~A|L,y+=_}}return this}rectSlice(i,s=this.size()){const{x:o,y:c}=this.xy(i),{height:a,width:u}=ct.size(s,this.size({x:o,y:c})),d=new ct({height:a,width:u});return this.rectRead({x:o,y:c},{height:a,width:u},(l,r)=>{this.isDefined(o+l.x,c+l.y)&&d.set(l.x,l.y,r)}),d}transpose(){const{height:i,width:s,value:o,defined:c,words:a}=this,u=new ct({height:s,width:i}),{words:d,value:l,defined:r,tailMask:h}=u,f=new Uint32Array(32),p=new Uint32Array(32);for(let y=0;y<i;y+=32)for(let g=0;g<a;g++){const w=Math.min(32,i-y);for(let k=0;k<w;k++){const b=this.wordIndex(32*g,y+k);f[k]=o[b],p[k]=c[b]}f.fill(0,w),p.fill(0,w),Ps(f),Ps(p);for(let k=0;k<32;k++){const b=g*32+k;if(b>=s)break;const v=u.wordIndex(y,b),_=y>>>5===d-1?h:4294967295;l[v]=f[k]&_,r[v]=p[k]&_}}return u}negate(){const i=this.defined.length;for(let s=0;s<i;s++)this.value[s]=~this.value[s],this.defined[s]=4294967295;return this}scale(i){if(!Number.isSafeInteger(i)||i>1024)throw new Error(`invalid scale factor: ${i}`);const{height:s,width:o}=this;return new ct({height:i*s,width:i*o}).rect({x:0,y:0},1/0,({x:a,y:u})=>this.get(a/i|0,u/i|0))}clone(){const i=new ct(this.size());return i.defined.set(this.defined),i.value.set(this.value),i}assertDrawn(){const{height:i,width:s,defined:o,tailMask:c,fullWords:a,words:u}=this;if(!(!i||!s))for(let d=0;d<i;d++){const l=d*u;for(let r=0;r<a;r++)if(o[l+r]!==4294967295)throw new Error("Invalid color type=undefined");if(u!==a&&(o[l+a]&c)!==c)throw new Error("Invalid color type=undefined")}}countPatternInRow(i,s,...o){if(s<=0||s>=32)throw new Error("wrong patternLen");const c=(1<<s)-1,{width:a,value:u,words:d}=this;let l=0;const r=this.wordIndex(0,i);for(let h=0,f=0;h<d;h++){const p=u[r+h],y=h===d-1&&a&31||32;for(let g=0;g<y;g++)if(f=(f<<1|p>>>g&1)&c,!(h*32+g+1<s)){for(const w of o)if(f===w){l++;break}}}return l}getRuns(i,s){const{width:o,value:c,words:a}=this;if(o===0)return;let u=0,d;const l=this.wordIndex(0,i);for(let r=0;r<a;r++){const h=c[l+r],f=r===a-1&&o&31||32;for(let p=0;p<f;p++){const y=(h&1<<p)!==0;if(y===d){u++;continue}d!==void 0&&s(u,d),d=y,u=1}}d!==void 0&&s(u,d)}popcnt(){const{height:i,width:s,words:o,fullWords:c,tailMask:a}=this;if(!i||!s)return 0;let u=0;for(let d=0;d<i;d++){const l=d*o;for(let r=0;r<c;r++)u+=Un(this.value[l+r]);o!==c&&(u+=Un(this.value[l+c]&a))}return u}countBoxes2x2(i){const{width:s,words:o}=this;if(s<2||(i|0)<0||i+1>=this.height)return 0;const c=this.wordIndex(0,i)|0,a=this.wordIndex(0,i+1)|0,d=(s&31)===0?2147483647:Ut(0,s-1&31);let l=0;for(let r=0;r<o;r++){const h=this.value[c+r],f=this.value[a+r],p=~(h^f)>>>0,y=r+1<o?this.value[c+r+1]>>>0:0,g=~(h^(h>>>1|(y&1)<<31)>>>0)>>>0,w=r+1<o?this.value[a+r+1]>>>0:0,k=~(f^(f>>>1|(w&1)<<31)>>>0)>>>0;let b=(p&g&k)>>>0;r===o-1&&(b&=d),l+=Un(b)}return l}toString(){const i=String.fromCharCode(un.newline);let s="";for(let o=0;o<this.height;o++){let c="";for(let a=0;a<this.width;a++){const u=this.get(a,o);c+=this.isDefined(a,o)?u?"X":" ":"?"}s+=c+(o+1===this.height?"":i)}return s}toRaw(){const i=Array.from({length:this.height},()=>new Array(this.width));for(let s=0;s<this.height;s++){const o=i[s];for(let c=0;c<this.width;c++)o[c]=this.get(c,s)}return i}toASCII(){const{height:i,width:s}=this;let o="";for(let c=0;c<i;c+=2){for(let a=0;a<s;a++){const u=this.get(a,c),d=c+1>=i?!0:this.get(a,c+1);!u&&!d?o+="█":!u&&d?o+="▀":u&&!d?o+="▄":u&&d&&(o+=" ")}o+=String.fromCharCode(un.newline)}return o}toTerm(){const i=String.fromCharCode(un.reset),s=i+"[0m",o=i+"[1;47m "+s,c=i+"[40m "+s,a=String.fromCharCode(un.newline);let u="";for(let d=0;d<this.height;d++){for(let l=0;l<this.width;l++){const r=this.get(l,d);u+=r?c:o}u+=a}return u}toSVG(i=!0){let s=`<svg viewBox="0 0 ${this.width} ${this.height}" xmlns="http://www.w3.org/2000/svg">`,o="",c;return this.rectRead(0,1/0,(a,u)=>{if(!u)return;const{x:d,y:l}=a;if(!i){s+=`<rect x="${d}" y="${l}" width="1" height="1" />`;return}let r=`M${d} ${l}`;if(c){const f=`m${d-c.x} ${l-c.y}`;f.length<=r.length&&(r=f)}const h=d<10?`H${d}`:"h-1";o+=`${r}h1v1${h}Z`,c=a}),i&&(s+=`<path d="${o}"/>`),s+="</svg>",s}toGIF(){const i=d=>[d&255,d>>>8&255],s=[...i(this.width),...i(this.height)],o=[];this.rectRead(0,1/0,(d,l)=>o.push(+(l===!0)));const c=126,a=[71,73,70,56,55,97,...s,246,0,0,255,255,255,...bt(381,0),44,0,0,0,0,...s,0,7],u=Math.floor(o.length/c);for(let d=0;d<u;d++)a.push(c+1,128,...o.slice(c*d,c*(d+1)).map(l=>+l));return a.push(o.length%c+1,128,...o.slice(u*c).map(d=>+d)),a.push(1,129,0,59),new Uint8Array(a)}toImage(i=!1){const{height:s,width:o}=this.size(),c=new Uint8Array(s*o*(i?3:4));let a=0;for(let u=0;u<s;u++)for(let d=0;d<o;d++){const l=this.get(d,u)?0:255;c[a++]=l,c[a++]=l,c[a++]=l,i||(c[a++]=255)}return{height:s,width:o,data:c}}}const Ds=["low","medium","quartile","high"],Ns=["numeric","alphanumeric","byte","kanji","eci"],Sl=[26,44,70,100,134,172,196,242,292,346,404,466,532,581,655,733,815,901,991,1085,1156,1258,1364,1474,1588,1706,1828,1921,2051,2185,2323,2465,2611,2761,2876,3034,3196,3362,3532,3706],Cl={low:[7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],medium:[10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],quartile:[13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],high:[17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]},_l={low:[1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],medium:[1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],quartile:[1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],high:[1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]},it={size:{encode:n=>21+4*(n-1),decode:n=>(n-17)/4},sizeType:n=>Math.floor((n+7)/17),alignmentPatterns(n){if(n===1)return[];const i=6,s=it.size.encode(n)-i-1,o=s-i,c=Math.ceil(o/28);let a=Math.floor(o/c);a%2?a+=1:o%c*2>=c&&(a+=2);const u=[i];for(let d=1;d<c;d++)u.push(s-(c-d)*a);return u.push(s),u},ECCode:{low:1,medium:0,quartile:3,high:2},formatMask:21522,formatBits(n,i){const s=it.ECCode[n]<<3|i;let o=s;for(let c=0;c<10;c++)o=o<<1^(o>>9)*1335;return(s<<10|o)^it.formatMask},versionBits(n){let i=n;for(let s=0;s<12;s++)i=i<<1^(i>>11)*7973;return n<<12|i},alphabet:{numeric:Ms("0123456789"),alphanumerc:Ms("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:")},lengthBits(n,i){return{numeric:[10,12,14],alphanumeric:[9,11,13],byte:[8,16,16],kanji:[8,10,12],eci:[0,0,0]}[i][it.sizeType(n)]},modeBits:{numeric:"0001",alphanumeric:"0010",byte:"0100",kanji:"1000",eci:"0111"},capacity(n,i){const s=Sl[n-1],o=Cl[i][n-1],c=_l[i][n-1],a=Math.floor(s/c)-o,u=c-s%c;return{words:o,numBlocks:c,shortBlocks:u,blockLen:a,capacity:(s-o*c)*8,total:(o+a)*c+c-u}}},hs=[(n,i)=>(n+i)%2==0,(n,i)=>i%2==0,(n,i)=>n%3==0,(n,i)=>(n+i)%3==0,(n,i)=>(Math.floor(i/2)+Math.floor(n/3))%2==0,(n,i)=>n*i%2+n*i%3==0,(n,i)=>(n*i%2+n*i%3)%2==0,(n,i)=>((n+i)%2+n*i%3)%2==0],ue={tables:(n=>{const i=bt(256,0),s=bt(256,0);for(let o=0,c=1;o<256;o++)i[o]=c,s[c]=o,c<<=1,c&256&&(c^=n);return{exp:i,log:s}})(285),exp:n=>ue.tables.exp[n],log(n){if(n===0)throw new Error(`GF.log: invalid arg=${n}`);return ue.tables.log[n]%255},mul(n,i){return n===0||i===0?0:ue.tables.exp[(ue.tables.log[n]+ue.tables.log[i])%255]},add:(n,i)=>n^i,pow:(n,i)=>ue.tables.exp[ue.tables.log[n]*i%255],inv(n){if(n===0)throw new Error(`GF.inverse: invalid arg=${n}`);return ue.tables.exp[255-ue.tables.log[n]]},polynomial(n){if(n.length==0)throw new Error("GF.polymomial: invalid length");if(n[0]!==0)return n;let i=0;for(;i<n.length-1&&n[i]==0;i++);return n.slice(i)},monomial(n,i){if(n<0)throw new Error(`GF.monomial: invalid degree=${n}`);if(i==0)return[0];let s=bt(n+1,0);return s[0]=i,ue.polynomial(s)},degree:n=>n.length-1,coefficient:(n,i)=>n[ue.degree(n)-i],mulPoly(n,i){if(n[0]===0||i[0]===0)return[0];const s=bt(n.length+i.length-1,0);for(let o=0;o<n.length;o++)for(let c=0;c<i.length;c++)s[o+c]=ue.add(s[o+c],ue.mul(n[o],i[c]));return ue.polynomial(s)},mulPolyScalar(n,i){if(i==0)return[0];if(i==1)return n;const s=bt(n.length,0);for(let o=0;o<n.length;o++)s[o]=ue.mul(n[o],i);return ue.polynomial(s)},mulPolyMonomial(n,i,s){if(i<0)throw new Error("GF.mulPolyMonomial: invalid degree");if(s==0)return[0];const o=bt(n.length+i,0);for(let c=0;c<n.length;c++)o[c]=ue.mul(n[c],s);return ue.polynomial(o)},addPoly(n,i){if(n[0]===0)return i;if(i[0]===0)return n;let s=n,o=i;s.length>o.length&&([s,o]=[o,s]);let c=bt(o.length,0),a=o.length-s.length,u=o.slice(0,a);for(let d=0;d<u.length;d++)c[d]=u[d];for(let d=a;d<o.length;d++)c[d]=ue.add(s[d-a],o[d]);return ue.polynomial(c)},remainderPoly(n,i){const s=Array.from(n);for(let o=0;o<n.length-i.length+1;o++){const c=s[o];if(c!==0)for(let a=1;a<i.length;a++)i[a]!==0&&(s[o+a]=ue.add(s[o+a],ue.mul(i[a],c)))}return s.slice(n.length-i.length+1,s.length)},divisorPoly(n){let i=[1];for(let s=0;s<n;s++)i=ue.mulPoly(i,[1,ue.pow(2,s)]);return i},evalPoly(n,i){if(i==0)return ue.coefficient(n,0);let s=n[0];for(let o=1;o<n.length;o++)s=ue.add(ue.mul(i,s),n[o]);return s},euclidian(n,i,s){ue.degree(n)<ue.degree(i)&&([n,i]=[i,n]);let o=n,c=i,a=[0],u=[1];for(;2*ue.degree(c)>=s;){let r=o,h=a;if(o=c,a=u,o[0]===0)throw new Error("rLast[0] === 0");c=r;let f=[0];const p=ue.inv(o[0]);for(;ue.degree(c)>=ue.degree(o)&&c[0]!==0;){const y=ue.degree(c)-ue.degree(o),g=ue.mul(c[0],p);f=ue.addPoly(f,ue.monomial(y,g)),c=ue.addPoly(c,ue.mulPolyMonomial(o,y,g))}if(f=ue.mulPoly(f,a),u=ue.addPoly(f,h),ue.degree(c)>=ue.degree(o))throw new Error(`Division failed r: ${c}, rLast: ${o}`)}const d=ue.coefficient(u,0);if(d==0)throw new Error("sigmaTilde(0) was zero");const l=ue.inv(d);return[ue.mulPolyScalar(u,l),ue.mulPolyScalar(c,l)]}};function Il(n){return{encode(i){const s=ue.divisorPoly(n),o=Array.from(i);return o.push(...s.slice(0,-1).fill(0)),Uint8Array.from(ue.remainderPoly(o,s))},decode(i){const s=i.slice(),o=ue.polynomial(Array.from(i));let c=bt(n,0),a=!1;for(let f=0;f<n;f++){const p=ue.evalPoly(o,ue.exp(f));c[c.length-1-f]=p,p!==0&&(a=!0)}if(!a)return s;c=ue.polynomial(c);const u=ue.monomial(n,1),[d,l]=ue.euclidian(u,c,n),r=bt(ue.degree(d),0);let h=0;for(let f=1;f<256&&h<r.length;f++)ue.evalPoly(d,f)===0&&(r[h++]=ue.inv(f));if(h!==r.length)throw new Error("RS.decode: invalid errors number");for(let f=0;f<r.length;f++){const p=s.length-1-ue.log(r[f]);if(p<0)throw new Error("RS.decode: invalid error location");const y=ue.inv(r[f]);let g=1;for(let w=0;w<r.length;w++)f!==w&&(g=ue.mul(g,ue.add(1,ue.mul(r[w],y))));s[p]=ue.add(s[p],ue.mul(ue.evalPoly(l,y),ue.inv(g)))}return s}}}function Qo(n,i){const{words:s,shortBlocks:o,numBlocks:c,blockLen:a,total:u}=it.capacity(n,i),d=Il(s);return{encode(l){const r=[],h=[];for(let g=0;g<c;g++){const w=g<o,k=a+(w?0:1);r.push(l.subarray(0,k)),h.push(d.encode(l.subarray(0,k))),l=l.subarray(k)}const f=$s(r),p=$s(h),y=new Uint8Array(f.length+p.length);return y.set(f),y.set(p,f.length),y},decode(l){if(l.length!==u)throw new Error(`interleave.decode: len(data)=${l.length}, total=${u}`);const r=[];for(let p=0;p<c;p++){const y=p<o;r.push(new Uint8Array(s+a+(y?0:1)))}let h=0;for(let p=0;p<a;p++)for(let y=0;y<c;y++)r[y][p]=l[h++];for(let p=o;p<c;p++)r[p][a]=l[h++];for(let p=a;p<a+s;p++)for(let y=0;y<c;y++){const g=y<o;r[y][p+(g?0:1)]=l[h++]}const f=[];for(const p of r)f.push(...Array.from(d.decode(p)).slice(0,-s));return Uint8Array.from(f)}}}function Jo(n,i,s,o=!1){const c=it.size.encode(n);let a=new ct(c+2);const u=new ct(3).rect(0,3,!0).border(1,!1).border(1,!0).border(1,!1);a=a.embed(0,u).embed({x:-u.width,y:0},u).embed({x:0,y:-u.height},u),a=a.rectSlice(1,c);const d=new ct(1).rect(0,1,!0).border(1,!1).border(1,!0),l=it.alignmentPatterns(n);for(const r of l)for(const h of l)a.isDefined(h,r)||a.embed({x:h-2,y:r-2},d);a=a.hLine({x:0,y:6},1/0,({x:r})=>a.isDefined(r,6)?void 0:r%2==0).vLine({x:6,y:0},1/0,({y:r})=>a.isDefined(6,r)?void 0:r%2==0);{const r=it.formatBits(i,s),h=f=>!o&&(r>>f&1)==1;for(let f=0;f<6;f++)a.set(8,f,h(f));for(let f=6;f<8;f++)a.set(8,f+1,h(f));for(let f=8;f<15;f++)a.set(8,c-15+f,h(f));for(let f=0;f<8;f++)a.set(c-f-1,8,h(f));for(let f=8;f<9;f++)a.set(15-f-1+1,8,h(f));for(let f=9;f<15;f++)a.set(15-f-1,8,h(f));a.set(8,c-8,!o)}if(n>=7){const r=it.versionBits(n);for(let h=0;h<18;h+=1){const f=!o&&(r>>h&1)==1,p=Math.floor(h/3),y=h%3+c-8-3;a.set(y,p,f),a.set(p,y,f)}}return a}function ec(n,i,s){const o=n.height,c=hs[i];let a=-1,u=o-1;for(let d=o-1;d>0;d-=2){for(d==6&&(d=5);;u+=a){for(let l=0;l<2;l+=1){const r=d-l;n.isDefined(r,u)||s(r,u,c(r,u))}if(u+a<0||u+a>=o)break}a=-a}}function xl(n){let i="numeric";for(let s of n)if(!it.alphabet.numeric.has(s)&&(i="alphanumeric",!it.alphabet.alphanumerc.has(s)))return"byte";return i}function Al(n){if(typeof n!="string")throw new Error(`utf8ToBytes expected string, got ${typeof n}`);return new Uint8Array(new TextEncoder().encode(n))}function Os(n,i,s,o,c=Al){let a="",u=s.length;if(o==="numeric"){const p=it.alphabet.numeric.decode(s.split("")),y=p.length;for(let g=0;g<y-2;g+=3)a+=Ot(p[g]*100+p[g+1]*10+p[g+2],10);y%3===1?a+=Ot(p[y-1],4):y%3===2&&(a+=Ot(p[y-2]*10+p[y-1],7))}else if(o==="alphanumeric"){const p=it.alphabet.alphanumerc.decode(s.split("")),y=p.length;for(let g=0;g<y-1;g+=2)a+=Ot(p[g]*45+p[g+1],11);y%2==1&&(a+=Ot(p[y-1],6))}else if(o==="byte"){const p=c(s);u=p.length,a=Array.from(p).map(y=>Ot(y,8)).join("")}else throw new Error("encode: unsupported type");const{capacity:d}=it.capacity(n,i),l=Ot(u,it.lengthBits(n,o));let r=it.modeBits[o]+l+a;if(r.length>d)throw new Error("Capacity overflow");r+="0".repeat(Math.min(4,Math.max(0,d-r.length))),r.length%8&&(r+="0".repeat(8-r.length%8));const h="1110110000010001";for(let p=0;r.length!==d;p++)r+=h[p%h.length];const f=Uint8Array.from(r.match(/(.{8})/g).map(p=>+`0b${p}`));return Qo(n,i).encode(f)}function zs(n,i,s,o,c=!1){const a=Jo(n,i,o,c);let u=0;const d=8*s.length;if(ec(a,o,(l,r,h)=>{let f=!1;u<d&&(f=(s[u>>>3]>>(7-u&7)&1)!==0,u++),a.set(l,r,f!==h)}),u!==d)throw new Error("QR: bytes left after draw");return a}const tc=n=>{const i=n.map(s=>s?"1":"0").join("");return{len:i.length,n:+`0b${i}`}},nc=[!0,!1,!0,!0,!0,!1,!0],ic=[!1,!1,!1,!1],Mn=tc([...nc,...ic]),Bs=tc([...ic,...nc]);function Tl(n){const{width:i,height:s}=n,o=n.transpose();let c=0;for(let h=0;h<s;h++)n.getRuns(h,f=>{f>=5&&(c+=3+(f-5))});for(let h=0;h<i;h++)o.getRuns(h,f=>{f>=5&&(c+=3+(f-5))});let a=0;for(let h=0;h<s-1;h++)a+=3*n.countBoxes2x2(h);let u=0;for(let h=0;h<s;h++)u+=40*n.countPatternInRow(h,Mn.len,Mn.n,Bs.n);for(let h=0;h<i;h++)u+=40*o.countPatternInRow(h,Mn.len,Mn.n,Bs.n);let d=0;d=n.popcnt();const l=d/(s*i)*100,r=10*Math.floor(Math.abs(l-50)/5);return c+a+u+r}function El(n,i,s,o){if(o===void 0){const c=Xo();for(let a=0;a<hs.length;a++)c.add(Tl(zs(n,i,s,a,!0)),a);o=c.get()}if(o===void 0)throw new Error("Cannot find mask");return zs(n,i,s,o)}function Rl(n){if(!Ds.includes(n))throw new Error(`Invalid error correction mode=${n}. Expected: ${Ds}`)}function Ll(n){if(!Ns.includes(n))throw new Error(`Encoding: invalid mode=${n}. Expected: ${Ns}`);if(n==="kanji"||n==="eci")throw new Error(`Encoding: ${n} is not supported (yet?).`)}function $l(n){if(![0,1,2,3,4,5,6,7].includes(n)||!hs[n])throw new Error(`Invalid mask=${n}. Expected number [0..7]`)}function Ml(n,i="raw",s={}){const o=s.ecc!==void 0?s.ecc:"medium";Rl(o);const c=s.encoding!==void 0?s.encoding:xl(n);Ll(c),s.mask!==void 0&&$l(s.mask);let a=s.version,u,d=new Error("Unknown error");if(a!==void 0)Zo(a),u=Os(a,o,n,c,s.textEncoder);else for(let h=1;h<=40;h++)try{u=Os(h,o,n,c,s.textEncoder),a=h;break}catch(f){d=f}if(!a||!u)throw d;let l=El(a,o,u,s.mask);l.assertDrawn();const r=s.border===void 0?2:s.border;if(!Number.isSafeInteger(r))throw new Error(`invalid border type=${typeof r}`);if(l=l.border(r,!1),s.scale!==void 0&&(l=l.scale(s.scale)),i==="raw")return l.toRaw();if(i==="ascii")return l.toASCII();if(i==="svg")return l.toSVG(s.optimize);if(i==="gif")return l.toGIF();if(i==="term")return l.toTerm();throw new Error(`Unknown output: ${i}`)}const Wh={best:Xo,bin:Ot,popcnt:Un,drawTemplate:Jo,fillArr:bt,info:it,interleave:Qo,validateVersion:Zo,zigzag:ec};const Ni=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),Oi=Ni.getContext("2d",{willReadFrequently:!0});Oi.imageSmoothingEnabled=!1;function Pl({text:n,arena:i,backgroundMask:s,arenaCircle:o=!0,caption:c}){const a=K(null),[u,d]=R(0),[l,r]=R(!1),[h,f]=R(!1),p=h?!1:o;if(G(()=>{if(c&&a.current){const W=a.current.offsetHeight;d(W)}},[c]),G(()=>{if(i){const W=new Image;W.crossOrigin="anonymous",W.onload=()=>{r(!0);try{const{width:$,height:J}=W;Ni.width=$,Ni.height=J,Oi.drawImage(W,0,0);const ve=Oi.getImageData(0,0,$,J).data,we=ve.length/4;let U=0,Y=!1;for(let fe=3;fe<ve.length;fe+=4)if(ve[fe]<=128&&U++,U/we>.1){Y=!0;break}f(Y)}catch{f(!1)}},W.onerror=$=>{r(!0)},W.src=i}else r(!1)},[i]),!n)return null;const y=Ce(()=>Ml(n,"raw",{ecc:"high",border:0,scale:1}),[n]),g=y.length,w=l?Math.ceil(g*.3):0,k=Math.floor((g-w)/2),b=k+w,v=(W,$)=>{if(W<0||W>=g||$<0||$>=g)return!1;if(l&&W>=k&&W<b&&$>=k&&$<b)if(o){const J=(k+b)/2,V=(k+b)/2,ve=w/2,we=W+.5-J,U=$+.5-V;if(Math.sqrt(we*we+U*U)<ve)return!1}else return!1;return y[$][W]},_=(W,$)=>W<0||W>=g||$<0||$>=g?!1:v(W,$),S=(W,$)=>W<7&&$<7||W>=g-7&&$<7||W<7&&$>=g-7,x=Ce(()=>{let W="";for(let $=0;$<g;$++)for(let J=0;J<g;J++){if(!_(J,$)||S(J,$))continue;const V=J+.5,ve=$+.5,we=_(J,$-1)&&!S(J,$-1),U=_(J+1,$)&&!S(J+1,$),Y=_(J,$+1)&&!S(J,$+1),fe=_(J-1,$)&&!S(J-1,$);U&&(W+=`M ${V} ${ve} L ${V+1} ${ve} `),Y&&(W+=`M ${V} ${ve} L ${V} ${ve+1} `),!we&&!U&&!Y&&!fe&&(W+=`M ${V} ${ve} L ${V} ${ve} `)}return W},[g,y,l,k,b,w,p]),C=[{x:0,y:0},{x:g-7,y:0},{x:0,y:g-7}],A=1.1,L=.6,P=1,q=w-P*2,z=k+P,H=k+P,ee=2,te=2,Z=g+ee*2,X=g+ee*2+(c?te+u:0),j=Z*.25;return e("svg",{class:"qr-code",viewBox:`${-ee} ${-ee} ${Z} ${X}`,xmlns:"http://www.w3.org/2000/svg","shape-rendering":"geometricPrecision",children:[e("defs",{children:[e("g",{id:"position-marker",children:[e("rect",{x:"0.5",y:"0.5",width:"6",height:"6",fill:"none",stroke:"currentColor","stroke-width":"1",rx:A,ry:A}),e("rect",{x:"2",y:"2",width:"3",height:"3",fill:"currentColor",rx:L,ry:L})]}),e("g",{id:"position-marker-mask",children:[e("rect",{x:"0.5",y:"0.5",width:"6",height:"6",fill:"none",stroke:"white","stroke-width":"1",rx:A,ry:A}),e("rect",{x:"2",y:"2",width:"3",height:"3",fill:"white",rx:L,ry:L})]}),s&&e("filter",{id:"blur-mask",children:[e("feGaussianBlur",{in:"SourceGraphic",stdDeviation:"2"}),e("feColorMatrix",{type:"saturate",values:"2"}),e("feComponentTransfer",{children:[e("feFuncR",{type:"linear",slope:"1.2",intercept:"0.3"}),e("feFuncG",{type:"linear",slope:"1.2",intercept:"0.3"}),e("feFuncB",{type:"linear",slope:"1.2",intercept:"0.3"})]})]}),s&&e("mask",{id:"qr-pattern-mask",children:[e("path",{fill:"white",stroke:"white","stroke-width":"1","stroke-linejoin":"round","stroke-linecap":"round",d:x}),e("g",{id:"position-markers-mask",children:C.map(W=>e("use",{href:"#position-marker-mask",x:W.x,y:W.y},`${W.x}-${W.y}`))}),l&&p&&e("circle",{cx:z+q/2,cy:H+q/2,r:q/2,fill:"black"}),l&&!o&&e("rect",{x:z,y:H,width:q,height:q,fill:"black"})]}),e("path",{id:"qr-pattern",fill:"currentColor",stroke:"currentColor","stroke-width":"1","stroke-linejoin":"round","stroke-linecap":"round",d:x})]}),e("use",{href:"#qr-pattern"}),e("g",{id:"position-markers",children:C.map(W=>e("use",{href:"#position-marker",x:W.x,y:W.y},`${W.x}-${W.y}`))}),s&&e("g",{mask:"url(#qr-pattern-mask)",children:e("image",{href:s,x:-ee-j,y:-ee-j,width:Z+j*2,height:Z+j*2,preserveAspectRatio:"none",opacity:"0.5",filter:"url(#blur-mask)"})}),i&&l&&e("image",{href:i,x:z,y:H,width:q,height:q,preserveAspectRatio:"xMidYMid slice","clip-path":p?`circle(${q/2}px at ${q/2}px ${q/2}px)`:void 0}),c&&e("foreignObject",{x:0,y:g+te,width:g,height:u,children:e("div",{ref:a,xmlns:"http://www.w3.org/1999/xhtml",class:"qr-code-caption",dangerouslySetInnerHTML:{__html:c}})})]})}const sc=!!navigator.mediaDevices?.getUserMedia;function Dl({text:n,arena:i,backgroundMask:s,caption:o,onClose:c,onScannerClick:a}){const{_:u}=ne();return e("div",{class:"qr-code-modal-container",children:[e("div",{class:"qr-code-modal-controls",children:[sc&&typeof a=="function"?e("button",{type:"button",class:"plain4",onClick:a,children:e(I,{icon:"scan",alt:u({id:"XDwkfO"})})}):e("span",{}),!!c&&e("button",{type:"button",class:"plain4",onClick:c,children:e(I,{icon:"x",alt:u({id:"yz7wBu"})})})]}),e(Pl,{text:n,arena:i,backgroundMask:s,caption:o}),e("div",{class:"qr-code-text",children:n})]})}const Kn="BarcodeDetector"in window;Kn||setTimeout(()=>{di(()=>import("./dom-BGTnaPi8.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).catch(()=>{})},1e3);class Nl{constructor(i,s){this.stream=i,this.player=s,this.setStream(i)}setStream(i){this.stream=i;const{player:s}=this;s.setAttribute("autoplay",""),s.setAttribute("muted",""),s.setAttribute("playsinline",""),s.srcObject=i}async listDevices(){if(!navigator.mediaDevices||!navigator.mediaDevices.enumerateDevices)throw new Error("Media Devices not supported");return(await navigator.mediaDevices.enumerateDevices()).filter(s=>s.kind==="videoinput").map(s=>({deviceId:s.deviceId,label:s.label||`Camera ${s.deviceId}`}))}async setDevice(i){this.stop();const s=await navigator.mediaDevices.getUserMedia({video:{deviceId:{exact:i}}});this.setStream(s)}readFrame(i,s=!1){const{player:o}=this;if(s)return i.drawImage(o,o.videoHeight,o.videoWidth);const c=getSize(o);return i.drawImage(o,c.height,c.width)}stop(){for(const i of this.stream.getTracks())i.stop()}}const Ol=async n=>{if(navigator.permissions?.query)try{(await navigator.permissions.query({name:"camera"})).addEventListener("change",()=>{})}catch{}const i=await navigator.mediaDevices.getUserMedia({video:{height:{ideal:720},width:{ideal:1280},facingMode:"environment"}});return new Nl(i,n)};function zl({onClose:n,checkValidity:i,actionableText:s}){const{_:o,_:c}=ne(),a=K(null),u=K(null),d=K(null),[l,r]=R(""),[h,f]=R(!0),[p,y]=R("loading");G(()=>{let w;return screen?.orientation?.type&&a.current&&(w=()=>{const k=/landscape/.test(window.screen.orientation.type)?"landscape":"portrait";a.current.classList.toggle("landscape",k==="landscape")},screen.orientation.addEventListener("change",w),w()),()=>{w&&screen?.orientation?.removeEventListener&&screen.orientation.removeEventListener("change",w)}},[]),G(()=>{let w,k,b,v,_;return h&&(async()=>{try{k=await Ol(u.current),Kn?v=new BarcodeDetector({formats:["qr_code"]}):(_=await di(()=>import("./dom-BGTnaPi8.js"),__vite__mapDeps([0,1,2,3]),import.meta.url),b=new _.QRCanvas({overlay:d.current},{cropToSquare:!1,overlayMainColor:"transparent",overlayFinderColor:"rgba(255, 0, 255, 0.5)"}));const x=u.current;x&&(x.addEventListener("loadedmetadata",()=>{y("default")}),x.addEventListener("play",()=>{const{videoWidth:C,videoHeight:A}=x;if(C&&A&&(a.current.style.setProperty("--long-dimension",Math.max(C,A)),a.current.style.setProperty("--short-dimension",Math.min(C,A))),Kn){const L=async()=>{try{const z=await v.detect(u.current);z.length>0&&r(z[0].rawValue)}catch{}};let P;const q=()=>{L(),P=requestAnimationFrame(q)};q(),w=()=>cancelAnimationFrame(P)}else{const L=()=>{try{const P=k.readFrame(b,!0);P!=null&&r(P)}catch{}};w=_.frameLoop(L)}}))}catch{y("error"),f(!1)}})(),()=>{w&&w(),k&&k.stop(),b&&b.clear()}},[h]);const g=typeof i=="function"?i(l):!!l;return e("div",{class:"qr-scanner-modal",children:[e("div",{class:"qr-scanner-header",children:[e(Be,{abrupt:!0,hidden:p!=="loading"}),e("button",{type:"button",class:"plain4",onClick:n,children:e(I,{icon:"x",alt:o({id:"yz7wBu"})})})]}),p==="error"?e("div",{class:"ui-state",children:e("p",{children:e(m,{id:"08IojR"})})}):e(N,{children:[e("div",{ref:a,class:"qr-scanner-video-container",children:[e("video",{ref:u,playsInline:!0,muted:!0,disablepictureinpicture:!0}),!Kn&&e("canvas",{ref:d,class:"qr-scanner-canvas"}),e("svg",{class:"qr-scanner-corner-hint",viewBox:"0 0 100 100",preserveAspectRatio:"xMidYMid meet",children:[e("path",{d:"M 25 10 L 15 10 Q 10 10 10 15 L 10 25",stroke:"currentColor","stroke-width":"2",fill:"none","stroke-linecap":"round"}),e("path",{d:"M 75 10 L 85 10 Q 90 10 90 15 L 90 25",stroke:"currentColor","stroke-width":"2",fill:"none","stroke-linecap":"round"}),e("path",{d:"M 25 90 L 15 90 Q 10 90 10 85 L 10 75",stroke:"currentColor","stroke-width":"2",fill:"none","stroke-linecap":"round"}),e("path",{d:"M 75 90 L 85 90 Q 90 90 90 85 L 90 75",stroke:"currentColor","stroke-width":"2",fill:"none","stroke-linecap":"round"})]})]}),e("div",{class:"qr-scanner-result",children:!!l&&e(N,{children:[e("p",{class:"qr-scanner-text",children:l}),g&&e("button",{type:"button",class:"button plain6",onClick:()=>{n({text:l})},children:s?c(s):e(I,{icon:"arrow-right"})})]})})]})]})}const Bl=["spam","legal","violation","other"],fn={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 ql(n,i){if(!n.translations||!i)return null;const s=Object.keys(n.translations);if(!s?.length)return null;let o=ei([i],s,null);if(!o){const c=s.map(a=>a.split(/(?=[A-Z])/).map((d,l)=>l===0?d:d.toLowerCase()).join("-"));o=ei([i],c,null)}if(o&&o.includes("-")){const[c,a]=o.split("-");o=c+a.charAt(0).toUpperCase()+a.slice(1)}return o}function Fl(n,i){return n?.length?i?n.map(s=>{const o=ql(s,i);return{...s,_translatedText:s.translations?.[o]?.text||null}}):n:[]}function Ul({account:n,post:i,onClose:s}){const{_:o,_:c,i18n:a}=ne(),{masto:u}=oe(),[d,l]=R("default"),[r,h]=n.acct.split("@"),[f,p]=Ce(()=>{const{rules:S,domain:x}=fo();return[Fl(S||[],a.locale),x]},[a.locale]),[y,g]=R(null),[w,k]=R(!1),b=K(null),[v,_]=R(!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:r}})}),e("button",{type:"button",class:"plain4 small",disabled:d==="loading",onClick:()=>s(),children:e(I,{icon:"x",size:"xl",alt:c({id:"yz7wBu"})})})]}),e("main",{children:[e("div",{class:"report-preview",children:i?e(je,{status:i,size:"s",previewMode:!0}):e(gt,{account:n,avatarSize:"xxl",useAvatarStatic:!0,showStats:!0,showActivity:!0})}),!!y&&!fn[y].excludeStamp&&e("span",{class:"rubber-stamp","aria-hidden":"true",children:[o(fn[y].stampLabel||o(fn[y].label)),e("small",{children:e(m,{id:"2WtL62"})})]},y),e("form",{onSubmit:S=>{S.preventDefault();const x=new FormData(S.target),C=Object.fromEntries(x.entries());let{category:A,comment:L,forward:P}=C;L||(L=void 0),P==="on"&&(P=!0);const q=A==="violation"?Object.entries(C).filter(([H])=>H.startsWith("rule_ids")).map(([H,ee])=>ee):void 0,z={category:A,comment:L,forward:P,ruleIds:q};l("loading"),(async()=>{try{await u.v1.reports.create({accountId:n.id,statusIds:i?.id?[i.id]:void 0,category:A,comment:L,ruleIds:q,forward:P}),l("success"),re(c(i?{id:"y3ou+8"}:{id:"R9kjEL"})),s()}catch(H){l("error"),re(H?.message||c(i?{id:"+3FjPq"}:{id:"oEQq5w"}))}})()},children:[e("p",{children:c(i?{id:"L9fUm+"}:{id:"rSLkfe"})}),e("section",{class:"report-categories",children:Bl.map(S=>S==="violation"&&!f?.length?null:e(N,{children:[e("label",{class:"report-category",children:[e("input",{type:"radio",name:"category",value:S,required:!0,disabled:d==="loading",onChange:x=>{g(x.target.value),k(x.target.value==="violation")}}),e("span",{children:[o(fn[S].label),"  ",e("small",{class:"ib insignificant",children:o(fn[S].description)})]})]}),S==="violation"&&!!f?.length&&e("div",{class:"shazam-container no-animation",hidden:!w,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"report-rules",ref:b,children:f.map((x,C)=>e("label",{class:"report-rule",children:[e("input",{type:"checkbox",name:`rule_ids[${C}]`,value:x.id,required:w&&!v,disabled:d==="loading",onChange:A=>{const{checked:L}=A.target;L?_(!0):b.current.querySelectorAll("input:checked").length||_(!1)}}),e("span",{children:x._translatedText||x.text})]},x.id))})})})]},S))}),e("section",{class:"report-comment",children:[e("p",{children:e("label",{for:"report-comment",children:e(m,{id:"ecVtjm"})})}),e("textarea",{maxlength:"1000",rows:"1",name:"comment",id:"report-comment",disabled:d==="loading",required:!i})]}),!!h&&h!==p&&e("section",{children:e("p",{children:e("label",{children:[e("input",{type:"checkbox",switch:!0,name:"forward",disabled:d==="loading"})," ",e("span",{children:e(m,{id:"cyjS8M",values:{domain:h},components:{0:e("i",{})}})})]})})}),e("footer",{children:[e("button",{type:"submit",disabled:d==="loading",children:e(m,{id:"4cijjm"})})," ",e("button",{type:"submit",class:"plain2",disabled:d==="loading",onClick:async()=>{try{await u.v1.accounts.$select(n.id).mute(),re(c({id:"/BGBeF",values:{username:r}}))}catch{re(c({id:"v02K7/",values:{username:r}}))}},children:e(m,{id:"caeqw/",components:{0:e("small",{class:"ib"})}})})," ",e("button",{type:"submit",class:"plain2",disabled:d==="loading",onClick:async()=>{try{await u.v1.accounts.$select(n.id).block(),re(c({id:"kjUejn",values:{username:r}}))}catch{re(c({id:"pMcdDp",values:{username:r}}))}},children:e(m,{id:"JybQca",components:{0:e("small",{class:"ib"})}})}),e(Be,{hidden:d!=="loading"})]})]})]})]})}var Hn={exports:{}},Gh=Hn.exports,qs;function Kl(){return qs||(qs=1,(function(n){var i=(function(){var s=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",a={};function u(l,r){if(!a[l]){a[l]={};for(var h=0;h<l.length;h++)a[l][l.charAt(h)]=h}return a[l][r]}var d={compressToBase64:function(l){if(l==null)return"";var r=d._compress(l,6,function(h){return o.charAt(h)});switch(r.length%4){default:case 0:return r;case 1:return r+"===";case 2:return r+"==";case 3:return r+"="}},decompressFromBase64:function(l){return l==null?"":l==""?null:d._decompress(l.length,32,function(r){return u(o,l.charAt(r))})},compressToUTF16:function(l){return l==null?"":d._compress(l,15,function(r){return s(r+32)})+" "},decompressFromUTF16:function(l){return l==null?"":l==""?null:d._decompress(l.length,16384,function(r){return l.charCodeAt(r)-32})},compressToUint8Array:function(l){for(var r=d.compress(l),h=new Uint8Array(r.length*2),f=0,p=r.length;f<p;f++){var y=r.charCodeAt(f);h[f*2]=y>>>8,h[f*2+1]=y%256}return h},decompressFromUint8Array:function(l){if(l==null)return d.decompress(l);for(var r=new Array(l.length/2),h=0,f=r.length;h<f;h++)r[h]=l[h*2]*256+l[h*2+1];var p=[];return r.forEach(function(y){p.push(s(y))}),d.decompress(p.join(""))},compressToEncodedURIComponent:function(l){return l==null?"":d._compress(l,6,function(r){return c.charAt(r)})},decompressFromEncodedURIComponent:function(l){return l==null?"":l==""?null:(l=l.replace(/ /g,"+"),d._decompress(l.length,32,function(r){return u(c,l.charAt(r))}))},compress:function(l){return d._compress(l,16,function(r){return s(r)})},_compress:function(l,r,h){if(l==null)return"";var f,p,y={},g={},w="",k="",b="",v=2,_=3,S=2,x=[],C=0,A=0,L;for(L=0;L<l.length;L+=1)if(w=l.charAt(L),Object.prototype.hasOwnProperty.call(y,w)||(y[w]=_++,g[w]=!0),k=b+w,Object.prototype.hasOwnProperty.call(y,k))b=k;else{if(Object.prototype.hasOwnProperty.call(g,b)){if(b.charCodeAt(0)<256){for(f=0;f<S;f++)C=C<<1,A==r-1?(A=0,x.push(h(C)),C=0):A++;for(p=b.charCodeAt(0),f=0;f<8;f++)C=C<<1|p&1,A==r-1?(A=0,x.push(h(C)),C=0):A++,p=p>>1}else{for(p=1,f=0;f<S;f++)C=C<<1|p,A==r-1?(A=0,x.push(h(C)),C=0):A++,p=0;for(p=b.charCodeAt(0),f=0;f<16;f++)C=C<<1|p&1,A==r-1?(A=0,x.push(h(C)),C=0):A++,p=p>>1}v--,v==0&&(v=Math.pow(2,S),S++),delete g[b]}else for(p=y[b],f=0;f<S;f++)C=C<<1|p&1,A==r-1?(A=0,x.push(h(C)),C=0):A++,p=p>>1;v--,v==0&&(v=Math.pow(2,S),S++),y[k]=_++,b=String(w)}if(b!==""){if(Object.prototype.hasOwnProperty.call(g,b)){if(b.charCodeAt(0)<256){for(f=0;f<S;f++)C=C<<1,A==r-1?(A=0,x.push(h(C)),C=0):A++;for(p=b.charCodeAt(0),f=0;f<8;f++)C=C<<1|p&1,A==r-1?(A=0,x.push(h(C)),C=0):A++,p=p>>1}else{for(p=1,f=0;f<S;f++)C=C<<1|p,A==r-1?(A=0,x.push(h(C)),C=0):A++,p=0;for(p=b.charCodeAt(0),f=0;f<16;f++)C=C<<1|p&1,A==r-1?(A=0,x.push(h(C)),C=0):A++,p=p>>1}v--,v==0&&(v=Math.pow(2,S),S++),delete g[b]}else for(p=y[b],f=0;f<S;f++)C=C<<1|p&1,A==r-1?(A=0,x.push(h(C)),C=0):A++,p=p>>1;v--,v==0&&(v=Math.pow(2,S),S++)}for(p=2,f=0;f<S;f++)C=C<<1|p&1,A==r-1?(A=0,x.push(h(C)),C=0):A++,p=p>>1;for(;;)if(C=C<<1,A==r-1){x.push(h(C));break}else A++;return x.join("")},decompress:function(l){return l==null?"":l==""?null:d._decompress(l.length,32768,function(r){return l.charCodeAt(r)})},_decompress:function(l,r,h){var f=[],p,y=4,g=4,w=3,k="",b=[],v,_,S,x,C,A,L,P={val:h(0),position:r,index:1};for(v=0;v<3;v+=1)f[v]=v;for(S=0,C=Math.pow(2,2),A=1;A!=C;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=r,P.val=h(P.index++)),S|=(x>0?1:0)*A,A<<=1;switch(p=S){case 0:for(S=0,C=Math.pow(2,8),A=1;A!=C;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=r,P.val=h(P.index++)),S|=(x>0?1:0)*A,A<<=1;L=s(S);break;case 1:for(S=0,C=Math.pow(2,16),A=1;A!=C;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=r,P.val=h(P.index++)),S|=(x>0?1:0)*A,A<<=1;L=s(S);break;case 2:return""}for(f[3]=L,_=L,b.push(L);;){if(P.index>l)return"";for(S=0,C=Math.pow(2,w),A=1;A!=C;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=r,P.val=h(P.index++)),S|=(x>0?1:0)*A,A<<=1;switch(L=S){case 0:for(S=0,C=Math.pow(2,8),A=1;A!=C;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=r,P.val=h(P.index++)),S|=(x>0?1:0)*A,A<<=1;f[g++]=s(S),L=g-1,y--;break;case 1:for(S=0,C=Math.pow(2,16),A=1;A!=C;)x=P.val&P.position,P.position>>=1,P.position==0&&(P.position=r,P.val=h(P.index++)),S|=(x>0?1:0)*A,A<<=1;f[g++]=s(S),L=g-1,y--;break;case 2:return b.join("")}if(y==0&&(y=Math.pow(2,w),w++),f[L])k=f[L];else if(L===g)k=_+_.charAt(0);else return null;b.push(k),f[g++]=_+k.charAt(0),y--,_=k,y==0&&(y=Math.pow(2,w),w++)}}};return d})();n!=null?n.exports=i:typeof angular<"u"&&angular!=null&&angular.module("LZString",[]).factory("LZString",function(){return i})})(Hn)),Hn.exports}var Fs=Kl();const Hl="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",jl="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",Vl="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",Yl=200,Wl=10;async function oi(){const{masto:n}=oe(),i=n.v1.followedTags.list({limit:Yl}).values(),s=[];let o=0;do{const{value:c,done:a}=await i.next();if(a||c?.length===0)break;s.push(...c),o++}while(o<Wl);return s.sort((c,a)=>c.name.localeCompare(a.name)),s.length&&setTimeout(()=>{ke.account.set("followedTags",{tags:s,updatedAt:Date.now()})},1),s}const Gl=1440*60*1e3;async function Zl(){try{const{tags:n,updatedAt:i}=ke.account.get("followedTags")||{};return n?.length?(Date.now()-i>Gl&&oi(),n):await oi()}catch{return[]}}const Us=document.createElement("div"),Xl=n=>{if(!n)return[];if(n.indexOf("#")===-1)return[];Us.innerHTML=n;const i=Us.querySelectorAll("a.hashtag");return i.length?Array.from(i).map(s=>s.innerText.trim().replace(/^[^#]*#+/,"")):[]};function jn({children:n}){if(typeof n=="string")return n;const[i,s]=R("");return G(()=>{Promise.resolve(n).then(s)},[n]),i}const Lt=9,Ql=["following","mentions","notifications","list","public","trending","search","hashtag","bookmarks","favourites"],oc={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"}},Vn={list:[{text:{id:"DUMt1y"},name:"id",notRequired:!0}],public:[{text:{id:"OgyJSr"},name:"local",type:"checkbox"},{text:{id:"sGH11W"},name:"instance",type:"text",placeholder:{id:"7defFj"},notRequired:!0}],trending:[{text:{id:"sGH11W"},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:"sGH11W"},name:"instance",type:"text",placeholder:{id:"7defFj"},notRequired:!0}]},Jl=Ct(async({id:n})=>{const i=await oe().masto.v1.accounts.$select(n).fetch();return i.username||i.acct||i.displayName}),ci={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?$r(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||oe().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||oe().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:Jl,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||oe().instance,path:({hashtag:n,instance:i,media:s})=>`${i?`/${i}`:""}/t/${n.split(/\s+/).join("+")}${s?"?media=1":""}`,icon:"hashtag"}};function ed({onClose:n}){const{_:i}=ne(),s=We(E),{shortcuts:o}=s,[c,a]=R(!1),[u,d]=R(!1),[l]=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(I,{icon:"x",alt:he._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:[e(I,{icon:"shortcut"})," ",e(m,{id:"CTqTgr"})," ",e("sup",{style:{fontSize:12,opacity:.5,textTransform:"uppercase"},children:e(m,{id:"A1As8l"})})]})}),e("main",{children:[e("p",{children:e(m,{id:"CIHAsy"})}),e("div",{class:"shortcuts-view-mode",children:[{value:"float-button",label:he._({id:"qwdOim"}),imgURL:Hl},{value:"tab-menu-bar",label:he._({id:"UxBoCm"}),imgURL:Vl},{value:"multi-column",label:he._({id:"uvDfdW"}),imgURL:jl}].map(({value:r,label:h,imgURL:f})=>{const p=s.settings.shortcutsViewMode===r||r==="float-button"&&!s.settings.shortcutsViewMode;return e("label",{class:p?"checked":"",children:[e("input",{type:"radio",name:"shortcuts-view-mode",value:r,checked:p,onChange:y=>{E.settings.shortcutsViewMode=y.target.value}})," ",e("img",{src:f,alt:"",width:"80",height:"58"})," ",e("span",{children:h})]},r)})}),o.length>0?e(N,{children:[e("ol",{class:"shortcuts-list",ref:l,children:o.filter(Boolean).map((r,h)=>{const f=Object.values(r).join("-"),{type:p}=r;if(!ci[p])return null;let{icon:y,title:g,subtitle:w,excludeViewMode:k}=ci[p];typeof g=="function"?g=g(r,h):g=i(g),typeof w=="function"?w=w(r,h):w=i(w),typeof y=="function"&&(y=y(r,h)),typeof k=="function"&&(k=k(r,h));const b=k?.includes(s.settings.shortcutsViewMode);return e("li",{children:[e(I,{icon:y}),e("span",{class:"shortcut-text",children:[e(jn,{children:g}),w&&e(N,{children:[" ",e("small",{class:"ib insignificant",children:w})]}),b&&e("span",{class:"tag",children:e(m,{id:"5KJFnN"})})]}),e("span",{class:"shortcut-actions",children:[e("button",{type:"button",class:"plain small",disabled:h===0,onClick:()=>{const v=Array.from(E.shortcuts);if(h>0){const _=E.shortcuts[h-1];v[h-1]=r,v[h]=_,E.shortcuts=v}},children:e(I,{icon:"arrow-up",alt:he._({id:"QyioBP"})})}),e("button",{type:"button",class:"plain small",disabled:h===o.length-1,onClick:()=>{const v=Array.from(E.shortcuts);if(h<E.shortcuts.length-1){const _=E.shortcuts[h+1];v[h+1]=r,v[h]=_,E.shortcuts=v}},children:e(I,{icon:"arrow-down",alt:he._({id:"3Ib6FN"})})}),e("button",{type:"button",class:"plain small",onClick:()=>{a({shortcut:r,shortcutIndex:h})},children:e(I,{icon:"pencil",alt:he._({id:"ePK91l"})})})]})]},f)})}),o.length===1&&s.settings.shortcutsViewMode!=="float-button"&&e("div",{class:"ui-state insignificant",children:[e(I,{icon:"info"})," ",e("small",{children:e(m,{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(m,{id:"Fq4zw3",components:{0:e("br",{}),1:e("a",{href:"#",onClick:r=>{r.preventDefault(),E.shortcuts=[{type:"following"},{type:"notifications"}]}})}})})]}),e("p",{class:"insignificant",children:o.length>=Lt&&(s.settings.shortcutsViewMode==="multi-column"?he._({id:"RqXfsz",values:{SHORTCUTS_LIMIT:Lt}}):he._({id:"EVRO/o",values:{SHORTCUTS_LIMIT:Lt}}))}),e("p",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[e("button",{type:"button",class:"light",onClick:()=>d(!0),children:e(m,{id:"bgVLbt"})}),e("button",{type:"button",disabled:o.length>=Lt,onClick:()=>a(!0),children:[e(I,{icon:"plus"})," ",e("span",{children:s.settings.shortcutsViewMode==="multi-column"?he._({id:"Vh3ADI"}):he._({id:"9tmn6W"})})]})]})]}),c&&e(Fe,{onClick:r=>{r.target===r.currentTarget&&a(!1)},children:e(td,{shortcut:c.shortcut,shortcutIndex:c.shortcutIndex,onSubmit:({result:r,mode:h})=>{h==="edit"?E.shortcuts[c.shortcutIndex]=r:E.shortcuts.push(r)},onClose:()=>a(!1)})}),u&&e(Fe,{onClick:r=>{r.target===r.currentTarget&&d(!1)},children:e(nd,{shortcuts:o,onClose:()=>d(!1)})})]})}const Ks={list:{id:"1qL+L+"},search:{id:"dmTmkQ"},hashtag:{id:"E8laYz"}};function td({onSubmit:n,disabled:i,shortcut:s,shortcutIndex:o,onClose:c}){const{_:a}=ne(),u=!!s,[d,l]=R(s?.type||null),[r,h]=R("default"),[f,p]=R([]),[y,g]=R([]);G(()=>{(async()=>{if(d==="list")try{h("loading");const k=await An();p(k),h("default")}catch{h("error")}})(),(async()=>{if(d==="hashtag")try{const k=await oi();g(k)}catch{}})()},[d]);const w=K();return G(()=>{if(u&&d&&Vn[d]){const k=w.current;Vn[d].forEach(({name:b,type:v})=>{const _=k.querySelector(`[name="${b}"]`);_&&s[b]&&(v==="checkbox"?_.checked=s[b]==="on":_.value=s[b])})}},[u,d]),e("div",{id:"shortcut-settings-form",class:"sheet",children:[!!c&&e("button",{type:"button",class:"sheet-close",onClick:c,children:e(I,{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:w,onSubmit:k=>{k.preventDefault();const b=new FormData(k.target),v={};b.forEach((_,S)=>{v[S]=_?.trim(),S==="instance"&&(v[S]=v[S].replace(/^https?:\/\//,"").replace(/\/+$/,""),v[S]=v[S].replace(/^@?[^@]+@/,""))}),v.type&&(n({result:v,mode:u?"edit":"add"}),k.target.reset(),l(null),c?.())},children:[e("p",{children:e("label",{children:[e("span",{children:e(m,{id:"cklVjM"})}),e("select",{required:!0,disabled:i,onChange:k=>{l(k.target.value)},defaultValue:u?s.type:void 0,name:"type",dir:"auto",children:[e("option",{}),Ql.map(k=>e("option",{value:k,children:a(oc[k])}))]})]})}),Vn[d]?.map?.(({text:k,name:b,type:v,placeholder:_,pattern:S,notRequired:x})=>d==="list"?e("p",{children:e("label",{children:[e("span",{children:e(m,{id:"2BBAbc"})}),e("select",{name:"id",required:!x,disabled:i||r==="loading",defaultValue:u?s.id:void 0,dir:"auto",children:[e("option",{value:""}),f.map(C=>e("option",{value:C.id,children:C.title}))]})]})}):e("p",{children:e("label",{children:[e("span",{children:a(k)})," ",e("input",{type:v,switch:v==="checkbox"||void 0,name:b,placeholder:a(_),required:v==="text"&&!x,disabled:i,list:d==="hashtag"?"followed-hashtags-datalist":null,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:S,dir:"auto"}),d==="hashtag"&&y.length>0&&e("datalist",{id:"followed-hashtags-datalist",children:y.map(C=>e("option",{value:C.name}))})]})})),!!Ks[d]&&e("p",{class:"form-note insignificant",children:[e(I,{icon:"info"}),a(Ks[d])]}),e("footer",{children:[e("button",{type:"submit",class:"block",disabled:i||r==="loading",children:u?he._({id:"tfDRzk"}):he._({id:"m16xKo"})}),u&&e("button",{type:"button",class:"light danger",onClick:()=>{E.shortcuts.splice(o,1),c?.()},children:e(m,{id:"t/YqKh"})})]})]})})]})}function nd({shortcuts:n,onClose:i}){const{_:s}=ne(),{masto:o}=oe(),c=Ce(()=>!n||!n.filter(Boolean).length?"":Fs.compressToEncodedURIComponent(JSON.stringify(n.filter(Boolean))),[n]),[a,u]=R(""),[d,l]=R("default"),r=Ce(()=>{if(!a)return l("default"),null;try{const p=JSON.parse(Fs.decompressFromEncodedURIComponent(a));if(!Array.isArray(p))throw new Error("Not an array");return l("default"),p}catch{try{const y=JSON.parse(a);if(!Array.isArray(y))throw new Error("Not an array");return l("default"),y}catch{return l("error"),null}}},[a]),h=E.shortcuts.length>0,f=K();return e("div",{id:"import-export-container",class:"sheet",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(I,{icon:"x",alt:he._({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(m,{id:"OOa7/5",components:{0:e("small",{class:"ib insignificant"})}})})}),e("main",{tabindex:"-1",children:[e("section",{children:[e("h3",{children:[e(I,{icon:"arrow-down-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(m,{id:"l3s5ri"})})]}),e("p",{class:"field-button",children:[e("input",{ref:f,type:"text",name:"import",placeholder:he._({id:"tBmklN"}),class:"block",onInput:p=>{u(p.target.value)},dir:"auto"}),sc&&e("button",{type:"button",class:"plain2 small",onClick:()=>{E.showQrScannerModal={onClose:({text:p}={})=>{p&&(u(p),f.current.value=p,f.current.dispatchEvent(new Event("input")))}}},children:e(I,{icon:"scan",alt:he._({id:"XDwkfO"})})}),E.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2 small",disabled:d==="cloud-downloading",onClick:async()=>{l("cloud-downloading");const p=kt();re(he._({id:"jFdM/T"}));try{const g=(await o.v1.accounts.relationships.fetch({id:[p]}))[0];if(g){const{note:w=""}=g;if(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/.test(w)){const k=w.match(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/)[1],{v:b,dt:v,data:_}=JSON.parse(k);f.current.value=_,f.current.dispatchEvent(new Event("input"))}}l("default")}catch{l("error"),re(he._({id:"gCDfX+"}))}},title:he._({id:"5I1YZO"}),children:[e(I,{icon:"cloud"}),e(I,{icon:"arrow-down",size:"s"})]})]}),!!r&&Array.isArray(r)&&e(N,{children:[e("p",{children:[e("b",{children:r.length})," shortcut",r.length>1?"s":""," ",e("small",{class:"insignificant",children:["(",a.length," characters)"]})]}),e("ol",{class:"import-settings-list",children:r.map(p=>e("li",{children:[e("span",{style:{opacity:n.some(y=>Object.keys(y).every(g=>{if(!(g in p))return!0;const w=p[g];return w===""||w===null||w===void 0?!0:y[g]===w}))?1:0},children:"*"}),e("span",{children:[s(oc[p.type]),p.type==="list"&&!!p.id&&" ⚠️"," ",Vn[p.type]?.map?.(({text:y,name:g,type:w})=>p[g]?e(N,{children:[e("span",{class:"tag collapsed insignificant",children:[s(y),":"," ",w==="checkbox"?p[g]==="on"?"✅":"❌":p[g]]})," "]}):null)]})]}))}),e("p",{children:[e("small",{children:e(m,{id:"o6sElH"})}),e("br",{}),e("small",{children:["⚠️"," ",e(m,{id:"N4z4P/"})]})]})]}),d==="error"&&e("p",{class:"error",children:e("small",{children:["⚠️ ",e(m,{id:"ZhsPEb"})]})}),e("p",{children:[h&&e(N,{children:[e(vt,{confirmLabel:he._({id:"6MzUUU"}),menuFooter:e("div",{class:"footer",children:e(m,{id:"nl8sCE"})}),onClick:()=>{const p=r.filter(w=>!E.shortcuts.some(k=>Object.keys(k).every(b=>k[b]===w[b])));if(!p.length){re(he._({id:"o6L30P"}));return}let y=[...E.shortcuts,...p];const g=y.length>Lt;g&&(y=y.slice(0,Lt)),E.shortcuts=y,re(g?he._({id:"SBmqmC",values:{SHORTCUTS_LIMIT:Lt}}):he._({id:"QO9uTx"})),i?.()},children:e("button",{type:"button",class:"plain2",disabled:!r,children:e(m,{id:"c89gCv"})})})," "]}),e(vt,{confirmLabel:h?he._({id:"6ZjzWP"}):he._({id:"DWumLi"}),menuItemClassName:h?"danger":void 0,onClick:()=>{E.shortcuts=r,re(he._({id:"QO9uTx"})),i?.()},children:e("button",{type:"button",class:"plain2",disabled:!r,children:h?he._({id:"uIp8WL"}):he._({id:"Sjnlwj"})})})]})]}),e("section",{children:[e("h3",{children:[e(I,{icon:"arrow-up-circle",size:"l",class:"insignificant"})," ",e("span",{children:e(m,{id:"GS+Mus"})})]}),e("p",{class:"field-button",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),re(he._({id:"cWtH+v"}))}catch{re(he._({id:"yUWyHa"}))}}},dir:"auto"}),e("button",{type:"button",class:"plain2 small",disabled:!c,onClick:()=>{E.showQrCodeModal={text:c}},children:e(I,{icon:"qrcode",alt:he._({id:"gCX4Z9"})})}),E.settings.shortcutSettingsCloudImportExport&&e("button",{type:"button",class:"plain2 small",disabled:d==="cloud-uploading",onClick:async()=>{l("cloud-uploading");const p=kt();try{const g=(await o.v1.accounts.relationships.fetch({id:[p]}))[0];if(g){const{note:w=""}=g;let k="";const b=JSON.stringify({v:"1",dt:Date.now(),data:c});/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/.test(w)?k=w.replace(/<phanpy-shortcuts-settings>(.*)<\/phanpy-shortcuts-settings>/,`<phanpy-shortcuts-settings>${b}</phanpy-shortcuts-settings>`):k=`${w}
<phanpy-shortcuts-settings>${b}</phanpy-shortcuts-settings>`,re(he._({id:"fVybCv"})),await o.v1.accounts.$select(p).note.create({comment:k}),l("default"),re(he._({id:"5w02SH"}))}}catch{l("error"),re(he._({id:"aVsTYo"}))}},title:he._({id:"oivBcO"}),children:[e(I,{icon:"cloud"}),e(I,{icon:"arrow-up",size:"s"})]})]}),e("p",{children:[e("button",{type:"button",class:"plain2",disabled:!c,onClick:()=>{try{navigator.clipboard.writeText(c),re(he._({id:"+Kq2vY"}))}catch{re(he._({id:"tFvxZF"}))}},children:[e(I,{icon:"clipboard"})," ",e("span",{children:e(m,{id:"he3ygx"})})]})," ",navigator?.share&&navigator?.canShare?.({text:c})&&e("button",{type:"button",class:"plain2",disabled:!c,onClick:()=>{try{navigator.share({text:c})}catch{alert(he._({id:"TtG3Uh"}))}},children:[e(I,{icon:"share"})," ",e("span",{children:e(m,{id:"Z8lGw6"})})]})," ",c.length>0&&e("small",{class:"insignificant ib",children:e(m,{id:"IPXOXm",values:{0:c.length}})})]}),!!c&&e("details",{children:[e("summary",{class:"insignificant",children:e("small",{children:e(m,{id:"e5E+WH"})})}),e("textarea",{style:{width:"100%"},rows:10,readOnly:!0,children:JSON.stringify(n.filter(Boolean),null,2)})]})]}),E.settings.shortcutSettingsCloudImportExport&&e("footer",{children:e("p",{children:[e(I,{icon:"cloud"})," ",e(m,{id:"Cxr3Kn"})]})})]})]})}po(E,n=>{for(const[i,s,o,c]of n)/^show/i.test(s)&&!o&&Mi()});function id(){const{_:n}=ne(),i=We(E),s=Hi(),o=Qt();return G(()=>{setTimeout(zc,1e3)},[]),e(N,{children:[!!i.showCompose&&e(Fe,{class:`solid ${i.composerState.minimized?"min":""}`,minimized:!!i.composerState.minimized,children:e(Bc,{replyToStatus:typeof i.showCompose!="boolean"?i.showCompose.replyToStatus:window.__COMPOSE__?.replyToStatus||null,replyMode:E.showCompose?.replyMode||window.__COMPOSE__?.replyMode||"all",editStatus:E.showCompose?.editStatus||window.__COMPOSE__?.editStatus||null,draftStatus:E.showCompose?.draftStatus||window.__COMPOSE__?.draftStatus||null,quoteStatus:E.showCompose?.quoteStatus||window.__COMPOSE__?.quoteStatus||null,onClose:c=>{const{newStatus:a,instance:u,type:d,scheduledAt:l}=c||{};E.showCompose=!1,window.__COMPOSE__=null,a&&(E.reloadStatusPage++,l&&E.reloadScheduledPosts++,re({text:{post:n(l?{id:"IrX0sj"}:{id:"aTyHBW"}),reply:n(l?{id:"+38pse"}:{id:"lZdBKl"}),edit:n({id:"a5BN7l"})}[d||"post"],delay:1e3,duration:1e4,onClick:r=>{r.hideToast(),E.prevLocation=o,s(l?"/sp":u?`/${u}/s/${a.id}`:`/s/${a.id}`)}}))}})}),!!i.showSettings&&e(Fe,{onClose:()=>{E.showSettings=!1},children:e(wr,{onClose:()=>{E.showSettings=!1}})}),!!i.showAccounts&&e(Fe,{onClose:()=>{E.showAccounts=!1},children:e(or,{onClose:()=>{E.showAccounts=!1}})}),!!i.showAccount&&e(Fe,{onClose:()=>{E.showAccount=!1},children:e(Gr,{account:i.showAccount?.account||i.showAccount,instance:i.showAccount?.instance,onClose:({destination:c}={})=>{E.showAccount=!1}})}),!!i.showOpenLink&&e(Fe,{onClose:()=>{E.showOpenLink=!1},children:e(wl,{url:i.showOpenLink.url,linkText:i.showOpenLink.linkText,onClose:()=>{E.showOpenLink=!1}})}),!!i.showDrafts&&e(Fe,{onClose:()=>{E.showDrafts=!1},children:e(Zr,{onClose:()=>E.showDrafts=!1})}),!!i.showMediaModal&&e(Fe,{onClick:c=>{(c.target===c.currentTarget||c.target.classList.contains("media"))&&(E.showMediaModal=!1)},children:e(Go,{mediaAttachments:i.showMediaModal.mediaAttachments,instance:i.showMediaModal.instance,index:i.showMediaModal.mediaIndex,statusID:i.showMediaModal.statusID,onClose:()=>{E.showMediaModal=!1}})}),!!i.showShortcutsSettings&&e(Fe,{onClose:()=>{E.showShortcutsSettings=!1},children:e(ed,{onClose:()=>E.showShortcutsSettings=!1})}),!!i.showGenericAccounts&&e(Fe,{onClose:()=>{E.showGenericAccounts=!1},children:e(Jr,{instance:i.showGenericAccounts.instance,excludeRelationshipAttrs:i.showGenericAccounts.excludeRelationshipAttrs,postID:i.showGenericAccounts.postID,onClose:()=>E.showGenericAccounts=!1,blankCopy:i.showGenericAccounts.blankCopy})}),!!i.showMediaAlt&&e(Fe,{onClose:c=>{E.showMediaAlt=!1},children:e(il,{alt:i.showMediaAlt.alt||i.showMediaAlt,lang:i.showMediaAlt?.lang,onClose:()=>{E.showMediaAlt=!1}})}),!!i.showEmbedModal&&e(Fe,{class:"solid",onClose:()=>{E.showEmbedModal=!1},children:e(Qr,{html:i.showEmbedModal.html,url:i.showEmbedModal.url,width:i.showEmbedModal.width,height:i.showEmbedModal.height,onClose:()=>{E.showEmbedModal=!1}})}),!!i.showReportModal&&e(Fe,{onClose:()=>{E.showReportModal=!1},children:e(Ul,{account:i.showReportModal.account,post:i.showReportModal.post,onClose:()=>{E.showReportModal=!1}})}),!!i.showQrCodeModal&&e(Fe,{class:"solid",onClose:()=>{E.showQrCodeModal=!1},children:e(Dl,{text:i.showQrCodeModal.text,arena:i.showQrCodeModal.arena,backgroundMask:i.showQrCodeModal.backgroundMask,caption:i.showQrCodeModal.caption,onClose:()=>{E.showQrCodeModal=!1},onScannerClick:i.showQrCodeModal.onScannerClick})}),!!i.showQrScannerModal&&e(Fe,{class:"solid",onClose:()=>{E.showQrScannerModal=!1},children:e(zl,{checkValidity:i.showQrScannerModal.checkValidity,actionableText:i.showQrScannerModal.actionableText,onClose:(...c)=>{i.showQrScannerModal.onClose&&i.showQrScannerModal.onClose(...c),E.showQrScannerModal=!1}})}),!!i.showImportExportAccounts&&e(Fe,{onClose:()=>{E.showImportExportAccounts=!1},children:e(tl,{onClose:()=>{E.showImportExportAccounts=!1},exportDisabled:typeof i.showImportExportAccounts=="object"?i.showImportExportAccounts.exportDisabled:!1})})]})}const pn=(n,i)=>{Ke(`g>${n}`,s=>{document.querySelector("#modal-container > *")||s.metaKey||s.ctrlKey||s.altKey||i(s)},{useKey:!0})},sd=lt(function(){const i=Hi();return pn("h",()=>i("/")),pn("n",()=>i("/notifications")),pn("s",()=>{E.showSettings=!0}),pn("p",()=>{const s=wn();if(s){const{instanceURL:o}=s,{id:c}=s.info;i(`/${o}/a/${c}`)}}),pn("b",()=>i("/b")),null});function zi({accountID:n,onChange:i}){const{_:s}=ne(),{masto:o}=oe(),[c,a]=R("default"),[u,d]=R(null),[l,r]=R(null),h=l!==null;return e("p",{class:"follow-request-buttons",children:[e("button",{type:"button",disabled:c==="loading"||h,onClick:()=>{a("loading"),d("accept"),(async()=>{try{const f=await o.v1.followRequests.$select(n).authorize();if(!f?.followedBy)throw new Error("Follow request not accepted");r(f),i()}catch{}a("default")})()},children:e(m,{id:"g3UF2V"})})," ",e("button",{type:"button",disabled:c==="loading"||h,class:"light danger",onClick:()=>{a("loading"),d("reject"),(async()=>{try{const f=await o.v1.followRequests.$select(n).reject();if(f?.followedBy)throw new Error("Follow request not rejected");r(f),i()}catch{a("default")}})()},children:e(m,{id:"1t/NnN"})}),e("span",{class:"follow-request-states",children:h&&u?u==="accept"?e(I,{icon:"check-circle",alt:s({id:"bzMKg7"}),class:"follow-accepted"}):e(I,{icon:"x-circle",alt:s({id:"ekCRTP"}),class:"follow-rejected"}):e(Be,{hidden:c!=="loading"})})]})}const Hs={mention:"comment",status:"notification",reblog:"rocket",follow:"follow",follow_request:"follow-add",favourite:"heart",poll:"poll",update:"pencil","admin.sign_up":"account-edit","admin.report":"account-warning",severed_relationships:"heart-break",moderation_warning:"alert",emoji_reaction:"emoji2","pleroma:emoji_reaction":"emoji2",annual_report:"celebrate",quote:"quote",quoted_update:"pencil"};function js({account:n,emoji:i,emoji_url:s}){let o,c;typeof s=="string"?o=s:(o=s?.url,c=s?.staticUrl);const a=o?e(ua,{url:o,staticUrl:c,alt:i}):i;return e(m,{id:"i5uN6K",values:{account:n,emojiObject:a}})}const Ai={status:({account:n})=>e(m,{id:"idiIxW",values:{account:n}}),reblog:({count:n,account:i,postsCount:s,postType:o,components:{Subject:c}})=>e(m,{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(m,{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(m,{id:"eh6NHW",values:{account:n}}),favourite:({account:n,count:i,postsCount:s,postType:o,components:{Subject:c}})=>e(m,{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:({account:n})=>n?e(m,{id:"W+eFn3",values:{account:n}}):he._({id:"uzt17m"}),"favourite+reblog":({count:n,account:i,postsCount:s,postType:o,components:{Subject:c}})=>e(m,{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})}}),quoted_update:({account:n})=>e(m,{id:"pkB7ti",values:{account:n}}),"admin.sign_up":({account:n,count:i,components:{Subject:s}})=>e(m,{id:"eDkKRi",values:{0:Xe(i),count:i,account:n},components:{0:e(s,{clickable:i>1}),1:e("span",{title:i})}}),"admin.report":({account:n,targetAccount:i})=>e(m,{id:"eNfCmq",values:{account:n,targetAccount:i}}),severed_relationships:({name:n})=>e(m,{id:"Xl9v6+",values:{name:n},components:{0:e("i",{})}}),moderation_warning:()=>e("b",{children:e(m,{id:"YqffEv"})}),emoji_reaction:js,"pleroma:emoji_reaction":js,annual_report:({year:n})=>e(m,{id:"INLTzH",values:{year:n}})},od={account_suspension:({from:n,targetName:i})=>e(m,{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(m,{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(m,{id:"RQKWUa",values:{targetName:n,followersCount:i,followingCount:s},components:{0:e("i",{})}})},cd={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"}},Ti=30;function ad({notification:n,instance:i,isStatic:s,disableContextMenu:o}){const{_:c}=ne(),{masto:a}=oe(),{id:u,status:d,account:l,report:r,event:h,moderation_warning:f,annualReport:p,_ids:y,_accounts:g,_statuses:w,_groupKeys:k,sampleAccounts:b,notificationsCount:v,groupKey:_,_notificationsCount:S,_sampleAccountsCount:x}=n;let{type:C}=n;if((C==="mention"||C==="quote")&&!d)return null;const A=d?.reblog||d,L=A?.id,P=kt(),q=P===l?.id,z=d?.poll?.voted,H=!!d?.inReplyToAccountId&&d?.inReplyToAccountId!==P&&d?.account?.id===P;let ee=0,te=0;if(C==="favourite+reblog"){if(g)for(const U of g)U._types?.includes("favourite")&&ee++,U._types?.includes("reblog")&&te++;!te&&ee&&(C="favourite"),!ee&&te&&(C="reblog")}let Z;C==="poll"?Z=Ai[q?"poll-self":z?"poll-voted":"poll"]:Ai[C]?Z=Ai[C]:Z=he._({id:"ODqZt1",values:{type:C}});const X=({clickable:U,...Y})=>U?e("b",{tabIndex:"0",onClick:ve,...Y}):e("b",{...Y}),j=v>0&&v>b?.length,W=j?"remote":"local";if(typeof Z=="function"){const U=(C==="favourite"||C==="reblog"||C==="admin.sign_up")&&v?j?v:b?.length:g?.length||b?.length||(l?1:0),Y=w?.length||(d?1:0);if(C==="admin.report"){const fe=r?.targetAccount;fe&&(Z=Z({account:e(mt,{account:l,showAvatar:!0}),targetAccount:e(mt,{account:fe,showAvatar:!0})}))}else if(C==="severed_relationships"){const fe=h?.targetName;fe&&(Z=Z({name:fe}))}else if((C==="emoji_reaction"||C==="pleroma:emoji_reaction")&&n.emoji){const fe=n.emoji_url||d?.emojis?.find?.(be=>be?.shortcode===n.emoji.replace(/^:/,"").replace(/:$/,""));Z=Z({account:e(mt,{account:l,showAvatar:!0}),emoji:n.emoji,emojiURL:fe})}else C==="annual_report"?Z=Z({...n.annualReport}):Z=Z({account:l?e(mt,{account:l,showAvatar:!0}):b?.[0]&&e(mt,{account:b[0],showAvatar:!0}),count:U,postsCount:Y,postType:H?"reply":"post",components:{Subject:X}})}const $=n.createdAt&&new Date(n.createdAt).toLocaleString(),J={"favourite+reblog":he._({id:"+XOeb+"}),favourite:he._({id:"LQFF6J"}),reblog:he._({id:"phQpSa"}),follow:he._({id:"Ih01jh"})}[C]||he._({id:"bPwFdf"}),V=(C==="favourite+reblog"||C==="favourite"||C==="reblog"||C==="admin.sign_up")&&W==="remote",ve=()=>{V?E.showGenericAccounts={heading:J,accounts:g,fetchAccounts:async()=>{const U=await Promise.allSettled(k.map(async fe=>{const be=a.v2.notifications.$select(fe).accounts.list().values();return[fe,(await be.next()).value]})),Y=[];for(const fe of U){const[be,Ie]=fe.value,ze=/^favourite/.test(be)?"favourite":/^reblog/.test(be)?"reblog":null;for(const _e of Ie){const xe=Y.find(Ae=>Ae.id===_e.id);xe&&ze?xe._types.push(ze):(ze&&(_e._types=[ze]),Y.push(_e))}}return{done:!0,value:Y}},showReactions:C==="favourite+reblog",postID:ht(L,i)}:E.showGenericAccounts={heading:J,accounts:g,showReactions:C==="favourite+reblog",excludeRelationshipAttrs:C==="follow"?["followedBy"]:[],postID:ht(L,i)}};if(d?.filtered){const U=d?.account?.id===P,Y=cn(d.filtered,"notifications");if(!q&&!U&&Y?.action==="hide")return null}const we=U=>{U.shiftKey};return e("div",{class:`notification notification-${C}`,"data-notification-id":y||u,"data-group-key":k?.join(" ")||_,tabIndex:"0",onMouseEnter:we,children:[e("div",{class:`notification-type notification-${C}`,title:$,children:C==="favourite+reblog"?e(N,{children:[e(I,{icon:"rocket",size:"xl",alt:C,class:"reblog-icon"}),e(I,{icon:"heart",size:"xl",alt:C,class:"favourite-icon"})]}):C==="mention+quote"?e(N,{children:[e(I,{icon:"comment",size:"xl",alt:C,class:"mention-icon"}),e(I,{icon:"quote",size:"xl",alt:C,class:"quote-icon"})]}):e(I,{icon:Hs[C]||"notification",size:"xl",alt:C})}),e("div",{class:"notification-content",children:[C!=="mention"&&C!=="quote"&&C!=="mention+quote"&&e(N,{children:[e("p",{children:Z}),C==="follow_request"&&e(zi,{accountID:l.id}),C==="severed_relationships"&&e("div",{children:[od[h.type]({from:i,...h}),e("br",{}),e("a",{href:`https://${i}/severed_relationships`,target:"_blank",rel:"noopener",children:e(m,{id:"YL6Y8P",components:{0:e(I,{icon:"external",size:"s"})}})}),"."]}),C==="moderation_warning"&&!!f&&e("div",{children:[c(cd[f.action]()),e("br",{}),e("a",{href:`/disputes/strikes/${f.id}`,target:"_blank",rel:"noopener",children:e(m,{id:"YL6Y8P",components:{0:e(I,{icon:"external",size:"s"})}})})]}),C==="annual_report"&&e("div",{children:e(ye,{to:`/annual_report/${p?.year}`,children:e(m,{id:"5PGPvG"})})})]}),g?.length>1&&e("p",{class:"avatars-stack",children:[g.slice(0,Ti).map(U=>e(N,{children:[e("a",{href:U.url,rel:"noopener",class:"account-avatar-stack",onClick:Y=>{Y.preventDefault(),E.showAccount=U},children:[e(ut,{url:U.avatarStatic,size:g.length<=10?"xxl":g.length<20?"xl":"l",alt:`${U.displayName} @${U.acct}`,squircle:U?.bot},U.id),C==="favourite+reblog"&&e("div",{class:"account-sub-icons",children:U._types.map(Y=>e(I,{icon:Hs[Y],size:"s",class:`${Y}-icon`}))})]},U.id)," "]},U.id)),V?e("button",{type:"button",class:"small plain","data-group-keys":k?.join(" "),onClick:ve,children:["+",(C==="favourite"||C==="reblog"||C==="admin.sign_up")&&v-g.length,e(I,{icon:"chevron-down"})]}):e("button",{type:"button",class:"small plain",onClick:ve,children:[g.length>Ti&&`+${g.length-Ti}`,e(I,{icon:"chevron-down"})]})]}),!g?.length&&b?.length>1&&e("p",{class:"avatars-stack",children:[b.map(U=>e(N,{children:[e("a",{href:U.url,rel:"noopener",class:"account-avatar-stack",onClick:Y=>{Y.preventDefault(),E.showAccount=U},children:e(ut,{url:U.avatarStatic,size:"xxl",alt:`${U.displayName} @${U.acct}`,squircle:U?.bot},U.id)},U.id)," "]},U.id)),v>b.length&&d?.id&&e(ye,{to:i?`/${i}/s/${d.id}`:`/s/${d.id}`,class:"button small plain centered",children:["+",v-b.length,e(I,{icon:"chevron-right"})]})]}),w?.length>1&&e("ul",{class:"notification-group-statuses",children:w.map(U=>e("li",{children:e(Vs,{class:`status-link status-type-${C}`,to:i?`/${i}/s/${U.id}`:`/s/${U.id}`,children:e(je,{status:U,size:"s",previewMode:!0,allowContextMenu:!0,allowFilters:!0})})},U.id))}),d&&(!w?.length||w?.length<=1)&&e(Vs,{class:`status-link status-type-${C}`,to:i?`/${i}/s/${L}`:`/s/${L}`,onContextMenu:o?void 0:U=>{const Y=U.target.querySelector(".status");if(Y){if(U.metaKey)return;U.preventDefault(),Y.dispatchEvent(new MouseEvent("contextmenu",{clientX:U.clientX,clientY:U.clientY}))}},children:s?e(je,{status:A,size:"s",readOnly:!0,allowContextMenu:!0,allowFilters:!0}):e(je,{statusID:L,size:"s",readOnly:!0,allowContextMenu:!0,allowFilters:!0})})]})]})}function Vs(n){const{_:i}=ne(),s=ha();return e(ye,{...n,"data-read-more":i({id:"8fZueG"}),ref:s})}const In=lt(ad,(n,i)=>n.notification?.id===i.notification?.id);"serviceWorker"in navigator&&navigator.serviceWorker.addEventListener("message",n=>{const{type:i,id:s,accessToken:o}=n?.data||{};i==="notification"&&(E.routeNotification={id:s,accessToken:o})});const rd=lt(function(){const{_:i}=ne();if(!("serviceWorker"in navigator))return null;const s=We(E),{routeNotification:o}=s,{id:c,accessToken:a}=o||{},[u,d]=R(!1);St(()=>{if(!c||!a)return;const{instance:r}=oe(),{masto:h,instance:f}=oe({accessToken:a}),p=r===f,y=a?qc(a):wn();(async()=>{const g=await h.v1.notifications.$select(c).fetch();if(g&&y){const w=y.instanceURL,{type:k,status:b,account:v}=g,_=!!document.querySelector("#modal-container > *"),S=k==="follow"&&!!v?.id,x=!!v?.id,C=!!b?.id;S&&p?E.showAccount={account:v,instance:w}:_||!p||x&&C?d({id:c,account:y,notification:g,sameInstance:p}):C?location.hash=`/${r}/s/${b.id}`:S?location.hash=`/${r}/a/${v.id}`:location.hash="/notifications"}})()},[c,a]),St(()=>{navigator?.clearAppBadge&&navigator.clearAppBadge()},[]),an(r=>{r&&navigator?.clearAppBadge&&navigator.clearAppBadge()});const l=()=>{d(!1),E.routeNotification=null,/\/notifications\?id=/i.test(location.hash)&&(location.hash="/notifications")};if(u){const{id:r,account:h,notification:f,sameInstance:p}=u;return e(Fe,{onClick:y=>{y.target===y.currentTarget&&l()},children:e("div",{class:"sheet",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:l,children:e(I,{icon:"x",alt:i({id:"yz7wBu"})})}),e("header",{children:e("b",{children:e(m,{id:"5+87Pq"})})}),e("main",{children:[!p&&e("p",{children:e(m,{id:"k9N0Xk"})}),e("div",{class:"notification-peek",onClick:y=>{const{target:g}=y;(y.target.tagName==="BUTTON"||y.target.tagName==="A")&&l()},children:e(In,{instance:h.instanceURL,notification:f,isStatic:!0})}),e("div",{style:{textAlign:"end"},children:e(ye,{to:"/notifications",class:"button light",onClick:l,children:[e("span",{children:e(m,{id:"/WA/tl"})})," ",e(I,{icon:"arrow-right"})]})})]})]})})}return null}),vi=({limit:n}={})=>{const i=ke.account.get("searchHistory")||[];return n?i.slice(0,n):i},ld=10,Yn=(n,i=null)=>{if(!n?.trim?.())return;const s=vi(),o=s.findIndex(a=>a.query===n&&a.queryType===i);o!==-1&&s.splice(o,1),s.unshift({query:n.trim(),queryType:i,timestamp:Date.now()});const c=s.slice(0,ld);ke.account.set("searchHistory",c)},dd=(n,i=null)=>{const o=vi().filter(c=>!(c.query===n&&c.queryType===i));ke.account.set("searchHistory",o)},ud=()=>{ke.account.set("searchHistory",[])},Ht=(n,i,s)=>{let o,c,a;if(i==="statuses")o=e(m,{id:"o1mMWT",values:{query:n},components:{0:e("q",{})}}),c=`/search?q=${encodeURIComponent(n)}&type=statuses`,a="document";else if(i==="accounts")o=e(m,{id:"cDoNQr",values:{query:n},components:{0:e("q",{})}}),c=`/search?q=${encodeURIComponent(n)}&type=accounts`,a="group";else if(i==="hashtags"){const[,u="#",d=n]=n.match(/^([#])?(.*)$/),l=`${u}${d}`;o=e(m,{id:"mFfcu0",values:{hashtag:l},components:{0:e("mark",{})}}),c=`/${s}/t/${d}`,a="hashtag"}else o=e(m,{id:"48oDit",values:{query:n},components:{0:e("small",{class:"insignificant"})}}),c=`/search?q=${encodeURIComponent(n)}`,a="search";return{label:o,to:c,icon:a}},cc=Fc((n,i)=>{const{_:s}=ne(),{instance:o}=oe(),[c,a]=_t(),[u,d]=R(!1),[l,r]=R(c.get("q")||""),h=c.get("type"),f=K(null),p=K(null);Uc(i,()=>({setValue:w=>{r(w)},focus:()=>{p.current.focus()},select:()=>{p.current.select()},blur:()=>{p.current.blur()}}));const y=Ce(()=>vi({limit:5}),[n?.hidden]),g=Ce(()=>{if(!l)return[];const k=y.filter(v=>v.query===l?!1:v.query.toLowerCase().includes(l.toLowerCase())).slice(0,2).map(v=>({...Ht(v.query,v.queryType,o),queryType:v.queryType,isRecentSearch:!0,historyItem:v}));return[{...Ht(l,null,o),top:!h&&!/\s/.test(l),hidden:!!h},...k,{...Ht(l,"statuses",o),hidden:/^https?:/.test(l),top:/\s/.test(l),queryType:"statuses"},{...Ht(l,"hashtags",o),hidden:/^[@]/.test(l)||/^https?:/.test(l)||/\s/.test(l),top:/^[#]/.test(l),type:"link",queryType:"hashtags"},{label:e(m,{id:"gEoOUj",values:{query:l},components:{0:e("mark",{})}}),to:`/${l}`,hidden:!/^https?:/.test(l),top:/^https?:/.test(l),type:"link",icon:"arrow-right"},{...Ht(l,"accounts",o),queryType:"accounts"}].sort((v,_)=>{if(h){if(v.queryType===h)return-1;if(_.queryType===h)return 1}return v.top&&!_.top?-1:!v.top&&_.top?1:0}).filter(({hidden:v})=>!v)},[l,h,o]);return e("form",{ref:f,class:"search-popover-container",onSubmit:w=>{if(w.preventDefault(),/\/search/.test(location.hash))if(l){const b={q:l};h&&(b.type=h),a(b)}else a({});else l?location.hash=`/search?q=${encodeURIComponent(l)}${h?`&type=${h}`:""}`:location.hash="/search";Yn(l,h),n?.onSubmit?.(w)},children:[e("input",{ref:p,value:l,name:"q",type:"search",placeholder:s({id:"A1taO8"}),dir:"auto",autocomplete:"off",autocorrect:"off",autocapitalize:"off",spellCheck:"false",enterKeyHint:"search",onSearch:w=>{w.target.value||a({})},onInput:w=>{r(w.target.value),d(!0)},onFocus:()=>{d(!0);const w=f.current?.querySelector(".search-popover-item");w&&w.classList.add("focus")},onBlur:()=>{setTimeout(()=>{d(!1)},100),f.current?.querySelector(".search-popover-item.focus")?.classList.remove("focus")},onKeyDown:w=>{const{key:k}=w;switch(k){case"Escape":d(!1);break;case"Down":case"ArrowDown":if(w.preventDefault(),u){const b=f.current.querySelector(".search-popover-item.focus");if(b){let v=b.nextElementSibling;for(;v&&v.hidden;)v=v.nextElementSibling;v&&(v.classList.add("focus"),Array.from(v.parentElement.children).filter(S=>S!==v).forEach(S=>{S.classList.remove("focus")}))}else{const v=f.current.querySelector(".search-popover-item");v&&v.classList.add("focus")}}break;case"Up":case"ArrowUp":if(w.preventDefault(),u){const b=document.querySelector(".search-popover-item.focus");if(b){let v=b.previousElementSibling;for(;v&&v.hidden;)v=v.previousElementSibling;v&&(v.classList.add("focus"),Array.from(v.parentElement.children).filter(S=>S!==v).forEach(S=>{S.classList.remove("focus")}))}else{const v=document.querySelectorAll(".search-popover-item"),_=v[v.length-1];_&&_.classList.add("focus")}}break;case"Enter":if(u){const b=document.querySelector(".search-popover-item.focus");b&&(w.preventDefault(),b.click()),d(!1),n?.onSubmit?.(w)}break}}}),e("div",{class:"search-popover",hidden:!u,children:[!l&&y.length>0&&e("div",{class:"search-popover-recent-searches",children:[e("div",{class:"search-popover-header",children:[e(I,{icon:"history",size:"s"}),e(m,{id:"4R1B1H"})]}),y.map((w,k)=>{const{label:b,to:v,icon:_}=Ht(w.query,w.queryType,o);return e(ye,{to:v,class:`search-popover-item ${k===0?"focus":""}`,onClick:S=>{Yn(w.query,w.queryType),n?.onSubmit?.(S)},children:[e(I,{icon:_,class:"more-insignificant"}),e("span",{children:b})]},`${w.query}-${w.queryType}-${w.timestamp}`)}),e(ye,{to:"/search",class:"search-popover-item search-history-see-all",children:[e(I,{icon:"more2",class:"more-insignificant"}),e("span",{children:e(m,{id:"gukqfD"})})]})]}),g.map(({label:w,to:k,icon:b,queryType:v,isRecentSearch:_,historyItem:S},x)=>e(ye,{to:k,class:`search-popover-item ${_?"search-popover-item-recent":""} ${x===0?"focus":""}`,onClick:C=>{_||Yn(l,v),n?.onSubmit?.(C)},children:[e(I,{icon:b,class:"more-insignificant"}),e("span",{children:w})]},_?`recent-${S.query}-${S.queryType}-${S.timestamp}`:`suggestion-${v||"general"}-${x}`))]})]})}),hd=lt(function({onClose:i=()=>{}}){const s=We(E),[o,c]=R(!1),a=K(null);G(()=>{if(s.showSearchCommand){const{query:l}=s.showSearchCommand;c(!0),setTimeout(()=>{l&&a.current?.setValue?.(l),a.current?.focus?.()},150),E.showSearchCommand=!1}},[s.showSearchCommand]),Ke(["Slash","/"],l=>{c(!0),setTimeout(()=>{a.current?.focus?.(),a.current?.select?.()},0)},{useKey:!0,preventDefault:!0,ignoreEventWhen:l=>{const r=/\/search/.test(location.hash),h=/\/yip/.test(location.hash),f=!!document.querySelector("#modal-container > *");return r||h||f||l.metaKey||l.ctrlKey||l.altKey||l.shiftKey}});const u=()=>{c(!1),i()};Ke("esc",l=>{a.current?.blur?.(),u()},{enabled:o,enableOnFormTags:!0,preventDefault:!0,useKey:!0,ignoreEventWhen:l=>l.metaKey||l.ctrlKey||l.altKey||l.shiftKey});const d=!o;return e("div",{id:"search-command-container",hidden:d,onClick:l=>{l.target===l.currentTarget&&u()},children:e(cc,{ref:a,hidden:d,onSubmit:()=>{u()}})})});function fd(){const{_:n,_:i}=ne(),{instance:s}=oe(),o=We(E),{shortcuts:c,settings:a}=o;if(!c.length)return null;const u=a.shortcutsViewMode==="multi-column"||!a.shortcutsViewMode&&a.shortcutsColumnsMode,d=K(),l=K(),r=K(!1),h=c.map((g,w)=>{const{type:k,...b}=g;if(!ci[k])return null;let{id:v,path:_,title:S,subtitle:x,icon:C}=ci[k];return typeof v=="function"&&(v=v(b,w)),typeof _=="function"&&(_=_({...b,instance:b.instance||s},w)),typeof S=="function"?S=S(b,w):S?.id&&(S=i(S)),typeof x=="function"?x=x(b,w):x?.id&&(x=i(x)),typeof C=="function"&&(C=C(b,w)),v==="lists"&&(r.current=!0),{id:v,path:_,title:S,subtitle:x,icon:C}}).filter(Boolean);G(()=>{if(o.settings.shortcutsViewMode==="tab-menu-bar"&&l.current){const g=setTimeout(()=>{const w=l.current?.querySelector(".is-active");w&&w.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},100);return()=>clearTimeout(g)}},[]);const f=Hi();Ke(["1","2","3","4","5","6","7","8","9"],g=>{const w=parseInt(g.key,10)-1;if(w<h.length){const{path:k}=h[w];k&&(f(k),d.current?.closeMenu?.())}},{enabled:!u,useKey:!0,ignoreEventWhen:g=>g.metaKey||g.ctrlKey||g.altKey||g.shiftKey});const[p,y]=R([]);return u?null:e("div",{id:"shortcuts",children:o.settings.shortcutsViewMode==="tab-menu-bar"?e("nav",{ref:l,class:"tab-bar",onContextMenu:g=>{g.preventDefault(),E.showShortcutsSettings=!0},children:e("ul",{children:h.map(({id:g,path:w,title:k,subtitle:b,icon:v},_)=>e("li",{children:e(ye,{class:b?"has-subtitle":"",to:w,onClick:S=>{if(S.target.classList.contains("is-active")){S.preventDefault();const x=document.getElementById(`${g}-page`);if(x){x.scrollTop=0;const C=x.querySelector(".updates-button");C&&C.click()}}},children:[e(I,{icon:v,size:"xl"}),e("span",{children:[e(jn,{children:k}),b&&e(N,{children:[e("br",{}),e("small",{children:b})]})]})]})},`${_}-${g}-${k}-${b}-${w}`))})}):e(ft,{instanceRef:d,overflow:"auto",viewScroll:"close",menuClassName:"glass-menu shortcuts-menu",gap:8,position:"anchor",onMenuChange:g=>{g.open&&r.current&&An().then(y)},menuButton:e("button",{type:"button",id:"shortcuts-button",class:"plain",onContextMenu:g=>{g.preventDefault(),E.showShortcutsSettings=!0},onTransitionStart:g=>{try{const{target:w}=g;getComputedStyle(w).pointerEvents==="none"&&d.current?.closeMenu?.()}catch{}},children:e(I,{icon:"shortcut",size:"xl",alt:n({id:"CTqTgr"})})}),children:h.map(({id:g,path:w,title:k,subtitle:b,icon:v},_)=>g==="lists"?e(xn,{menuClassName:"glass-menu",overflow:"auto",gap:-8,label:e(N,{children:[e(I,{icon:v,size:"l"}),e("span",{class:"menu-grow",children:e(jn,{children:k})}),e(I,{icon:"chevron-right"})]}),children:[e(Ve,{to:"/l",children:e("span",{children:e(m,{id:"BHWx+g"})})}),e(Ye,{}),p?.map(S=>e(Ve,{to:`/l/${S.id}`,children:e("span",{children:[S.title,S.exclusive&&e(N,{children:[" ",e(Xt,{})]})]})},S.id))]}):e(Ve,{to:w,class:"glass-menu-item",children:[e(I,{icon:v,size:"l"})," ",e("span",{class:"menu-grow",children:[e("span",{children:e(jn,{children:k})}),b&&e(N,{children:[" ",e("small",{class:"more-insignificant",children:b})]})]}),e("span",{class:"menu-shortcut hide-until-focus-visible",children:_+1})]},`${_}-${g}-${k}-${b}-${w}`))})})}const pd=lt(fd);function md(n){let i=[],s=[],o=0;for(let c=0;c<n.length;c++){const a=n[c];a.reblog&&!a.account?.group?(s.push(a),o++):(i.push(a),o<3&&(o=0))}if(n.length>10&&(s.length>n.length/4||o>=3)){const c=s.map(a=>a.id);if(s.length>n.length*3/4)i=[...i,{id:c,items:s,type:"boosts"}];else{const a=Math.floor(i.length/2);i=[...i.slice(0,a),{id:c,items:s,type:"boosts"},...i.slice(a)]}return i}else return n}function Ys(n,i){const s=ke.account.get("boostedStatusIDs")||{},o=n.filter(a=>{if(!a.reblog)return!0;const u=`${i}-${a.reblog.id}`,d=s[u];return d&&d!==a.id?!1:(s[u]=a.id,!0)}),c=Object.keys(s);return c.length>50&&c.slice(0,c.length-50).forEach(a=>{delete s[a]}),ke.account.set("boostedStatusIDs",s),o}function gd(n,i){const s=[];let o=0;n.forEach(d=>{for(let r=0;r<s.length;r++){if(s[r].find(h=>h.id===d.id))return;if(s[r].find(h=>h.id===d.inReplyToId)||s[r].find(h=>h.inReplyToId===d.id)){s[r].push(d);return}}const l=n.find(r=>r.id===d.inReplyToId);l&&(s[o++]=[d,l])});for(let d=0;d<s.length;d++)for(let l=d+1;l<s.length;l++)s[d].find(h=>s[l].includes(h))&&(s[d]=[...s[d],...s[l]],s[d]=s[d].filter((h,f,p)=>p.findIndex(y=>y.id===h.id)===f),s.splice(l,1),l--);s.forEach(d=>{d.sort((l,r)=>!l.inReplyToId&&!r.inReplyToId?Date.parse(l.createdAt)-Date.parse(r.createdAt):l.inReplyToId===r.id?1:r.inReplyToId===l.id||!l.inReplyToId?-1:r.inReplyToId?Date.parse(l.createdAt)-Date.parse(r.createdAt):1)}),s.forEach(d=>{const l=d[0].account.id;d.forEach(r=>{r.account.id!==l&&(r._differentAuthor=!0)})}),s.length;const c=[],a=[],u=[];return n.forEach(d=>{if(d.reblog){c.push(d);return}for(let l=0;l<s.length;l++)if(s[l].find(r=>r.id===d.id)){if(a.includes(l))return;const r=s[l];r.sort((f,p)=>Date.parse(f.createdAt)-Date.parse(p.createdAt));const h=r[0].account.id;c.push({id:r.map(f=>f.id),items:r,type:r.every(f=>f.account.id===h)?"thread":"conversation"}),a.push(l);return}if(d.inReplyToId&&d.inReplyToAccountId!==d.account.id){const l=ht(d.id,i);E.statusReply[l]||u.push({sKey:l,inReplyToId:d.inReplyToId})}c.push(d)}),u?.length&&queueMicrotask(()=>{const{masto:d}=oe({instance:i});async function l(){for(let r=0;r<u.length;r++){const{sKey:h,inReplyToId:f}=u[r];try{const p=await yd(f,d);Je(p,i,{skipThreading:!0}),E.statusReply[h]={id:p.id,instance:i},await new Promise(y=>setTimeout(y,1e3))}catch{}}}if(Qe("@mastodon/fetch-multiple-statuses")){const r=u.map(({inReplyToId:h})=>h);(async()=>{try{const h=await d.v1.statuses.list({id:r});if(h?.length)for(const f of h){Je(f,i,{skipThreading:!0});const p=u.find(({inReplyToId:y})=>y===f.id)?.sKey;p&&(E.statusReply[p]={id:f.id,instance:i})}else l()}catch{l()}})()}else l()}),c}const yd=Ct((n,i)=>i.v1.statuses.$select(n).fetch());async function ac(n,i){const s=await Zl();if(!s.length)return;const{statusFollowedTags:o}=E,c=[];if(n.forEach(a=>{if(a.reblog)return;const{id:u,content:d,tags:l=[]}=a,r=ht(u,i);if(o[r]?.length)return;const h=Xl(d);if(!h.length&&!l.length)return;const f=s.reduce((p,y)=>((h.some(g=>g.toLowerCase()===y.name.toLowerCase())||l.some(g=>g.name.toLowerCase()===y.name.toLowerCase()))&&p.push(y.name),p),[]);f.length&&c.push({item:a,sKey:r,followedTags:f})}),c.length){const a=c.map(d=>d.item.account),u=await hi(a);if(!u)return;c.forEach(d=>{const{item:l,sKey:r,followedTags:h}=d,f=u[l.account.id];f&&!f.following&&(o[r]=h)})}}function vd(){E.statusFollowedTags={}}function bd({scrollableRef:n,distanceFromStart:i=1,distanceFromEnd:s=1,scrollThresholdStart:o=10,scrollThresholdEnd:c=10,direction:a="vertical",distanceFromStartPx:u,distanceFromEndPx:d}={}){const[l,r]=R(null),[h,f]=R(!1),[p,y]=R(!1),[g,w]=R(!1),[k,b]=R(!1),v=a==="vertical";return St(()=>{const _=n.current;if(!_)return{};let S=v?_.scrollTop:_.scrollLeft;function x(){const{scrollTop:C,scrollLeft:A,scrollHeight:L,scrollWidth:P,clientHeight:q,clientWidth:z}=_,H=v?C:A,ee=v?L:P,te=v?q:z,Z=Math.abs(H-S),X=u||Math.min(te*i,ee,H),j=d||Math.min(te*s,ee,ee-H-te);Z>=(S<H?c:o)&&(r(S<H?"end":"start"),S=H),f(H<=0),y(H+te>=ee),w(H<=X),b(H+te>=ee-j)}return _.addEventListener("scroll",x,{passive:!0}),()=>_.removeEventListener("scroll",x)},[i,s,o,c]),{scrollDirection:l,reachStart:h,reachEnd:p,nearReachStart:g,nearReachEnd:k,init:()=>{n.current&&n.current.dispatchEvent(new Event("scroll"))}}}function wd({scrollableRef:n,distanceFromStart:i=1,distanceFromEnd:s=1,scrollThresholdStart:o=10,scrollThresholdEnd:c=10,direction:a="vertical",distanceFromStartPx:u,distanceFromEndPx:d,init:l}={},r){if(!r)return;const h=a==="vertical",f=K(null),p=K(null),y=fa(()=>{let g=!1,w=!1,k=!1,b=!1;const v=n.current,{scrollTop:_,scrollLeft:S,scrollHeight:x,scrollWidth:C,clientHeight:A,clientWidth:L}=v,P=h?_:S,q=h?x:C,z=h?A:L,H=P-f.current,ee=H>0,te=ee?c:o,Z=u||Math.min(z*i,q,P),X=d||Math.min(z*s,q,q-P-z);Math.abs(H)>=te&&(p.current=ee?"end":"start",f.current=P),g=P<=0,w=P+z>=q,k=P<=Z,b=P+z>=q-X,r({scrollDirection:p.current,reachStart:g,reachEnd:w,nearReachStart:k,nearReachEnd:b})},500,{leading:!1});return St(()=>{const g=n.current;return g&&(f.current=g[h?"scrollTop":"scrollLeft"],g.addEventListener("scroll",y,{passive:!0})),()=>{g&&g.removeEventListener("scroll",y)}},[]),G(()=>{l&&n.current&&queueMicrotask(()=>{n.current.dispatchEvent(new Event("scroll"))})},[l]),{resetScrollDirection:()=>{p.current=null}}}function kd({class:n,statusID:i,status:s,instance:o,parent:c,onMediaClick:a}){const{_:u}=ne();let d=ht(i,o);const l=We(E);if(s||(s=l.statuses[d]||l.statuses[i],d=ht(s?.id,o)),!s)return null;const{account:{acct:r,avatar:h,avatarStatic:f,id:p,url:y,displayName:g,username:w,emojis:k,bot:b,group:v},id:_,repliesCount:S,reblogged:x,reblogsCount:C,favourited:A,favouritesCount:L,bookmarked:P,poll:q,muted:z,sensitive:H,spoilerText:ee,visibility:te,language:Z,editedAt:X,filtered:j,card:W,createdAt:$,inReplyToId:J,inReplyToAccountId:V,content:ve,mentions:we,mediaAttachments:U,reblog:Y,uri:fe,url:be,emojis:Ie,_deleted:ze,_pinned:_e}=s;if(!U?.length)return null;const xe=Oe=>{Oe.shiftKey},Ae=Ce(()=>kt(),[]),qe=Ce(()=>Ae&&Ae===p,[p,Ae]),Ue=ho(fi),He=!qe&&cn(j,Ue);if(He?.action==="hide")return null;const Ge=H,Se=(Ui()["reading:expand:media"]?.toLowerCase()||"default")==="show_all",ie=c||"div";return U.map((Oe,Te)=>{const Re=`${d}-${Oe.id}`,M=He?.titlesStr;return e(ie,{"data-state-post-id":d,onMouseEnter:xe,"data-spoiler-text":ee||(H?u({id:"FKojeB"}):void 0),"data-filtered-text":He?u(M?{id:"7FGvtQ",values:{filterTitleStr:M}}:{id:"03Qqf9"}):void 0,class:`
media-post
${He?"filtered":""}
${Ge?"has-spoiler":""}
${Se?"show-media":""}
`,children:e(Ao,{class:n,media:Oe,lang:Z,to:`/${o}/s/${_}?media-only=${Te+1}`,onClick:a?me=>a(me,Te,Oe,s):void 0})},Re)})}const Ws=lt(kd);function Sd(n){const{_:i}=ne(),s=We(E),{masto:o,instance:c,authenticated:a}=oe(),[u,d]=Ce(()=>{const _=on();return[_.find(x=>x.info.id===kt())||_[0],_.length>1]},[]),l=(s.settings.shortcutsViewMode==="multi-column"||!s.settings.shortcutsViewMode&&s.settings.shortcutsColumnsMode)&&!s.shortcuts.find(_=>_.type==="following"),r=wo(()=>{E.showAccounts=!0},{threshold:600,detect:"touch",cancelOnMovement:!0}),h=K(),[f,p]=R(void 0),y=So([0,0,s.settings.shortcutsViewMode==="tab-menu-bar"?50:0,0]),g=K();async function w(_){return(_||!g.current)&&(g.current=o.v1.mutes.list({limit:80}).values()),await g.current.next()}const k=K();async function b(_){return(_||!k.current)&&(k.current=o.v1.blocks.list({limit:80}).values()),await k.current.next()}const v=K();return e(N,{children:[e("button",{ref:h,type:"button",class:`button plain nav-menu-button ${d?"with-avatar":""} ${f==="open"?"active":""}`,style:{position:"relative"},onClick:()=>{v.current=Date.now(),p(_=>_?void 0:"open")},onContextMenu:_=>{_.preventDefault(),E.showAccounts=!0},...r(),children:[d&&e(ut,{url:u?.info?.avatar||u?.info?.avatarStatic,size:"l",squircle:u?.info?.bot}),e(I,{icon:"menu",size:d?"s":"l",alt:i({id:"zucql+"})})]}),e(Gi,{menuClassName:"nav-menu",state:f,anchorRef:h,onClose:()=>{p(void 0)},containerProps:{style:{zIndex:10},onClick:()=>{Date.now()-v.current<300}},portal:{target:document.body},...n,overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:y,unmountOnClose:!0,children:[!!s.appVersion?.commitHash&&s.appVersion.commitHash!=="8b98d5a"&&e("div",{class:"top-menu",children:[e(ge,{onClick:()=>{confirm(i({id:"Djbaby"}))&&(async()=>{try{location.reload()}catch{}})()},children:[e(I,{icon:"sparkles",class:"sparkle-icon",size:"l"})," ",e("span",{children:e(m,{id:"95IFnD"})})]}),e(Ye,{})]}),e("section",{children:[e(Ve,{to:"/",children:[e(I,{icon:"home",size:"l"})," ",e("span",{children:e(m,{id:"i0qMbr"})})]}),a?e(N,{children:[l&&e(Ve,{to:"/following",children:[e(I,{icon:"following",size:"l"})," ",e("span",{children:e(m,{id:"following.title"})})]}),e(Ve,{to:"/catchup",children:[e(I,{icon:"history2",size:"l"}),e("span",{children:e(m,{id:"xrl8fj"})})]}),Qe("@mastodon/mentions")&&e(Ve,{to:"/mentions",children:[e(I,{icon:"at",size:"l"})," ",e("span",{children:e(m,{id:"/bZzdR"})})]}),e(Ve,{to:"/notifications",children:[e(I,{icon:"notification",size:"l"})," ",e("span",{children:e(m,{id:"iDNBZe"})}),s.notificationsShowNew&&e("sup",{title:i({id:"isRobC"}),style:{opacity:.5},children:[" ","•"]})]}),e(Ye,{}),u?.info?.id&&e(Ve,{to:`/${c}/a/${u.info.id}`,children:[e(I,{icon:"user",size:"l"})," ",e("span",{children:e(m,{id:"vERlcd"})})]}),e(Cd,{menuState:f}),e(Ve,{to:"/b",children:[e(I,{icon:"bookmark",size:"l"})," ",e("span",{children:e(m,{id:"7Ff7ia"})})]}),e(xn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(N,{children:[e(I,{icon:"more",size:"l"}),e("span",{class:"menu-grow",children:e(m,{id:"24misb"})}),e(I,{icon:"chevron-right"})]}),children:[e(Ve,{to:"/f",children:[e(I,{icon:"heart",size:"l"})," ",e("span",{children:e(m,{id:"zZOZj7"})})]}),e(Ve,{to:"/fh",children:[e(I,{icon:"hashtag",size:"l"})," ",e("span",{children:e(m,{id:"Xi1/bw"})})]}),e(Ve,{to:"/sp",children:[e(I,{icon:"schedule",size:"l"})," ",e("span",{children:e(m,{id:"+GkIdc"})})]}),e(Ye,{}),Qe("@mastodon/filters")&&e(Ve,{to:"/ft",children:[e(I,{icon:"filters",size:"l"})," ",e("span",{children:e(m,{id:"cSev+j"})})]}),e(ge,{onClick:()=>{E.showGenericAccounts={id:"mute",heading:i({id:"sOKhEA"}),fetchAccounts:w,excludeRelationshipAttrs:["muting"]}},children:[e(I,{icon:"mute",size:"l"})," ",e("span",{children:e(m,{id:"n1sANU"})})]}),e(ge,{onClick:()=>{E.showGenericAccounts={id:"block",heading:i({id:"nL8nlr"}),fetchAccounts:b,excludeRelationshipAttrs:["blocking"]}},children:[e(I,{icon:"block",size:"l"})," ",e("span",{children:e(m,{id:"r3RRWo"})})]})," "]}),e(Ye,{}),e(ge,{onClick:()=>{E.showAccounts=!0},children:[e(I,{icon:"group",size:"l"})," ",e("span",{children:e(m,{id:"7e0O8Z"})})]})]}):e(N,{children:[e(Ye,{}),e(Ve,{to:"/login",children:[e(I,{icon:"user",size:"l"})," ",e("span",{children:e(m,{id:"sQia9P"})})]})]})]}),e("section",{children:[e(Ye,{}),e(Ve,{to:"/search",children:[e(I,{icon:"search",size:"l"})," ",e("span",{children:e(m,{id:"A1taO8"})})]}),e(Ve,{to:`/${c}/trending`,children:[e(I,{icon:"chart",size:"l"})," ",e("span",{children:e(m,{id:"4/iCqx"})})]}),e(Ve,{to:`/${c}/p/l`,children:[e(I,{icon:"building",size:"l"})," ",e("span",{children:e(m,{id:"d5zxa4"})})]}),e(Ve,{to:`/${c}/p`,children:[e(I,{icon:"earth",size:"l"})," ",e("span",{children:e(m,{id:"4ERYY7"})})]}),a?e(N,{children:[e(Ye,{className:"divider-grow"}),e(ge,{onClick:()=>{E.showKeyboardShortcutsHelp=!0},children:[e(I,{icon:"keyboard",size:"l"})," ",e("span",{children:e(m,{id:"77Emn0"})})]}),e(ge,{onClick:()=>{E.showShortcutsSettings=!0},children:[e(I,{icon:"shortcut",size:"l"})," ",e("span",{children:e(m,{id:"8Kudkr"})})]}),e(ge,{onClick:()=>{E.showSettings=!0},children:[e(I,{icon:"gear",size:"l"})," ",e("span",{children:e(m,{id:"uVbUP8"})})]})]}):e(N,{children:[e(Ye,{}),e(ge,{onClick:()=>{E.showSettings=!0},children:[e(I,{icon:"gear",size:"l"})," ",e("span",{children:e(m,{id:"uVbUP8"})})]})]})]})]})]})}function Cd({menuState:n}){const i=Qe("@mastodon/lists"),[s,o]=R([]);return G(()=>{i&&n==="open"&&An().then(o)},[n,i]),s.length>0?e(xn,{menuClassName:"nav-submenu",overflow:"auto",gap:-8,label:e(N,{children:[e(I,{icon:"list",size:"l"}),e("span",{class:"menu-grow",children:e(m,{id:"h16FyT"})}),e(I,{icon:"chevron-right"})]}),children:[e(Ve,{to:"/l",children:e("span",{children:e(m,{id:"BHWx+g"})})}),s?.length>0&&e(N,{children:[e(Ye,{}),s.map(c=>e(Ve,{to:`/l/${c.id}`,children:e("span",{children:[c.title,c.exclusive&&e(N,{children:[" ",e(Xt,{})]})]})},c.id))]})]}):i&&e(Ve,{to:"/l",children:[e(I,{icon:"list",size:"l"}),e("span",{children:e(m,{id:"h16FyT"})})]})}const Ft=lt(Sd),Pn={block:"start",inline:"center",behavior:"instant"};function Pt({title:n,titleComponent:i,id:s,instance:o,emptyText:c,errorText:a,useItemID:u,boostsCarousel:d,fetchItems:l=()=>{},checkForUpdates:r=()=>{},checkForUpdatesInterval:h=15e3,headerStart:f,headerEnd:p,timelineStart:y,refresh:g,view:w,filterContext:k,showFollowedTags:b,showReplyParent:v,clearWhenRefresh:_}){const{_:S}=ne(),x=We(E),[C,A]=R([]),[L,P]=R("start"),[q,z]=R(!1),[H,ee]=R(!1),[te,Z]=R(!0),X=K();__BENCHMARK.start(`timeline-${s}-load`);const j=Ce(()=>ji(),[]),W=w!=="media",$=K(0),J=pa(ae=>{ee(!1),P("loading"),(async()=>{try{const $e=$.current=Date.now();let{done:Se,value:ie}=await l(ae);if($e!==$.current)return;if(Array.isArray(ie)){const[Oe,Te]=ie.reduce((Re,M)=>(M._pinned?Re[0].push(M):Re[1].push(M),Re),[[],[]]);ie=Te,W&&(d&&(ie=md(ie)),ie=gd(ie,o)),Oe.length&&(ie=Oe.concat(ie)),A(ae?ie:Re=>[...Re,...ie]),ie.length||(Se=!0),z(!Se)}else z(!1);P("default"),__BENCHMARK.end(`timeline-${s}-load`)}catch{P("error"),ae&&!C.length&&a&&re(a)}finally{J.cancel()}})()},1e3,{leading:!0}),V=".timeline-item, .timeline-item-alt",ve=Ke("j, shift+j",(ae,$e)=>{if(ae.shiftKey!==$e.shift)return;const Se=document.activeElement.closest(V),ie=Se?.getBoundingClientRect(),Oe=Array.from(X.current.querySelectorAll(V)).filter(Te=>!!Te.offsetHeight);if(Se&&ie.top<X.current.clientHeight&&ie.bottom>0){const Te=Oe.indexOf(Se);let Re=Oe[Te+1];$e.shift&&(Re=Oe.find((M,me)=>me>Te&&!M.classList.contains("timeline-item-alt"))),Re&&(Re.focus(),Re.scrollIntoView(Pn))}else{const Te=Oe.find(Re=>{const M=Re.getBoundingClientRect();return M.top>=44&&M.left>=0});Te&&(Te.focus(),Te.scrollIntoView(Pn))}},{useKey:!0,ignoreEventWhen:ae=>ae.metaKey||ae.ctrlKey||ae.altKey}),we=Ke("k, shift+k",(ae,$e)=>{if(ae.shiftKey!==$e.shift)return;const Se=document.activeElement.closest(V),ie=Se?.getBoundingClientRect(),Oe=Array.from(X.current.querySelectorAll(V)).filter(Te=>!!Te.offsetHeight);if(Se&&ie.top<X.current.clientHeight&&ie.bottom>0){const Te=Oe.indexOf(Se);let Re=Oe[Te-1];$e.shift&&(Re=Oe.findLast((M,me)=>me<Te&&!M.classList.contains("timeline-item-alt"))),Re&&(Re.focus(),Re.scrollIntoView(Pn))}else{const Te=Oe.find(Re=>{const M=Re.getBoundingClientRect();return M.top>=44&&M.left>=0});Te&&(Te.focus(),Te.scrollIntoView(Pn))}},{useKey:!0,ignoreEventWhen:ae=>ae.metaKey||ae.ctrlKey||ae.altKey}),U=Ke(["enter","o"],(ae,$e)=>{const Se=document.activeElement;if(Se?.matches(V))if($e.keys.join("")==="o"){const Oe=Se.querySelector("a.media:not(.status-card a.media)");if(Oe){const Te=Oe.getAttribute("href");if(/media\-only=/i.test(Te)){const Re=Te.replace(/media\-only=/i,"media=");setTimeout(()=>{location.hash=Re},100)}else Oe.click()}else Se.click()}else Se.click()},{useKey:!0,ignoreEventWhen:ae=>ae.metaKey||ae.ctrlKey||ae.altKey||ae.shiftKey}),Y=C.length>0&&L!=="loading"&&H,fe=st(()=>{Y&&J(!0),X.current?.scrollTo({top:0,behavior:"smooth"})},[J,Y]),be=Ke(".",fe,{useKey:!0,ignoreEventWhen:ae=>ae.metaKey||ae.ctrlKey||ae.altKey||ae.shiftKey}),Ie=K(),[ze,_e]=R(!1),xe=st(({scrollDirection:ae,nearReachStart:$e,reachStart:Se})=>{if(Ie.current){const ie=ae==="end"&&!$e;Ie.current.hidden=ie}_e($e),Se&&J(!0)},[_e,J]),{resetScrollDirection:Ae}=wd({scrollableRef:X,distanceFromEnd:2,scrollThresholdStart:44},xe);G(()=>{X.current?.scrollTo({top:0}),J(!0)},[]);const qe=K(!0);G(()=>{if(qe.current){qe.current=!1;return}_&&C?.length&&(J.cancel?.(),A([])),J(!0)},[_,g]);const Ue=K(w);G(()=>{Ue.current!==w&&(Ue.current=w,A([]))},[w]);const He=st(async({disableIdleCheck:ae=!1}={})=>{const $e=X.current?getComputedStyle(X.current).pointerEvents==="none":!1;x.settings.autoRefresh&&X.current.scrollTop<16&&(ae||window.__IDLE__)&&!Ad()&&!$e?J(!0):await r()&&ee(!0)},[s,J,r,x.settings.autoRefresh]),Ge=K();return an(ae=>{if(ae){const $e=Date.now()-Ge.current;(!Ge.current||$e>1e3*3)&&He({disableIdleCheck:!0})}else Ge.current=Date.now();Z(ae)},[r,He,x.settings.autoRefresh]),Wi(He,te&&!H?h*(ze?1:2):null),e(fi.Provider,{value:k,children:e("div",{id:`${s}-page`,class:`deck-container ${j?"deck-container-media-first":""}`,ref:ae=>{X.current=ae,ve.current=ae,we.current=ae,U.current=ae,be.current=ae},tabIndex:"-1",onClick:ae=>{Ie.current&&ae.target.closest(".timeline-item, .timeline-item-alt")&&setTimeout(()=>{Ie.current.hidden=!1,Ae()},250)},children:e("div",{class:"timeline-deck deck",children:[e("header",{ref:Ie,onClick:ae=>{ae.target.closest("a, button")||X.current?.scrollTo({top:0,behavior:"smooth"})},onDblClick:ae=>{ae.target.closest("a, button")||J(!0)},class:L==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Ft,{}),f??e(ye,{to:"/",class:"button plain home-button",children:e(I,{icon:"home",size:"l",alt:S({id:"i0qMbr"})})})]}),n&&(i||e("h1",{children:n})),e("div",{class:"header-side",children:!!p&&p})]}),Y&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:fe,children:[e(I,{icon:"arrow-up"})," ",e(m,{id:"2yr1/p"})]})]}),!!y&&e("div",{class:`timeline-start ${L==="loading"?"loading":""}`,children:y}),C.length?e(N,{children:[e("ul",{class:`timeline ${w?`timeline-${w}`:""}`,children:[C.map(ae=>e(_d,{status:ae,instance:o,useItemID:u,filterContext:k,view:w,showFollowedTags:b,showReplyParent:v,mediaFirst:j},ae.id+ae?._pinned+w)),q&&L==="loading"&&(w==="media"?null:e(N,{children:[e("li",{style:{height:"20vh"},children:e(je,{skeleton:!0,mediaFirst:j})}),e("li",{style:{height:"25vh"},children:e(je,{skeleton:!0,mediaFirst:j})})]}))]}),L==="default"&&(q?e($t,{root:X.current,rootMargin:`0px 0px ${screen.height*1.5}px 0px`,onChange:ae=>{ae&&J()},children:e("button",{type:"button",class:"plain block",onClick:()=>J(),style:{marginBlockEnd:"6em"},children:e(m,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(m,{id:"2EYeAZ"})}))]}):L==="loading"?e("ul",{class:"timeline",children:Array.from({length:5}).map((ae,$e)=>w==="media"?e("div",{style:{height:"50vh"}}):e("li",{children:e(je,{skeleton:!0,mediaFirst:j})},$e))}):L!=="error"&&L!=="start"&&e("p",{class:"ui-state",children:c}),L==="error"&&e("p",{class:"ui-state",children:[a,e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>J(!C.length),children:e(m,{id:"KDw4GX"})})]})]})})})}const _d=lt(({status:n,instance:i,useItemID:s,filterContext:o,view:c,showFollowedTags:a,showReplyParent:u,mediaFirst:d})=>{const{_:l}=ne(),{id:r,reblog:h,items:f,type:p,_pinned:y}=n;y&&(s=!1);const g=h?.id||r,w=i?`/${i}/s/${g}`:`/s/${g}`;if(f){let b=Gt(f,o),v="";if(p==="boosts"?v=he._({id:"NuqppG",values:{0:b.length}}):p==="pinned"&&(v=l({id:"GlfmCu"})),p==="boosts"||p==="pinned"){const x=new Set;if(b.sort((C,A)=>{const L=cn(C.filtered,o),P=cn(A.filtered,o);return L&&L?.action!=="blur"&&x.add(C.id),P&&P?.action!=="blur"&&x.add(A.id),L&&!P?1:!L&&P?-1:0}),x.size>=2){const A=[],L=[];b.forEach(q=>{x.has(q.id)?L.push(q):A.push(q)});const P=[];for(let q=0;q<L.length;q+=5)P.push({_grouped:!0,posts:L.slice(q,q+5)});b=A.concat(P)}return e("li",{class:"timeline-item-carousel",children:e(Id,{title:v,class:`${p}-carousel`,children:b.map(C=>{const{id:A,reblog:L,_pinned:P,_grouped:q}=C;if(q)return e("li",{class:"timeline-item-carousel-group",children:C.posts.map(ee=>{const{id:te,reblog:Z,_pinned:X}=ee,j=Z?.id||te,W=i?`/${i}/s/${j}`:`/s/${j}`;return X&&(s=!1),e(ye,{class:"status-carousel-link timeline-item-alt",to:W,children:s?e(je,{statusID:te,instance:i,size:"s"}):e(je,{status:ee,instance:i,size:"s"})})})},A);const z=L?.id||A,H=i?`/${i}/s/${z}`:`/s/${z}`;return P&&(s=!1),e("li",{children:e(ye,{class:"status-carousel-link timeline-item-alt",to:H,children:s?e(je,{statusID:A,instance:i,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:d}):e(je,{status:C,instance:i,size:"s",contentTextWeight:!0,enableCommentHint:!0,mediaFirst:d})})},A)})})},`timeline-${r}`)}const S=b.length>3;return b.map((x,C)=>{const{id:A,_differentAuthor:L}=x,P=i?`/${i}/s/${A}`:`/s/${A}`,q=C>0&&C<b.length-1,z=x.sensitive&&!!x.spoilerText,H=!L&&z&&C>0||S&&q&&(p==="thread"||p==="conversation"&&!L&&!b[C-1]._differentAuthor&&!b[C+1]._differentAuthor),ee=C===0,te=C===b.length-1;return e("li",{class:`timeline-item-container timeline-item-container-type-${p} timeline-item-container-${ee?"start":te?"end":"middle"} ${L?"timeline-item-diff-author":""}`,children:e(ye,{class:"status-link timeline-item",to:P,children:H?e(xd,{status:x,instance:i,filterContext:o}):s?e(je,{statusID:A,instance:i,enableCommentHint:te,showFollowedTags:a}):e(je,{status:x,instance:i,enableCommentHint:te,showFollowedTags:a})})},`timeline-${A}`)})}const k=`timeline-${r+y}`;return c==="media"?s?e(Ws,{class:"timeline-item",parent:"li",statusID:r,instance:i},k):e(Ws,{class:"timeline-item",parent:"li",status:n,instance:i},k):e("li",{children:e(ye,{class:"status-link timeline-item",to:w,children:s?e(je,{statusID:r,instance:i,enableCommentHint:!0,showFollowedTags:a,showReplyParent:u,mediaFirst:d}):e(je,{status:n,instance:i,enableCommentHint:!0,showFollowedTags:a,showReplyParent:u,mediaFirst:d})})},k)},(n,i)=>{const s=(n.status?.id||"").toString(),o=(i.status?.id||"").toString();return s===o&&n.instance===i.instance&&n.view===i.view});function Id({title:n,class:i,children:s}){const{_:o}=ne(),c=K(),a=K(),u=K(),[d,l]=R(!1);return G(()=>{setTimeout(()=>{l(!0)},1)},[]),e("div",{class:`status-carousel ${i}`,children:[e("header",{children:[e("h3",{children:n}),e("span",{children:[e("button",{ref:a,type:"button",class:"small plain2",onClick:()=>{const r=Math.min(320,c.current?.offsetWidth)*(Vt()?1:-1);c.current?.scrollBy({left:r,behavior:"smooth"})},children:e(I,{icon:"chevron-left",alt:o({id:"DHhJ7s"})})})," ",e("button",{ref:u,type:"button",class:"small plain2",onClick:()=>{const r=Math.min(320,c.current?.offsetWidth)*(Vt()?-1:1);c.current?.scrollBy({left:r,behavior:"smooth"})},children:e(I,{icon:"chevron-right",alt:o({id:"hXzOVo"})})})]})]}),e("ul",{ref:c,children:[e($t,{class:"status-carousel-beacon",onChange:r=>{a.current&&(a.current.disabled=r)}}),s[0],d&&s.slice(1),e($t,{class:"status-carousel-beacon",onChange:r=>{u.current&&(u.current.disabled=r)}})]})]})}function xd({status:n,instance:i,filterContext:s}){const{_:o}=ne(),c=We(E),{id:a,visibility:u,language:d}=n,l=ui(n),r=ht(a,i),h=cn(n.filtered,s);return e("article",{class:`status compact-thread ${u==="direct"?"visibility-direct":""}`,tabindex:"-1",children:[e("div",{class:"status-thread-badge-container",children:e(ma,{index:c.statusThreadNumber[r]})}),e("div",{class:"content-compact",title:l,lang:d,dir:"auto",children:h&&h?.action!=="blur"?e("b",{class:"status-filtered-badge badge-meta horizontal",title:h?.titlesStr||"",children:h?.titlesStr?e(m,{id:"sr6maL",values:{0:h.titlesStr},components:{0:e("span",{}),1:e("span",{})}}):e("span",{children:e(m,{id:"03Qqf9"})})}):e(N,{children:[l,n.sensitive&&n.spoilerText&&e(N,{children:[" ",e("span",{class:"spoiler-badge",children:e(I,{icon:"eye-close",size:"s",alt:o({id:"gnKo7f"})})})]})]})})]})}function Ad(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}const nn=20,fs=1983,Gs=`${fs}-01`,Td=Vi(()=>{try{const n=document.createElement("input");return n.setAttribute("type","month"),n.type==="month"}catch{return!1}});function Ed(){const{i18n:n,_:i}=ne(),s=We(E),{id:o,...c}=qt(),[a,u]=_t(),d=a.get("month"),l=!a.get("replies"),r=!!a.get("boosts"),h=a.get("tagged"),f=!!a.get("media"),{masto:p,instance:y,authenticated:g}=oe({instance:c.instance}),{masto:w,instance:k}=oe(),b=K(),v=[d,l,r,h,f],[_,S]=R(),x=K(0);G(()=>{x.current=0},v);const C=Ce(()=>ji(),[]),A=Ce(()=>y===k,[y,k]),[L,P]=R(!1);G(()=>{A&&_?.acct&&(async()=>{const U=await Uo(y);P(U)})()},[y,A,_?.acct]);async function q(U){const Y=/^\d{4}-[01]\d$/.test(d),fe=d?.split?.("-")?.[0]>=fs;if(Y&&fe){if(!_)return{value:[],done:!0};const[_e,xe]=d.split("-"),Ae=parseInt(xe,10)-1,qe=new Date(_e,Ae,0),Ue=`${qe.getFullYear()}-${(qe.getMonth()+1).toString().padStart(2,"0")}-${qe.getDate().toString().padStart(2,"0")}`,He=new Date(_e,Ae+1,1),Ge=`${He.getFullYear()}-${(He.getMonth()+1).toString().padStart(2,"0")}-${He.getDate().toString().padStart(2,"0")}`;let ae;U?(ae=nn+1,x.current=0):(ae=nn+x.current+1,x.current+=nn);const $e=await p.v2.search.list({q:`from:${_.acct} after:${Ue} before:${Ge}`,type:"statuses",limit:ae,offset:x.current});if($e?.statuses?.length){const Se=$e.statuses.slice(0,nn);Se.forEach(Oe=>{Je(Oe,y)});const ie=$e.statuses.length<=nn;return{value:Se,done:ie}}else return{value:[],done:!0}}let be=[];if(U){const{value:_e}=await p.v1.accounts.$select(o).statuses.list({pinned:!0}).values().next();if(_e?.length&&!h&&!f){const xe=_e.map(Ae=>(Je(Ae,y),{...Ae,_pinned:!0}));if(xe.length>=3){const Ae=xe.map(qe=>qe.id);be.push({id:Ae,items:xe,type:"pinned"})}else be.push(...xe)}}(U||!b.current)&&(b.current=p.v1.accounts.$select(o).statuses.list({limit:nn,exclude_replies:l,exclude_reblogs:r,only_media:f||void 0,tagged:h}).values());const{value:Ie,done:ze}=await b.current.next();if(Ie?.length){if(!Qe("@mastodon/pinned-posts")&&be.length){let _e=[];be[0]?.type==="pinned"?_e=be[0].id:_e=be.filter(Ae=>Ae._pinned).map(Ae=>Ae.id),_e.every(Ae=>Ie.some(qe=>qe.id===Ae))&&(be=[])}be.push(...Ie),Ie.forEach(_e=>{Je(_e,y)})}return{value:be,done:ze}}const[z,H]=R([]);let ee=i({id:"/cKnpj"});if(_?.acct){const U=(/@/.test(_.acct)?"":"@")+_.acct,Y=_?.displayName?`${_.displayName} (${U})`:`${U}`;if(!l)ee=i({id:"hS1Opy",values:{accountDisplay:Y}});else if(r)ee=i({id:"A/CX5F",values:{accountDisplay:Y}});else if(h)ee=i({id:"QQrO94",values:{accountDisplay:Y,tagged:h}});else if(f)ee=i({id:"NoG5wD",values:{accountDisplay:Y}});else if(d){const fe=new Date(d).toLocaleString(n.locale,{month:"long",year:"numeric"});ee=i({id:"8GjLvB",values:{accountDisplay:Y,monthYear:fe}})}else ee=Y}et(ee,"/:instance?/a/:id");const te=st(()=>$d(o,p),[o,p]);G(()=>{(async()=>{try{const U=await te();S(U)}catch{}if(!C)try{const U=await p.v1.accounts.$select(o).featuredTags.list();H(U)}catch{}})()},[o,C]);const{displayName:Z,acct:X,emojis:j}=_||{},W=Ce(()=>_?.id===kt(),[_?.id]),$=K(),J=Ce(()=>{const U=!l||r||h||f||!!d,Y=s.accounts[`${o}@${y}`];return e(N,{children:[e(Vo,{instance:y,account:Y||o,fetchAccount:te,authenticated:g,standalone:!0,showEndorsements:!0}),!C&&e("div",{class:"filter-bar",ref:$,style:{position:"relative"},children:[U?e(ye,{to:`/${y}/a/${o}`,class:"insignificant filter-clear",title:i({id:"u8JHrO"}),children:e(I,{icon:"x",size:"l",alt:i({id:"xCJdfg"})})},"clear-filters"):e(I,{icon:"filter",class:"insignificant",size:"l",alt:i({id:"cSev+j"})}),e(ye,{to:`/${y}/a/${o}${l?"?replies=1":""}`,onClick:()=>{l&&re(i({id:"PIWNSQ"}))},class:l?"":"is-active",children:e(m,{id:"5BFynH"})}),e(ye,{to:`/${y}/a/${o}${r?"":"?boosts=0"}`,onClick:()=>{r||re(i({id:"Qd13i0"}))},class:r?"is-active":"",children:e(m,{id:"usxQx0"})}),e(ye,{to:`/${y}/a/${o}${f?"":"?media=1"}`,onClick:()=>{f||re(i({id:"rKpfPY"}))},class:f?"is-active":"",children:e(m,{id:"xYilR2"})}),z.map(fe=>e(ye,{to:`/${y}/a/${o}${h===fe.name?"":`?tagged=${encodeURIComponent(fe.name)}`}`,onClick:()=>{h!==fe.name&&re(i({id:"L+HFfr",values:{0:fe.name}}))},class:h===fe.name?"is-active":"",children:e("span",{children:[e("span",{class:"more-insignificant",children:"#"}),fe.name]})},fe.id)),L&&e(N,{children:[Td()?e("label",{class:`filter-field ${d?"is-active":""}`,children:[e(I,{icon:"month",size:"l"}),e("input",{type:"month",disabled:!_?.acct,value:d||"",min:Gs,max:new Date().toISOString().slice(0,7),onInput:fe=>{const{value:be,validity:Ie}=fe.currentTarget;if(!Ie.valid)return;u(be?{month:be}:{});const[ze,_e]=be.split("-"),xe=parseInt(_e,10)-1,Ae=new Date(ze,xe);re(i({id:"0WUFGD",values:{0:Ae.toLocaleString(n.locale,{month:"long",year:"numeric"})}}))}})]}):e(Rd,{class:`filter-field ${d?"is-active":""}`,disabled:!_?.acct,value:d||"",min:Gs,max:new Date().toISOString().slice(0,7),onInput:fe=>{const{value:be,validity:Ie}=fe;Ie.valid&&u(be?{month:be}:{})}}),e("button",{type:"button",class:"filter-field",onClick:()=>{E.showSearchCommand={query:W?"from:me ":`from:${_?.acct} `}},children:e(I,{icon:"search",size:"l",alt:i(W?{id:"BmW9JG"}:{id:"h7t/Tx",values:{0:_?.username}})})})]})]})]})},[o,y,g,z,te,L,...v]);G(()=>{const U=$.current?.querySelector(".is-active");U&&$.current.scrollTo({behavior:"smooth",left:U.offsetLeft-($.current.offsetWidth-U.offsetWidth)/2})},[z,L,...v]);const V=Ce(()=>_?.url?URL.parse(_.url)?.hostname:null,[_]),we=!!_&&!(y===V);return e(N,{children:[e(Pt,{title:`${_?.acct?"@"+_.acct:i({id:"+owNNn"})}`,titleComponent:e("h1",{class:"header-double-lines header-account",children:[e("b",{children:e(xo,{text:Z,emojis:j,resolverURL:_?.url})}),e("div",{children:e("span",{class:"bidi-isolate",children:["@",X]})})]}),id:"account-statuses",instance:y,emptyText:i({id:"+k97fV"}),errorText:i({id:"scd9lw"}),fetchItems:q,useItemID:!0,view:f||C?"media":void 0,boostsCarousel:s.settings.boostsCarousel,timelineStart:J,refresh:[l,r,h,f,d+_?.acct].toString(),headerEnd:e(ft,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(I,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[e(ge,{disabled:!we,onClick:()=>{(async()=>{try{const{masto:U}=oe({instance:V}),Y=await U.v1.accounts.lookup({acct:_.acct}),{id:fe}=Y;location.hash=`/${V}/a/${fe}`}catch{alert(i({id:"FgdLx0"}))}})()},children:[e(I,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(m,{id:"6GZBJp",values:{0:V?e(N,{children:[" ","(",e("b",{children:li.toUnicode(V)}),")"]}):null}})})]}),!A&&e(ge,{onClick:()=>{(async()=>{try{const U=await w.v1.accounts.lookup({acct:_.acct+"@"+y}),{id:Y}=U;location.hash=`/${k}/a/${Y}`}catch{alert(i({id:"FgdLx0"}))}})()},children:[e(I,{icon:"transfer"})," ",e("small",{class:"menu-double-lines",children:e(m,{id:"SiegcM",values:{currentInstance:k},components:{0:e("b",{})}})})]})]})},o),X&&!W&&e("data",{class:"compose-data",value:JSON.stringify({draftStatus:{status:`@${X} `}})})]})}function Rd(n){const{i18n:i}=ne(),{class:s,disabled:o,value:c,min:a,max:u,onInput:d=()=>{}}=n,[l,r]=c?.split("-")||[],h=K(),f=K(),p=(y,g)=>{const[w,k]=a?.split("-")||[],[b,v]=u?.split("-")||[];return!(g<w||g>b||g===w&&y<k||g===b&&y>v)};return e("div",{class:s,children:[e(I,{icon:"month",size:"l"}),e("select",{ref:h,disabled:o,value:r||"",onInput:y=>{const{value:g}=y.currentTarget,w=f.current.value;if(!p(g,w))return{value:"",validity:{valid:!1}};d({value:g?`${w}-${g}`:"",validity:{valid:!0}})},children:[e("option",{value:"",children:e(m,{id:"HajiZl"})}),e("option",{disabled:!0,children:"-----"}),Array.from({length:12},(y,g)=>e("option",{value:(g+1).toString().padStart(2,"0"),children:new Date(0,g).toLocaleString(i.locale,{month:"long"})},g))]})," ",e("input",{ref:f,type:"number",disabled:o,value:l||new Date().getFullYear(),min:a?.slice(0,4)||fs,max:u?.slice(0,4)||new Date().getFullYear(),onInput:y=>{const{value:g,validity:w}=y.currentTarget,k=h.current.value;if(!w.valid||!p(k,g))return{value:"",validity:{valid:!1}};d({value:g?`${g}-${k}`:"",validity:{valid:!0}})},style:{width:"4.5em"}})]})}function Ld(n,i){return i.v1.accounts.$select(n).fetch()}const $d=Ct(Ld,{expires:1800*1e3});function Md(){const n=qt(),{year:i}=n;et(i?`${i} #Wrapstodon`:"#Wrapstodon","/annual_report/:year");const{masto:s,instance:o}=oe(),[c,a]=R(null),[u,d]=R("default");G(()=>{i&&(async()=>{d("loading");const y=await s.v1.annualReports.$select(i).fetch();a(y),d("default")})()},[i]);const{accounts:l,annualReports:r,statuses:h}=c||{},f=r?.find(y=>y.year==i)?.data,p=new Date;return e("div",{id:"annual-report-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:`report ${u==="loading"?"loading-mask":""}`,children:[e("h1",{children:[i," #Wrapstodon"]}),!!f&&e("dl",{children:Object.entries(f).map(([y,g])=>{const w={};return Array.isArray(g)&&g.forEach(k=>{Object.entries(k).forEach(([b,v])=>{typeof v=="number"&&(w[b]=(w[b]||0)+v)})}),e(N,{children:[e("dt",{children:y}),e("dd",{class:`report-${y}`,children:Array.isArray(g)?e("table",{children:[e("thead",{children:e("tr",{children:Object.entries(g[0]).map(([k,b])=>e("th",{class:k!=="month"&&typeof b=="number"?"number":"",children:k}))})}),e("tbody",{children:g.map(k=>e("tr",{children:Object.entries(k).map(([b,v])=>e("td",{class:b!=="month"&&typeof v=="number"?"number":"",style:{"--percentage":typeof v=="number"?`${v/w[b]*100}%`:0},children:v&&/(accountId)/i.test(b)&&/^(mostRebloggedAccounts|commonlyInteractedWithAccounts)$/i.test(y)?l?.find(_=>_.id===v)?e(mt,{account:l?.find(_=>_.id===v),showAvatar:!0}):"👻":b==="month"?p.setMonth(v-1)&&p.toLocaleString(void 0,{month:"long"}):typeof v=="number"?v.toLocaleString():v}))}))})]}):typeof g=="object"?/^(topStatuses)$/i.test(y)?e("dl",{children:Object.entries(g).map(([k,b])=>e(N,{children:[e("dt",{children:k}),e("dd",{children:b&&e(ye,{to:`/${o}/s/${b}`,children:e(je,{status:h?.find(v=>v.id===b),size:"s",readOnly:!0,showCommentCount:!0})})})]}))}):e("table",{children:e("tbody",{children:Object.entries(g).map(([k,b])=>e("tr",{children:[e("th",{children:k}),e("td",{class:typeof b=="number"?"number":"",children:b})]}))})}):typeof g=="string"?g:JSON.stringify(g,null,2)})]})})})]}),e("hr",{}),e("p",{style:{textAlign:"center"},children:e(ye,{to:"/",children:e(m,{id:"iWpEwy"})})})]})}const Pd=20;function rc(){const{_:n}=ne();et(n({id:"7Ff7ia"}),"/b");const{masto:i,instance:s}=oe(),o=K();async function c(a){return(a||!o.current)&&(o.current=i.v1.bookmarks.list({limit:Pd}).values()),await o.current.next()}return e(Pt,{title:n({id:"7Ff7ia"}),id:"bookmarks",emptyText:n({id:"8k2w6G"}),errorText:n({id:"UoL+FC"}),instance:s,fetchItems:c})}const lc=""+new URL("catch-up-O5q5C75Z.png",import.meta.url).href,Dd="home",Kt="catchup",xt=[{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,beyond:!0}],Nd={original:{id:"HxF6Fk"},replies:{id:"N8UzTV"},quotes:{id:"eWLklq"},boosts:{id:"puY2t0"},followedTags:{id:"lCLRBe"},groups:{id:"zhrjek"},filtered:{id:"03Qqf9"}},Od=["createdAt","repliesCount","favouritesCount","reblogsCount","density"],zd=[null,"account"],Bd=Vi(n=>new Intl.DateTimeFormat(n||void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric"}));function ai(n){return n?.id||n?.quotedStatus?.id}function qd(){const{i18n:n,_:i,_:s}=ne(),o=Bd(n.locale);et("Catch-up","/catchup");const{masto:c,instance:a}=oe(),[u,d]=_t(),l=u.get("id"),[r,h]=R("start"),[f,p]=R(!1),y=Ce(()=>kt(),[]),g=T=>T===y,w=Qe("@pixelfed/home-include-reblogs");async function k({maxCreatedAt:T}){const B=[],Q=c.v1.timelines.home.list({limit:40}),ce=Q.values();e:for(;;)try{w&&Q.params&&(typeof Q.params=="string"?Q.params+="&include_reblogs=true":Q.params.include_reblogs=!0);const O=await ce.next(),{value:le}=O;if(le?.length){await ac(le,a);let Ee=!1;for(let pe=0;pe<le.length;pe++){const Le=le[pe],F=Date.parse(Le.createdAt);if(!T||F>=T){const De=!g(Le.reblog?.account?.id||Le.account.id)&&cn(Le.reblog?.filtered||Le.filtered,Dd);if(De?.action==="hide")continue;Le._filtered=De;const Me=ht(Le.id,a);Le._followedTags=E.statusFollowedTags[Me]?[...E.statusFollowedTags[Me]]:[],B.push(Le),Ee=!0}if(!Ee)break e}}else break e;await new Promise(Ee=>setTimeout(Ee,1e3))}catch{break e}return B.forEach(O=>{if(O?.inReplyToId){const le=B.find(Ee=>Ee.id===O.inReplyToId);le&&!le.inReplyToId&&(le._thread=!0)}}),B}const[b,v]=R([]),_=K(),S=K(),x=Ce(()=>Jn(),[]),C=st(async({duration:T}={})=>{const B=Date.now(),Q=T?B-T:null;h("loading");const ce=await k({maxCreatedAt:Q}),O=`${x}-${ga()}`;try{await wt.catchup.set(O,{id:O,posts:ce,count:ce.length,startAt:Q,endAt:B}),d({id:O})}catch{}},[]);G(()=>{l?(async()=>{const T=await wt.catchup.get(l);T&&(T.posts.sort((B,Q)=>B.createdAt>Q.createdAt?1:-1),v(T.posts),h("results"))})():r==="results"&&(v([]),h("start"))},[l]);const[A,L]=Mt(T=>T+1,0),[P,q]=R(null),[z,H]=R([]);G(()=>{const T=new Set(z.map(B=>B.id));for(let B=sessionStorage.length-1;B>=0;B--){const Q=sessionStorage.key(B);if(Q?.startsWith(`${Kt}-`)){const ce=Q.replace(`${Kt}-`,"");T.has(ce)||ke.session.del(Q)}}},[z]),G(()=>{(async()=>{try{const T=await wt.catchup.keys();if(T.length){const B=Jn(),Q=T.filter(ce=>ce.startsWith(`${B}-`));if(Q.length){let ce=await wt.catchup.getMany(Q);ce.sort((pe,Le)=>Le.endAt-pe.endAt);let O=ce.slice(0,3),le=ce.slice(3);const Ee=O.map(pe=>{const{id:Le,count:F,startAt:de,endAt:De}=pe;return{id:Le,count:F,startAt:de,endAt:De}});H(Ee),q(O[0].endAt),ce=null,O=null,queueMicrotask(()=>{le.length&&wt.catchup.delMany(le.map(pe=>pe.id)).then(()=>{le=null}).catch(pe=>{})});return}}}catch{}H([])})()},[A]),G(()=>{r==="start"&&L()},[r==="start"]);const[ee,te]=Ce(()=>{let T=0,B=0,Q=0,ce=0,O=0,le=0,Ee=0;const pe={};for(const F of b){F._filtered&&F._filtered?.action!=="blur"?(T++,F.__FILTER="filtered"):F.group?(B++,F.__FILTER="groups"):F.reblog?(Q++,F.__FILTER="boosts"):Wt()&&ai(F.quote)?(ce++,F.__FILTER="quotes"):F._followedTags?.length?(le++,F.__FILTER="followedTags"):F.inReplyToId&&F.inReplyToAccountId!==F.account?.id?(O++,F.__FILTER="replies"):(Ee++,F.__FILTER="original");const de=F.reblog||F;if(F.__FILTER!=="filtered"&&de.card?.url&&de.card?.image&&de.card?.type==="link"){const{card:De,favouritesCount:Me,reblogsCount:nt}=de;let{url:tt}=De;if(tt=tt.replace(/\/$/,""),!pe[tt])pe[tt]={postID:de.id,card:De,shared:1,sharers:[F.account],likes:Me,boosts:nt};else{if(pe[tt].sharers.find(It=>It.id===F.account.id))continue;pe[tt].shared++,pe[tt].sharers.push(F.account),pe[tt].postID!==de.id&&(pe[tt].likes+=Me,pe[tt].boosts+=nt)}}}let Le=[];for(const F in pe)Le.push({url:F,...pe[F]});if(Le.sort((F,de)=>F.shared>de.shared?-1:F.shared<de.shared?1:F.boosts>de.boosts?-1:F.boosts<de.boosts?1:F.likes>de.likes?-1:F.likes<de.likes?1:F.quotes>de.quotes?-1:F.quotes<de.quotes?1:0),Le.length>10)e:for(let F=10;F<Le.length;F++){const{shared:de}=Le[F];if(de<=1){Le=Le.slice(0,F);break e}}return[{filtered:T,groups:B,boosts:Q,quotes:ce,replies:O,followedTags:le,original:Ee},Le]},[b]),[Z,X]=R("all"),[j,W]=R(null),[$,J]=R(1),[V,ve]=R("createdAt"),[we,U]=R("asc"),[Y,fe]=R(null);G(()=>{if(!l)return;const T=ke.session.getJSON(`${Kt}-${l}`);T&&(T.selectedFilterCategory!==void 0&&X(T.selectedFilterCategory),T.selectedAuthor!==void 0&&W(T.selectedAuthor),T.sortBy!==void 0&&ve(T.sortBy),T.sortOrder!==void 0&&U(T.sortOrder),T.groupBy!==void 0&&fe(T.groupBy),T.showTopLinks!==void 0&&p(T.showTopLinks))},[l]),G(()=>{if(!l||r!=="results")return;const T={selectedFilterCategory:Z,selectedAuthor:j,sortBy:V,sortOrder:we,groupBy:Y,showTopLinks:f};ke.session.setJSON(`${Kt}-${l}`,T)},[l,r,Z,j,V,we,Y,f]);const[be,Ie,ze]=Ce(()=>{const T={},B=new Map;let Q=b.filter(O=>{const le=Z==="all"||O.__FILTER===Z;return le&&(T[O.account.id]=O.account,B.set(O.account.id,(B.get(O.account.id)||0)+1)),le});const ce={};return Q.forEach(O=>{O.reblog&&(ce[O.reblog.id]?(ce[O.reblog.id].__BOOSTERS?ce[O.reblog.id].__BOOSTERS.add(O.account):ce[O.reblog.id].__BOOSTERS=new Set([O.account]),O.__HIDDEN=!0):ce[O.reblog.id]=O)}),j&&B.has(j)&&(Q=Q.filter(O=>O.account.id===j||[...O.__BOOSTERS||[]].find(le=>le.id===j))),[Q,T,Object.fromEntries(B)]},[Z,j,b]),_e=Ce(()=>{const T={};return be.forEach(B=>{T[B.id]=B}),T},[be]),xe=Ce(()=>Object.keys(ze).sort((T,B)=>ze[B]-ze[T]),[ze]),Ae=Ce(()=>{const T={};return xe.forEach((B,Q)=>{T[B]=Q}),be.filter(B=>!B.__HIDDEN).sort((B,Q)=>{if(Y==="account"){const ce=B.account.id,O=Q.account.id,le=T[ce],Ee=T[O],pe=le-Ee;if(pe!==0)return pe}if(V!=="createdAt"&&(B=B.reblog||B,Q=Q.reblog||Q,V!=="density"&&B[V]===Q[V]))return B.createdAt>Q.createdAt?1:-1;if(V==="density"){const ce=Zs(B),O=Zs(Q);return we==="asc"?ce>O?1:-1:O>ce?1:-1}return we==="asc"?B[V]>Q[V]?1:-1:Q[V]>B[V]?1:-1})},[be,V,we,Y,xe]),qe=K(null),Ue=K(null),He=K(!1);G(()=>{b.length>100||He.current||Ue.current&&(zo(Ue.current,{duration:200}),He.current=!0)},[b,Ue]);const Ge=b.length>160?"3d":"2d",ae=Ce(()=>Ge!=="2d"?null:b.map(T=>{const B=_e[T.id];return e("span",{class:`post-dot ${B?"post-dot-highlight":""}`},T.id)}),[_e]),$e=Ce(()=>Ge!=="3d"||!b?.length?null:Yd(b,"createdAt",320).map((B,Q)=>e("div",{class:"posts-bin",children:B.map(ce=>{const O=_e[ce.id];return e("span",{class:`post-dot ${O?"post-dot-highlight":""}`},ce.id)})},Q)),[_e]),Se=K(null);St(()=>{if(!l||r!=="results"||!Se.current||!Ae.length)return;const T=ke.session.getJSON(`${Kt}-${l}`);if(T?.scrollTop!==void 0&&T.scrollTop>0){const B=setTimeout(()=>{Se.current&&Se.current.scrollTo({top:T.scrollTop,behavior:"instant"})},100);return()=>clearTimeout(B)}},[l,r,Ae.length]),G(()=>{if(!l||r!=="results"||!Se.current)return;const T=()=>{if(!Se.current)return;const Q=ke.session.getJSON(`${Kt}-${l}`)||{};Q.scrollTop=Se.current.scrollTop,ke.session.setJSON(`${Kt}-${l}`,Q)},B=Se.current;return B.addEventListener("scroll",T,{passive:!0}),()=>{B.removeEventListener("scroll",T)}},[l,r]);const ie=Ce(()=>P?(Date.now()-P)/1e3/60/60:null,[P,$]);G(()=>{if(r!=="results")return;const T=j&&Ie[j]?Ie[j].username:"",B=we==="asc"?0:1,Q={account:"authors"};let ce=re({duration:5e3,text:s({id:"XKZRZ/",values:{selectedFilterCategory:Z,sortBy:V,sortOrder:we,groupBy:Y}})});return()=>{ce?.hideToast?.()}},[r,Z,j,V,we,Y,Ie]),G(()=>{if(j&&Ie[j]){const T=Ue.current.querySelector(`[data-author="${j}"]`),B=Ue.current?.getBoundingClientRect(),Q=T?.getBoundingClientRect();Q.left<B.left||Q.right>B.right?T.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"}):Q.top<0&&T.scrollIntoView({block:"nearest",inline:"nearest",behavior:"smooth"})}},[j,Ie]);const[Oe,Te]=R(!1),Re=".catchup-list > li > a",M=Ke("j",()=>{const T=document.activeElement.closest(Re),B=T?.getBoundingClientRect(),Q=Array.from(Se.current.querySelectorAll(Re));if(T&&B.top<Se.current.clientHeight&&B.bottom>0){const ce=Q.indexOf(T),O=Q[ce+1];O&&(O.focus(),O.scrollIntoView({block:"center",inline:"center",behavior:"instant"}))}else{const ce=Q.find(O=>O.getBoundingClientRect().top>=0);ce&&(ce.focus(),ce.scrollIntoView({block:"nearest",inline:"center",behavior:"instant"}))}},{useKey:!0,preventDefault:!0,ignoreEventWhen:T=>T.metaKey||T.ctrlKey||T.altKey||T.shiftKey}),me=Ke("k",()=>{const T=document.activeElement.closest(Re),B=T?.getBoundingClientRect(),Q=Array.from(Se.current.querySelectorAll(Re));if(T&&B.top<Se.current.clientHeight&&B.bottom>0){const ce=Q.indexOf(T);let O=Q[ce-1];O&&(O.focus(),O.scrollIntoView({block:"center",inline:"center",behavior:"instant"}))}else{const ce=Q.find(O=>{const le=O.getBoundingClientRect();return le.top>=44&&le.left>=0});ce&&(ce.focus(),ce.scrollIntoView({block:"nearest",inline:"center",behavior:"instant"}))}},{useKey:!0,preventDefault:!0,ignoreEventWhen:T=>T.metaKey||T.ctrlKey||T.altKey||T.shiftKey}),Ne=Ke("h, l",(T,B)=>{const Q=B.keys[0];if(j){const ce=xe.indexOf(j);Q==="h"?ce>0&&ce<xe.length&&(W(xe[ce-1]),Se.current?.focus()):Q==="l"&&ce<xe.length-1&&ce>=0&&(W(xe[ce+1]),Se.current?.focus())}else Q==="l"&&(W(xe[0]),Se.current?.focus())},{useKey:!0,preventDefault:!0,ignoreEventWhen:T=>T.metaKey||T.ctrlKey||T.altKey||T.shiftKey,enableOnFormTags:["input"]}),Pe=Ke("esc",()=>{W(null),Se.current?.focus()},{preventDefault:!0,ignoreEventWhen:T=>T.metaKey||T.ctrlKey||T.altKey||T.shiftKey,enableOnFormTags:["input"],useKey:!0}),D=Ke(".",()=>{Se.current?.scrollTo({top:0,behavior:"smooth"})},{useKey:!0,preventDefault:!0,ignoreEventWhen:T=>T.metaKey||T.ctrlKey||T.altKey||T.shiftKey,enableOnFormTags:["input"]}),se=st(T=>{const B=document.activeElement,Q=B?.tagName==="INPUT"&&B.type==="radio";if((T.key==="ArrowDown"||T.key==="ArrowUp"||T.key==="ArrowLeft"||T.key==="ArrowRight")&&Q){B.blur();return}},[]);return e("div",{ref:T=>{Se.current=T,M.current=T,me.current=T,Ne.current=T,Pe.current=T,D.current=T},id:"catchup-page",class:"deck-container",tabIndex:"-1",children:[e("div",{class:"timeline-deck deck wide",children:[e("header",{class:`${r==="loading"?"loading":""}`,onClick:T=>{T.target.closest("a, button")||Se.current?.scrollTo({top:0,behavior:"smooth"})},children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Ft,{}),r==="results"&&e(ye,{to:"/catchup",class:"button plain",children:e(I,{icon:"history2",size:"l",alt:s({id:"xrl8fj"})})}),r==="start"&&e(ye,{to:"/",class:"button plain",children:e(I,{icon:"home",size:"l",alt:s({id:"i0qMbr"})})})]}),e("h1",{children:r!=="start"&&e(m,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("div",{class:"header-side",children:r!=="start"&&r!=="loading"&&e("button",{type:"button",class:"plain",onClick:()=>{Te(!0)},children:e(m,{id:"c3XJ18"})})})]})}),e("main",{onKeyDown:se,children:[r==="start"&&e("div",{class:"catchup-start",children:[e("h1",{children:e(m,{id:"wyL/3/",components:{0:e("sup",{})}})}),e("details",{children:[e("summary",{children:e(m,{id:"CxKPv6"})}),e("p",{children:e(m,{id:"YMU1CK"})}),e("img",{src:lc,width:"1200",height:"900",alt:s({id:"CeInO2"})}),e("p",{children:e("button",{type:"button",onClick:T=>{T.target.closest("details").open=!1},children:e(m,{id:"2jI8hh"})})})]}),e("p",{children:e(m,{id:"1RfGk7"})}),e("p",{children:e("b",{children:e(m,{id:"OOEonE"})})}),e("div",{class:"catchup-form",children:[e("input",{ref:_,type:"range",value:$,min:xt[0].value,max:xt[xt.length-1].value,step:"1",list:"catchup-ranges",onChange:T=>J(+T.target.value)})," ",e("span",{style:{width:"8em"},children:[i(xt[$-1].label),e("br",{}),e("small",{class:"insignificant",children:$==xt[xt.length-1].value?s({id:"NMNiaO"}):rt(new Date(Date.now()-$*60*60*1e3))})]}),e("datalist",{id:"catchup-ranges",children:xt.map(({label:T,value:B})=>e("option",{value:B,label:i(T)}))})," ",e("button",{type:"button",onClick:()=>{let T;const B=xt.find(Q=>Q.beyond);$<B.value?T=$*60*60*1e3:S.current?.checked&&(T=Date.now()-P),C({duration:T})},children:e(m,{id:"R0yu2l"})})]}),ie&&$>ie?e("p",{class:"catchup-info",children:[e(I,{icon:"info"})," ",e(m,{id:"AGyV7s"})]}):$===xt[xt.length-1].value&&P?e("p",{class:"catchup-info",children:e("label",{children:[e("input",{type:"checkbox",switch:!0,checked:!0,ref:S})," ",e(m,{id:"dDJEHI",values:{0:o.format(new Date(P))}})]})}):null,e("p",{class:"insignificant",children:e("small",{children:e(m,{id:"1atgyZ"})})}),!!z?.length&&e("div",{class:"catchup-prev",children:[e("p",{children:e(m,{id:"Yfb9A8"})}),e("ul",{children:z.map(T=>e("li",{children:[e(ye,{to:`/catchup?id=${T.id}`,children:[e(I,{icon:"history2"})," ",e("span",{children:T.startAt?o.formatRange(new Date(T.startAt),new Date(T.endAt)):`… – ${o.format(new Date(T.endAt))}`})]})," ",e("span",{children:[e("small",{class:"ib insignificant",children:e(m,{id:"S6XZwv",values:{0:T.count}})})," ",e("button",{type:"button",class:"light danger small",onClick:async()=>{if(confirm(s({id:"D9CmP2"}))){let Q=re(s({id:"xJUo4P",values:{0:T.id}}));await wt.catchup.del(T.id),Q?.hideToast?.(),re(s({id:"1dyGG/",values:{0:T.id}})),L()}},children:e(I,{icon:"x",alt:s({id:"t/YqKh"})})})]})]},T.id))}),z.length>=3&&e("p",{children:e("small",{children:e(m,{id:"sXmrl4"})})})]})]}),r==="loading"&&e("div",{class:"ui-state catchup-start",children:[e(Be,{abrupt:!0}),e("p",{class:"insignificant",children:e(m,{id:"rbUTzD"})}),e("p",{class:"insignificant",children:e(m,{id:"q9urQO"})})]}),r==="results"&&e(N,{children:[e("div",{class:"catchup-header",children:[b.length>0&&e("p",{children:e("b",{class:"ib",children:o.formatRange(new Date(b[0].createdAt),new Date(b[b.length-1].createdAt))})}),e("aside",{children:[e("button",{hidden:Z==="all"&&!j&&V==="createdAt"&&we==="asc",type:"button",class:"plain4 small",onClick:()=>{X("all"),W(null),ve("createdAt"),fe(null),U("asc")},children:e(m,{id:"I9EnzM"})}),te?.length>0&&e("button",{type:"button",class:"plain small",onClick:()=>p(!f),children:[e(m,{id:"EIZREX"})," ",e(I,{icon:"chevron-down",style:{transform:f?"rotate(180deg)":"rotate(0deg)"}})]})]})]}),e("div",{class:"shazam-container no-animation",hidden:!f,children:e("div",{class:"shazam-container-inner",children:e("div",{class:"catchup-top-links links-bar",children:te.map(T=>{const{card:B,shared:Q,sharers:ce,likes:O,boosts:le}=T,{blurhash:Ee,title:pe,description:Le,url:F,image:de,imageDescription:De,language:Me,width:nt,height:tt,publishedAt:It}=B,Dt=Ki(F);let Tn;if(Ee){const En=Zi(Ee),Rn=us(En);Tn=ds([.6,Rn[1],Rn[2]])}return e("a",{href:F,target:"_blank",rel:"noopener",class:"link-block",style:Tn?{"--accent-color":`rgb(${Tn.join(",")})`,"--accent-alpha-color":`rgba(${Tn.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:de,alt:De,width:nt,height:tt,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:Dt})," ",!!It&&e(N,{children:"· "}),!!It&&e(N,{children:e(Tt,{datetime:It,format:"micro"})})]}),!!pe&&e("h1",{class:"title",lang:Me,dir:"auto",title:pe,children:pe})]}),!!Le&&e("p",{class:"description",lang:Me,dir:"auto",title:Le,children:Le}),e("hr",{}),e("p",{style:{whiteSpace:"nowrap"},children:e(m,{id:"bfSr6z",values:{0:ce.map(En=>{const{avatarStatic:Rn,displayName:Rc}=En;return e("button",{type:"button",class:"plain",style:{padding:0},onClick:ms=>{ms.preventDefault(),ms.stopPropagation();const{id:Lc}=En;W(Lc),X("all")},children:e(ut,{url:Rn,size:"s",alt:Rc})})})}})})]})]})},F)})})})}),b.length>=5&&(Ge==="3d"?e("div",{class:"catchup-posts-viz-time-bar",children:$e}):e("div",{class:"catchup-posts-viz-bar",children:ae})),b.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:()=>{X("all")}}),e(m,{id:"N40H+G"})," ",e("span",{class:"count",children:b.length})]}),Object.entries(Nd).map(([T,B])=>!!ee[T]&&e("label",{class:"filter-cat",title:(ee[T]/b.length*100).toFixed(2)+"%",children:[e("input",{type:"radio",name:"filter-cat",checked:Z.toLowerCase()===T.toLowerCase(),onChange:()=>{X(T),T==="boosts"&&(ve("reblogsCount"),U("desc"),fe(null))}}),i(B)," ",e("span",{class:"count",children:ee[T]})]},i(B)))]}),b.length>=2&&!!ze&&e("div",{class:"catchup-filters authors-filters",ref:Ue,children:[xe.map(T=>e("label",{class:"filter-author","data-author":T,children:[e("input",{type:"radio",name:"filter-author",checked:j===T,onChange:()=>{W(T)},onClick:()=>{j===T&&W(null)}}),e(ut,{url:Ie[T].avatarStatic||Ie[T].avatar,size:"xxl",alt:`${Ie[T].displayName} (@${Ie[T].acct})`})," ",e("span",{class:"count",children:ze[T]}),e("span",{class:"username",children:Ie[T].username})]},`${T}-${ze[T]}`)),xe.length>5&&e("small",{style:{whiteSpace:"nowrap",paddingInline:"1em",opacity:.33},children:e(m,{id:"HHtYi7",values:{0:xe.length}})},"authors-count")]}),b.length>=2&&e("div",{class:"catchup-filters",children:[e("span",{class:"filter-label",children:e(m,{id:"f6Hub0"})})," ",e("fieldset",{class:"radio-field-group",children:Od.map(T=>e("label",{class:"filter-sort",onClick:B=>{V===T&&(B.preventDefault(),B.stopPropagation(),U(we==="asc"?"desc":"asc"))},children:[e("input",{type:"radio",name:"filter-sort-cat",checked:V===T,onChange:()=>{ve(T);const B=/(replies|favourites|reblogs|quotes)/.test(T)?"desc":"asc";U(B)}}),{createdAt:s({id:"mYGY3B"}),repliesCount:s({id:"N8UzTV"}),favouritesCount:s({id:"zZOZj7"}),reblogsCount:s({id:"puY2t0"}),quotesCount:s({id:"eWLklq"}),density:s({id:"0tQ7AD"})}[T],V===T&&(we==="asc"?" ↑":" ↓")]},T))}),e("span",{class:"filter-label",children:e(m,{id:"group.filter"})})," ",e("fieldset",{class:"radio-field-group",children:zd.map(T=>e("label",{class:"filter-group",children:[e("input",{type:"radio",name:"filter-group",checked:Y===T,onChange:()=>{fe(T)},disabled:T==="account"&&j}),{account:s({id:"dpqPBg"})}[T]||s({id:"EdQY6l"})]},T||"none"))}),j&&xe.length>1?e("button",{type:"button",class:"plain6 small",onClick:()=>{W(null)},style:{whiteSpace:"nowrap"},children:e(m,{id:"/dlmrZ"})}):null]}),e("ul",{class:`catchup-list catchup-filter-${Z||""} ${V?`catchup-sort-${V}`:""} ${j&&Ie[j]?"catchup-selected-author":""} ${Y?`catchup-group-${Y}`:""}`,children:Ae.map((T,B)=>{const Q=T.reblog?.id||T.id;let ce=!1;return Y==="account"&&(qe.current&&T.account.id!==qe.current&&B>0&&(ce=!0),qe.current=T.account.id),e(N,{children:[ce&&e("li",{class:"separator"}),e(Ud,{to:`/${a}/s/${Q}`,post:T,root:Se.current})]},`${T.id}-${ce}`)})}),e("footer",{children:be.length>5&&e("p",{children:[s(Z==="boosts"?{id:"eVosYr"}:{id:"rhmyFK"})," ",e("button",{type:"button",class:"textual",onClick:()=>{Se.current.scrollTop=0},children:e(m,{id:"0MgdN+"})}),"."]})})]})]})]}),Oe&&e(Fe,{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(I,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(m,{id:"c3XJ18"})})}),e("main",{children:e("dl",{children:[e("dt",{children:e(m,{id:"EIZREX"})}),e("dd",{children:e(m,{id:"YmGrIy"})}),e("dt",{children:e(m,{id:"coaNtr"})}),e("dd",{children:e(m,{id:"UUrqX1"})}),e("dt",{children:e(m,{id:"ScQBC/"})}),e("dd",{children:e(m,{id:"srocAr"})}),e("dt",{children:e(m,{id:"77Emn0"})}),e("dd",{children:e("table",{children:e("tbody",{children:[e("tr",{children:[e("td",{children:e(m,{id:"Gy9P9T"})}),e("td",{children:e("kbd",{children:"j"})})]}),e("tr",{children:[e("td",{children:e(m,{id:"6XYpYY"})}),e("td",{children:e("kbd",{children:"k"})})]}),e("tr",{children:[e("td",{children:e(m,{id:"f5dduh"})}),e("td",{children:e("kbd",{children:"l"})})]}),e("tr",{children:[e("td",{children:e(m,{id:"rj0vxZ"})}),e("td",{children:e("kbd",{children:"h"})})]}),e("tr",{children:[e("td",{children:e(m,{id:"jsFF8C"})}),e("td",{children:e("kbd",{children:"Enter"})})]}),e("tr",{children:[e("td",{children:e(m,{id:"bUUv3P"})}),e("td",{children:e("kbd",{children:"."})})]})]})})})]})})]})})]})}const Fd=lt(function({post:n}){const{id:i,account:s,group:o,reblog:c,quote:a,inReplyToId:u,inReplyToAccountId:d,_followedTags:l,_filtered:r,visibility:h,__BOOSTERS:f}=n,p=u&&d!==s.id,y=!!r&&r?.action!=="blur",g=w=>{w.shiftKey};return e("article",{class:`post-line ${o?"group":c?"reblog":Wt()&&ai(a)?"quote":l?.length?"followed-tags":""} ${p?"reply-to":""} ${y?"filtered":""} visibility-${h}`,onMouseEnter:g,children:[e("span",{class:"post-author",children:c?e("span",{class:"post-reblog-avatar",children:[e(ut,{url:s.avatarStatic||s.avatar,squircle:s.bot}),f?.size>0?[...f].map(w=>e(ut,{url:w.avatarStatic||w.avatar,squircle:w.bot})):""," ",e(I,{icon:"rocket"})," ",e(mt,{account:c.account,showAvatar:!0})]}):ai(a)?e("span",{class:"post-quote-avatar",children:[e(ut,{url:s.avatarStatic||s.avatar,squircle:s.bot})," ",e(I,{icon:"quote"})," ",e(mt,{account:a.quotedStatus?.account||a.account,showAvatar:!0})]}):e(mt,{account:s,showAvatar:!0})}),e(jd,{post:c||n,filterInfo:r}),e("span",{class:"post-meta",children:[e(Vd,{post:c||n})," ",e(Tt,{datetime:new Date(c?.createdAt||n.createdAt),format:"micro"})]})]})},(n,i)=>n?.post?.id===i?.post?.id),Ud=({root:n,to:i,...s})=>{const o=K(),[c,a]=R(!1);return G(()=>{const u=new IntersectionObserver(d=>{d[0].isIntersecting&&(queueMicrotask(()=>a(!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(ye,{to:i,children:e(Fd,{...s})})}):e("li",{ref:o,style:{height:"4em"}})},Kd=8,Hd=8;function Zs(n){const{spoilerText:i,content:s,poll:o,mediaAttachments:c,card:a}=n,u=o?.options?.length?o.options.reduce((l,r)=>l+r.title,""):"";return(i.length+To(s)+u.length)/140+(c?.length?Kd*c.length:a?.image?Hd:0)}const Nt=48;function jd({post:n,filterInfo:i}){const{_:s}=ne();let{spoilerText:o,sensitive:c,content:a,emojis:u,poll:d,mediaAttachments:l,card:r,inReplyToId:h,inReplyToAccountId:f,account:p,_thread:y,quote:g}=n;const w=h&&f===p.id||!!y;let k=Wt()&&ai(g)?g.quotedStatus||g:null;(k?.spoilerText||k?.sensitive)&&(k=null),k?.emojis&&u.push(...k.emojis),!l?.length&&k?.mediaAttachments?.length&&(l=k.mediaAttachments);const v=!!Ui()["reading:expand:spoilers"],_=v||!o&&!c&&i?.action!=="blur",S=a?ui(n):"",x=!o||v;return e("div",{class:"post-peek",title:o?"":S,children:[e("span",{class:"post-peek-content",children:[w&&!x&&e(N,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:"Thread"})," "]}),i&&i?.action!=="blur"?e("span",{class:"post-peek-filtered",children:i?.titlesStr?s({id:"suKjh3",values:{0:i.titlesStr}}):s({id:"03Qqf9"})}):e(N,{children:[!!o&&e("span",{class:"post-peek-spoiler",children:[e(I,{icon:`${v?"eye-open":"eye-close"}`})," ",o]}),x&&e("div",{class:"post-peek-html",children:[w&&e(N,{children:[e("span",{class:"post-peek-tag post-peek-thread",children:e(m,{id:"e66y2Z"})})," "]}),!!a&&e("div",{dangerouslySetInnerHTML:{__html:ya(a,u)+(k?.content?`<blockquote class="post-peek-quote">${k.content}</blockquote>`:"")}}),!!d?.options?.length&&d.options.map(C=>e("div",{children:[d.multiple?"▪️":"•"," ",C.title]})),!a&&l?.length===1&&l[0].description&&e(N,{children:[e("span",{class:"post-peek-tag post-peek-alt",children:"ALT"})," ",e("div",{children:l[0].description})]})]})]})]}),(!i||i?.action==="blur")&&e("span",{class:"post-peek-post-content",children:[!!d&&e("span",{class:"post-peek-tag post-peek-poll",children:[e(I,{icon:"poll",size:"s"}),e(m,{id:"4WUbF1"})]}),l?.length?l.map(C=>{const A=C.previewUrl||C.url,L=C.previewRemoteUrl||C.remoteUrl,P=C.meta?.original?C.meta.original.width:C.meta?.small?.width||C.meta?.original?.width,q=C.meta?.original?C.meta.original.height:C.meta?.small?.height||C.meta?.original?.height;return e("span",{class:"post-peek-media",children:{image:(A||L)&&_?e("img",{src:A,width:Nt,height:Nt,alt:C.description,loading:"lazy",onError:z=>{const{src:H}=z.target;H===A&&L&&A!==L&&(z.target.src=L)},style:{"--anim-duration":`${Math.min(Math.max(Math.max(P,q)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"🖼"}),gifv:(A||L)&&_?e("img",{src:A,width:Nt,height:Nt,alt:C.description,loading:"lazy",onError:z=>{const{src:H}=z.target;H===A&&L&&A!==L&&(z.target.src=L)}}):e("span",{class:"post-peek-faux-media",children:"🎞️"}),video:(A||L)&&_?e("img",{src:A,width:Nt,height:Nt,alt:C.description,loading:"lazy",onError:z=>{const{src:H}=z.target;H===A&&L&&A!==L&&(z.target.src=L)}}):e("span",{class:"post-peek-faux-media",children:"📹"}),audio:e("span",{class:"post-peek-faux-media",children:"🎵"})}[C.type]||null},C.id)}):!!r&&r.image&&_&&e("span",{class:`post-peek-media post-peek-card card-${r.type||""}`,children:r.image?e("img",{src:r.image,width:Nt,height:Nt,alt:r.title||r.description||r.imageDescription,loading:"lazy",style:{"--anim-duration":r.width&&r.height&&`${Math.min(Math.max(Math.max(r.width,r.height)/100,5),120)}s`}}):e("span",{class:"post-peek-faux-media",children:"🔗"})})]})]})}function Vd({post:n}){const{_:i}=ne(),{reblogsCount:s,repliesCount:o,favouritesCount:c,quotesCount:a}=n;return e("span",{class:"post-stats",children:[o>0&&e("span",{class:"post-stat-replies",children:[e(I,{icon:"comment2",size:"s",alt:i({id:"N8UzTV"})})," ",Xe(o)]}),c>0&&e("span",{class:"post-stat-likes",children:[e(I,{icon:"heart",size:"s",alt:i({id:"zZOZj7"})})," ",Xe(c)]}),s>0||a>0?e("span",{class:"post-stat-boosts",children:[e(I,{icon:"rocket",size:"s",alt:i({id:"puY2t0"})})," ",s>0||a>0?`${s>0?Xe(s):""}${s>0&&a>0?"+":""}${a>0?Xe(a):""}`:Xe(s)]}):null]})}function Yd(n,i,s){const o=n.map(l=>new Date(l[i])),c=o.reduce((l,r)=>r<l?r:l,o[0]),a=o.reduce((l,r)=>r>l?r:l,o[0]),u=Math.min(a.getTime(),Date.now())-c.getTime(),d=Array.from({length:s},()=>[]);return n.forEach(l=>{const r=Date.parse(l[i]);if(r>Date.now())d[d.length-1].push(l);else{const h=(r-c.getTime())/u,f=Math.floor(h*(s-1));d[f].push(l)}}),d}const Wd=20;function dc(){const{_:n}=ne();et(n({id:"zZOZj7"}),"/favourites");const{masto:i,instance:s}=oe(),o=K();async function c(a){return(a||!o.current)&&(o.current=i.v1.favourites.list({limit:Wd}).values()),await o.current.next()}return e(Pt,{title:n({id:"zZOZj7"}),id:"favourites",emptyText:n({id:"PHIrMr"}),errorText:n({id:"khVljG"}),instance:s,fetchItems:c})}const Gd=["home","public","notifications","thread","account"],Xs=["thread","account"],Zd={home:{id:"Buy2bt"},notifications:{id:"iDNBZe"},public:{id:"RO10dm"},thread:{id:"EnJuK0"},account:{id:"vrQQgz"}},Xd=[0,1800,3600,360*60,720*60,3600*24,3600*24*7,3600*24*30],Ei={0:{id:"qqeAJM"},1800:at(30,"minute"),3600:at(1,"hour"),21600:at(6,"hour"),43200:at(12,"hour"),86400:at(24,"hour"),604800:at(7,"day"),2592e3:at(30,"day")};function Qd(){const{_:n}=ne(),{masto:i}=oe();et(n({id:"cSev+j"}),"/ft");const[s,o]=R("default"),[c,a]=R(!1),[u,d]=Mt(h=>h+1,0),[l,r]=R([]);return G(()=>{o("loading"),(async()=>{try{const h=await i.v2.filters.list();h.sort((f,p)=>f.title.localeCompare(p.title)),h.forEach(f=>{f.keywords?.length&&f.keywords.sort((p,y)=>p.id-y.id)}),r(h),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(Ft,{}),e(ye,{to:"/",class:"button plain",children:e(I,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(m,{id:"cSev+j"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{a(!0)},children:e(I,{icon:"plus",size:"l",alt:n({id:"yFfBdX"})})})})]})}),e("main",{children:l.length>0?e(N,{children:[e("ul",{class:"filters-list",children:l.map(h=>{const{id:f,title:p,expiresAt:y,keywords:g}=h;return e("li",{children:[e("div",{children:[e("h2",{children:p}),g?.length>0&&e("div",{children:g.map(w=>e(N,{children:[e("span",{class:"tag collapsed insignificant",children:w.wholeWord?`${w.keyword}`:w.keyword})," "]}))}),e("small",{class:"insignificant",children:e(uc,{expiresAt:y})})]}),e("button",{type:"button",class:"plain",onClick:()=>{a({filter:h})},children:e(I,{icon:"pencil",size:"l",alt:"Edit filter"})})]},f)})}),l.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(m,{id:"5vzJxv",values:{0:l.length}})})})]}):s==="loading"?e("p",{class:"ui-state",children:e(Be,{})}):s==="error"?e("p",{class:"ui-state",children:e(m,{id:"qcAUwp"})}):e("p",{class:"ui-state",children:e(m,{id:"cWIHTt"})})})]}),!!c&&e(Fe,{title:n({id:"vCSBPD"}),onClose:()=>{a(!1)},children:e(tu,{filter:c?.filter,onClose:h=>{h.state==="success"&&d(),a(!1)}})})]})}let Jd=1;const eu=()=>Jd++;function tu({filter:n,onClose:i}){const{_:s,_:o}=ne(),{masto:c}=oe(),[a,u]=R("default"),d=!!n,{context:l,expiresAt:r,id:h,keywords:f,title:p,filterAction:y}=n||{},g=!!r,w=g&&new Date(r),[k,b]=R(f||[]),v=K(),[_,S]=R([]),[x,C]=R([]),A=k.filter(L=>!_.includes(L.id)&&!x.includes(L._id));return e("div",{class:"sheet",id:"filters-add-edit-modal",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(I,{icon:"x",alt:o({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:o(d?{id:"3mOee6"}:{id:"yFfBdX"})})}),e("main",{children:e("form",{onSubmit:L=>{L.preventDefault();const P=new FormData(L.target),q=P.get("title"),z=P.getAll("keyword_attributes[][id]"),H=P.getAll("keyword_attributes[][keyword]"),ee=[...v.current.querySelectorAll('input[name="keyword_attributes[][whole_word]"]')].map(W=>W.checked),te=H.map((W,$)=>({id:z[$]||void 0,keyword:W,wholeWord:ee[$]}));d&&_?.length&&_.forEach(W=>{te.push({id:W,_destroy:!0})});const Z=P.getAll("context");let X=P.get("expires_in");const j=P.get("filter_action");!q||!Z?.length||(u("loading"),(async()=>{try{let W;d?(X===""||X===null?g?X=Math.floor((w-Date.now())/1e3):X=null:X==="0"||X===0?X=null:X=+X,W=await c.v2.filters.$select(h).update({title:q,context:Z,expiresIn:X,keywordsAttributes:te,filterAction:j})):(X=+X||null,W=await c.v2.filters.create({title:q,context:Z,expiresIn:X,keywordsAttributes:te,filterAction:j})),u("default"),i?.({state:"success",filter:W})}catch{u("error"),alert(o(d?{id:"H8RP+h"}:{id:"Fr0hAN"}))}})())},children:[e("div",{class:"filter-form-row",children:e("label",{children:[e("b",{children:e(m,{id:"MHrjPM"})}),e("input",{type:"text",name:"title",defaultValue:p,disabled:a==="loading",dir:"auto",enterKeyHint:"done",required:!0})]})}),e("div",{class:"filter-form-keywords",ref:v,children:[A.length?e("ul",{class:"filter-keywords",children:A.map(L=>{const{id:P,keyword:q,wholeWord:z,_id:H}=L;return e("li",{children:[e("input",{type:"hidden",name:"keyword_attributes[][id]",value:P}),e("input",{name:"keyword_attributes[][keyword]",type:"text",defaultValue:q,disabled:a==="loading",required:!0,dir:"auto",enterKeyHint:"done"}),e("div",{class:"filter-keyword-actions",children:[e("label",{children:[e("input",{name:"keyword_attributes[][whole_word]",type:"checkbox",value:P,defaultChecked:z,disabled:a==="loading"})," ",e(m,{id:"/7UQ7y"})]}),e("button",{type:"button",class:"light danger small",disabled:a==="loading",onClick:()=>{P?(_.push(P),S([..._])):H&&(x.push(H),C([...x]))},children:e(I,{icon:"x",alt:o({id:"t/YqKh"})})})]})]},`${P}-${H}`)})}):e("div",{class:"filter-keywords",children:e("div",{class:"insignificant",children:e(m,{id:"SYKm3p"})})}),e("footer",{class:"filter-keywords-footer",children:[e("button",{type:"button",class:"light",onClick:()=>{b([...k,{_id:eu(),keyword:"",wholeWord:!0}]),setTimeout(()=>{const L=v.current.querySelectorAll('input[type="text"]');L[L.length-1]?.focus?.()},10)},children:e(m,{id:"qn5Dbn"})})," ",A?.length>1&&e("small",{class:"insignificant",children:e(m,{id:"1JZ175",values:{0:A.length}})})]})]}),e("div",{class:"filter-form-cols",children:[e("div",{class:"filter-form-col",children:[e("div",{children:e("b",{children:e(m,{id:"uqf7Yq"})})}),Gd.map(L=>e("div",{children:[e("label",{class:Xs.includes(L)?"insignificant":"",children:[e("input",{type:"checkbox",name:"context",value:L,defaultChecked:l?l.includes(L):!0,disabled:a==="loading"})," ",s(Zd[L]),Xs.includes(L)?"*":""]})," "]})),e("p",{children:e("small",{class:"insignificant",children:e(m,{id:"m0G499"})})})]}),e("div",{class:"filter-form-col",children:[d&&e(m,{id:"ucJk3m",components:{0:e("b",{}),1:e(uc,{expiresAt:r,showNeverExpires:!0})}}),e("div",{children:[e("label",{for:"filters-expires_in",children:o(d?{id:"BcNdg+"}:{id:"agO/T/"})}),e("select",{id:"filters-expires_in",name:"expires_in",disabled:a==="loading",defaultValue:d?void 0:0,children:[d&&e("option",{}),Xd.map(L=>e("option",{value:L,children:typeof Ei[L]=="function"?Ei[L]():s(Ei[L])}))]})]}),e("p",{children:[e(m,{id:"blQMpa"}),e("br",{}),mo()?.mastodon>=5&&e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"blur",defaultChecked:y==="blur",disabled:a==="loading"})," ",e(m,{id:"ggxOw9"})]})," ",e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"warn",defaultChecked:y!=="hide"&&y!=="blur"||!d,disabled:a==="loading"})," ",e(m,{id:"jbreWy"})]})," ",e("label",{class:"ib",children:[e("input",{type:"radio",name:"filter_action",value:"hide",defaultChecked:y==="hide",disabled:a==="loading"})," ",e(m,{id:"zNCBmf"})]})]})]})]}),e("footer",{class:"filter-form-footer",children:[e("span",{children:[e("button",{type:"submit",disabled:a==="loading",children:o(d?{id:"tfDRzk"}:{id:"hYgDIe"})})," ",e(Be,{abrupt:!0,hidden:a!=="loading"})]}),d&&e(vt,{disabled:a==="loading",align:"end",menuItemClassName:"danger",confirmLabel:o({id:"BPjyR2"}),onClick:()=>{u("loading"),(async()=>{try{await c.v2.filters.$select(h).remove(),u("default"),i?.({state:"success"})}catch{u("error"),alert(o({id:"4Dh9J1"}))}})()},children:e("button",{type:"button",class:"light danger",onClick:()=>{},disabled:a==="loading",children:e(m,{id:"Jb6/SB"})})})]})]})})]})}function uc({expiresAt:n,showNeverExpires:i}){const{_:s}=ne(),o=!!n,c=o&&new Date(n),a=o&&Date.parse(n)<=Date.now(),[u,d]=Mt(l=>l+1,0);return Wi(d,a||3e4),a?s({id:"M1RnFv"}):o?e(m,{id:"urGtsw",components:{0:e(Tt,{datetime:c})}}):i&&s({id:"O1Aswy"})}function nu(){const{_:n}=ne(),{masto:i,instance:s}=oe();et(n({id:"Xi1/bw"}),"/fh");const[o,c]=R("default"),[a,u]=R([]);return G(()=>{c("loading"),(async()=>{try{const d=await oi();u(d),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(Ft,{}),e(ye,{to:"/",class:"button plain",children:e(I,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(m,{id:"Xi1/bw"})}),e("div",{class:"header-side"})]})}),e("main",{children:a.length>0?e(N,{children:[e("ul",{class:"link-list",children:a.map(d=>e("li",{children:e(ye,{to:s?`/${s}/t/${d.name}`:`/t/${d.name}`,children:[e(I,{icon:"hashtag",alt:"#"})," ",e("span",{children:d.name})]})}))}),a.length>1&&e("footer",{class:"ui-state",children:e("small",{class:"insignificant",children:e(m,{id:"2S/uvJ",values:{0:a.length}})})})]}):o==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):o==="error"?e("p",{class:"ui-state",children:e(m,{id:"2AeREO"})}):e("p",{class:"ui-state",children:e(m,{id:"vKsGhk"})})})]})})}const iu=20;function ps({title:n,path:i,id:s,...o}){const{_:c}=ne();et(n||c({id:"following.title"}),i||"/following");const{masto:a,streaming:u,instance:d,client:l}=oe(),[r,h]=R(u),f=We(E),p=K(),y=K(),g=K();G(()=>{!u&&l?.onStreamingReady&&l.onStreamingReady(v=>{h(v)})},[l]),__BENCHMARK.end("time-to-following");const w=Qe("@pixelfed/home-include-reblogs");async function k(v){(v||!y.current)&&(__BENCHMARK.start("fetch-home-first"),p.current=a.v1.timelines.home.list({limit:iu}),y.current=p.current.values()),w&&p.current?.params&&(typeof p.current.params=="string"?p.current.params+="&include_reblogs=true":p.current.params.include_reblogs=!0);const _=await y.current.next();let{value:S}=_;if(S?.length){let x=!1;v&&(S[0].id!==g.current&&(x=!0),g.current=S[0].id),S.forEach(C=>{Je(C,d)}),S=Ys(S,d),v&&x&&vd(),setTimeout(()=>{ac(S,d)},100),S.sort((C,A)=>Date.parse(A.createdAt)-Date.parse(C.createdAt))}return __BENCHMARK.end("fetch-home-first"),{..._,value:S}}async function b(){try{const v={limit:5,since_id:g.current};Qe("@pixelfed/home-include-reblogs")&&(v.include_reblogs=!0);const _=await a.v1.timelines.home.list(v).values().next();let{value:S}=_;const x=S[0]?.id===g.current;return!!(S?.length&&!x&&(g.current=S[0].id,S=Ys(S,d),S=Gt(S,"home"),S.some(C=>!C.reblog)))}catch{return!1}}return G(()=>{let v;return(async()=>{if(r){v=r.user.subscribe();for await(const _ of v){if(!v)break;if(_.event==="status.update"){const S=_.payload;Je(S,d)}else if(_.event==="delete"){const S=_.payload,x=go(S,d);x&&(x._deleted=!0)}}}})(),()=>{v?.unsubscribe?.(),v=null}},[r]),e(Pt,{title:n||c({id:"following.title"}),id:s||"following",emptyText:c({id:"nJEKbY"}),errorText:c({id:"7QSeK6"}),instance:d,fetchItems:k,checkForUpdates:b,useItemID:!0,boostsCarousel:f.settings.boostsCarousel,...o,filterContext:"home",showFollowedTags:!0,showReplyParent:!0})}const su=20,ou=4,Qs=ou+1;function hc({media:n,columnMode:i,...s}){const{_:o}=ne();let{hashtag:c,...a}=i?{}:qt();s.hashtag&&(c=s.hashtag);let u=c.trim().split(/[\s+]+/);u.sort(),c=u[0];const[d,l]=_t(),r=n||!!d.get("media"),h=r?"?media=1":"",{masto:f,instance:p,authenticated:y}=oe({instance:s?.instance||a.instance}),{masto:g,instance:w,authenticated:k}=oe(),b=u.map($=>`#${$}`).join(" "),v=o(p?r?{id:"kH0rA0",values:{hashtagTitle:b,instance:p}}:{id:"IK0zKi",values:{hashtagTitle:b,instance:p}}:r?{id:"hHSI3w",values:{hashtagTitle:b}}:{id:"+ZzjRY",values:{hashtagTitle:b}});et(v,"/:instance?/t/:hashtag");const _=K(),S=Ce(()=>ji(),[]),x=K(void 0);async function C($){const J=await f.v1.timelines.tag.$select(c).list({limit:su,any:u.slice(1),maxId:$?void 0:x.current,onlyMedia:r?!0:void 0}).values().next();let{value:V}=J;return V?.length&&($&&(_.current=V[0].id),V.forEach(ve=>{Je(ve,p,{skipThreading:r||S})}),x.current=V[V.length-1].id),{...J,value:V}}async function A(){try{const $=await f.v1.timelines.tag.$select(c).list({limit:1,any:u.slice(1),since_id:_.current,onlyMedia:r}).values().next();let{value:J}=$;const V=J[0]?.id===_.current;return J?.length&&!V?(J=Gt(J,"public"),!0):!1}catch{return!1}}const[L,P]=R("default"),[q,z]=R();G(()=>{(async()=>{try{const $=await f.v1.tags.$select(c).fetch();z($)}catch{}})()},[c]);const H=u.length>=Qs,[ee,te]=R("default"),[Z,X]=R([]),[j,W]=R(!1);return G(()=>{y&&(async()=>{try{const $=await f.v1.featuredTags.list();X($),W($.some(J=>J.name.toLowerCase()===c.toLowerCase()))}catch{}})()},[]),e(N,{children:[e(Pt,{title:v,titleComponent:!!p&&e("h1",{class:"header-double-lines",children:[e("b",{dir:"auto",children:b}),e("div",{children:p})]}),id:"hashtag",instance:p,emptyText:o({id:"CNSLAW"}),errorText:o({id:"yjj6Ll"}),fetchItems:C,checkForUpdates:A,useItemID:!0,view:r||S?"media":void 0,refresh:r,filterContext:"public",headerEnd:e(ft,{portal:!0,setDownOverflow:!0,overflow:"auto",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(I,{icon:"more",size:"l",alt:o({id:"2FYpfJ"})})}),children:[!!q&&u.length===1&&e(N,{children:[e(vt,{subMenu:!0,confirm:q.following,confirmLabel:o({id:"ctJi7k",values:{hashtag:c}}),disabled:L==="loading"||!y,onClick:()=>{P("loading"),q.following?f.v1.tags.$select(c).unfollow().then(()=>{z({...q,following:!1}),re(o({id:"doK/ij",values:{hashtag:c}}))}).catch($=>{alert($)}).finally(()=>{P("default")}):f.v1.tags.$select(c).follow().then(()=>{z({...q,following:!0}),re(o({id:"R9+aEN",values:{hashtag:c}}))}).catch($=>{alert($)}).finally(()=>{P("default")})},children:q.following?e(N,{children:[e(I,{icon:"check-circle"})," ",e("span",{children:e(m,{id:"HOSk7R"})})]}):e(N,{children:[e(I,{icon:"plus"})," ",e("span",{children:e(m,{id:"MKEPCY"})})]})}),e(ge,{type:"checkbox",checked:j,disabled:ee==="loading"||!y,onClick:()=>{if(te("loading"),j){const $=Z.find(J=>J.name.toLowerCase()===c.toLowerCase()).id;$?f.v1.featuredTags.$select($).remove().then(()=>{W(!1),re(o({id:"VH+Tf9"})),X(Z.filter(J=>J.id!==$))}).catch(J=>{}).finally(()=>{te("default")}):re(o({id:"3OLv47"}))}else f.v1.featuredTags.create({name:c}).then($=>{W(!0),re(o({id:"9ra4hn"})),X(Z.concat($))}).catch($=>{}).finally(()=>{te("default")})},children:j?e(N,{children:[e(I,{icon:"check-circle"}),e("span",{children:e(m,{id:"9ra4hn"})})]}):e(N,{children:[e(I,{icon:"check-circle"}),e("span",{children:e(m,{id:"UlJ3QN"})})]})}),e(Ye,{})]}),!S&&e(N,{children:[e(Xi,{className:"plain",children:e(m,{id:"cSev+j"})}),e(ge,{type:"checkbox",checked:!!r,onClick:()=>{r?d.delete("media"):d.set("media","1"),l(d)},children:[e(I,{icon:"check-circle",alt:"☑️"})," ",e("span",{class:"menu-grow",children:e(m,{id:"eK4SL/"})})]}),e(Ye,{})]}),e(va,{className:"menu-field",disabled:H,children:({ref:$})=>e("form",{onSubmit:J=>{J.preventDefault();const V=J.target[0].value?.trim?.();V&&!u.some(ve=>ve.toLowerCase()===V.toLowerCase())&&(u.push(V),u.sort(),location.hash=p?`/${p}/t/${u.join("+")}${h}`:`/t/${u.join("+")}${h}`)},children:[e(I,{icon:"hashtag"}),e("input",{ref:$,type:"text",placeholder:H?he._({id:"ouWc/D",values:{TOTAL_TAGS_LIMIT:Qs}}):o({id:"cxL5F9"}),required:!0,autocorrect:"off",autocapitalize:"off",spellCheck:!1,pattern:"[^#][^\\s#]+[^#]",disabled:H,dir:"auto",enterKeyHint:"go"})]})}),e(ba,{takeOverflow:!0,children:u.map(($,J)=>e(ge,{disabled:u.length===1,onClick:V=>{u.splice(J,1),u.sort(),location.hash=p?`/${p}/t/${u.join("+")}${h}`:`/t/${u.join("+")}${h}`},children:[e(I,{icon:"x",alt:o({id:"OISAkj"}),class:"danger-icon"}),e("span",{class:"bidi-isolate",children:[e("span",{class:"more-insignificant",children:"#"}),$]})]},$))}),e(Ye,{}),e(ge,{disabled:!k,onClick:()=>{if(E.shortcuts.length>=Lt){alert(he._({id:"XN1xAY",values:{SHORTCUTS_LIMIT:Lt}}));return}const $={type:"hashtag",hashtag:u.join(" "),instance:p,media:r?"on":void 0};E.shortcuts.some(V=>V.type===$.type&&V.hashtag.split(/[\s+]+/).sort().join(" ")===$.hashtag.split(/[\s+]+/).sort().join(" ")&&(V.instance?V.instance===$.instance:!0)&&(V.media?!!V.media==!!$.media:!0))?alert(o({id:"kfeQnS"})):(E.shortcuts.push($),re(o({id:"MIhb91"})))},children:[e(I,{icon:"shortcut"})," ",e("span",{children:e(m,{id:"i02Lq/"})})]}),e(ge,{onClick:()=>{let $=prompt(o({id:"4CZnNE"}));if(!/\./.test($)){$&&alert(o({id:"Q5COHO"}));return}$&&($=$.toLowerCase().trim(),location.hash=`/${$}/t/${u.join("+")}${h}`)},children:[e(I,{icon:"bus"})," ",e("span",{children:e(m,{id:"kesYbo"})})]}),w!==p&&e(ge,{onClick:()=>{location.hash=`/${w}/t/${u.join("+")}${h}`},children:[e(I,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(m,{id:"/AfxaA",values:{currentInstance:w},components:{0:e("b",{})}})})]})]})},p+b),!i&&!!u?.length&&e("data",{class:"compose-data",value:JSON.stringify({draftStatus:{status:`${u.length>1?`
`:" "}${b}`}})})]})}const cu=20;function fc(n){const{_:i}=ne(),s=We(E),{masto:o,instance:c}=oe(),a=n?.id||qt()?.id,u=K(),d=K();async function l(v){(v||!d.current)&&(d.current=o.v1.timelines.list.$select(a).list({limit:cu}).values());const _=await d.current.next();let{value:S}=_;return S?.length&&(v&&(u.current=S[0].id),S.forEach(x=>{Je(x,c)})),{..._,value:S}}async function r(){try{const v=await o.v1.timelines.list.$select(a).list({limit:1,since_id:u.current});let{value:_}=v;const S=_[0]?.id===u.current;return _?.length&&!S?(_=Gt(_,"home"),!0):!1}catch{return!1}}const[h,f]=R([]),[p,y]=R({title:"List"});et(p.title,"/l/:id"),G(()=>{(async()=>{try{const v=await Ho(a);y(v)}catch{}})()},[a]);const[g,w]=R(!1),[k,b]=R(!1);return e(N,{children:[e(Pt,{title:p.title,id:"list",emptyText:i({id:"KkDhfU"}),errorText:i({id:"7QSeK6"}),instance:c,fetchItems:l,checkForUpdates:r,useItemID:!0,boostsCarousel:s.settings.boostsCarousel,filterContext:"home",showReplyParent:!0,headerStart:e(ft,{overflow:"auto",menuButton:e("button",{type:"button",class:"plain",children:[e(I,{icon:"list",size:"l",alt:i({id:"h16FyT"})}),e(I,{icon:"chevron-down",size:"s"})]}),onMenuChange:v=>{v.open&&An().then(f)},children:[e(Ve,{to:"/l",children:e("span",{children:e(m,{id:"BHWx+g"})})}),h?.length>0&&e(N,{children:[e(Ye,{}),h.map(v=>e(Ve,{to:`/l/${v.id}`,children:e("span",{children:[v.title,v.exclusive&&e(N,{children:[" ",e(Xt,{})]})]})},v.id))]})]}),headerEnd:e(ft,{portal:!0,setDownOverflow:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(I,{icon:"more",size:"l",alt:i({id:"2FYpfJ"})})}),children:[p?.exclusive&&e(N,{children:[e(Xi,{className:"plain",children:[e(Xt,{})," ",e(m,{id:"FNptcJ"})]}),e(Ye,{})]}),e(ge,{onClick:()=>w({list:p}),children:[e(I,{icon:"pencil",size:"l"}),e("span",{children:e(m,{id:"ePK91l"})})]}),e(ge,{onClick:()=>b(!0),children:[e(I,{icon:"group",size:"l"}),e("span",{children:e(m,{id:"hB02vO"})})]})]})},a),g&&e(Fe,{onClick:v=>{v.target===v.currentTarget&&w(!1)},children:e(ls,{list:g?.list,onClose:v=>{v.state==="success"&&v.list?y(v.list):v.state==="deleted"&&(location.hash="/l"),w(!1)}})}),k&&e(Fe,{onClick:v=>{v.target===v.currentTarget&&b(!1)},children:e(ru,{listID:a,onClose:()=>b(!1)})})]})}const au=40;function ru({listID:n,onClose:i}){const{_:s}=ne(),{masto:o,instance:c}=oe(),[a,u]=R([]),[d,l]=R("default"),[r,h]=R(!1),f=K();async function p(y){h(!1),l("loading"),(async()=>{try{(y||!f.current)&&(f.current=o.v1.lists.$select(n).accounts.list({limit:au}).values());const g=await f.current.next();let{done:w,value:k}=g;k?.length?(u(y?k:a.concat(k)),h(!w)):h(!1),l("default")}catch{l("error")}})()}return G(()=>{p(!0)},[]),e("div",{class:"sheet",id:"list-manage-members-container",children:[!!i&&e("button",{type:"button",class:"sheet-close",onClick:i,children:e(I,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(m,{id:"hB02vO"})})}),e("main",{children:e("ul",{children:[a.map(y=>e("li",{children:[e(gt,{account:y,instance:c}),e(lu,{account:y,listID:n})]},y.id)),r&&d==="default"&&e($t,{as:"li",onChange:y=>y&&p(),children:e("button",{type:"button",class:"light block",onClick:p,children:e(m,{id:"uXRAkV"})})})]})})]})}function lu({account:n,listID:i}){const{_:s}=ne(),{masto:o}=oe(),[c,a]=R("default"),[u,d]=R(!1);return e(vt,{confirm:!u,confirmLabel:e("span",{children:e(m,{id:"j5n9Ry",values:{0:n.username},components:{0:e("span",{class:"bidi-isolate"})}})}),align:"end",menuItemClassName:"danger",onClick:()=>{u?(a("loading"),(async()=>{try{await o.v1.lists.$select(i).accounts.create({accountIds:[n.id]}),a("default"),d(!1)}catch{a("error")}})()):(a("loading"),(async()=>{try{await o.v1.lists.$select(i).accounts.remove({accountIds:[n.id]}),a("default"),d(!0)}catch{a("error")}})())},children:e("button",{type:"button",class:`light ${u?"":"danger"}`,disabled:c==="loading",children:s(u?{id:"m16xKo"}:{id:"MWIaew"})})})}const du={mention:["account","status"],quote:["account","status"],status:["account","status"],reblog:["account","status"],follow:["account"],follow_request:["account"],favourite:["account","status"],poll:["status"],update:["status"]},uu=["favourite","reblog","follow","admin.sign_up"],pc=n=>uu.includes(n);function mc(n){return n.filter(i=>{const{type:s,id:o,createdAt:c}=i;if(!s)return!1;const a=du[s];return a?.length?a.every(u=>!!i[u]):!0})}function gc(n){if(n?.notificationGroups){const{accounts:i=[],notificationGroups:s=[],statuses:o=[]}=n;return s.map(c=>{const{sampleAccountIds:a,statusId:u}=c,d=a?.map(r=>i.find(h=>h.id===r))||[],l=o?.find(r=>r.id===u)||null;return{...c,sampleAccounts:d,status:l}})}return n}function hu(n){const i=n.map(u=>{const{latestPageNotificationAt:d,mostRecentNotificationId:l,sampleAccounts:r,notificationsCount:h}=u;return{id:""+l,createdAt:d,account:r[0],...u}}),s={},o=[];for(let u=0;u<i.length;u++){const d=i[u],{type:l,status:r,createdAt:h,notificationsCount:f,sampleAccounts:p,groupKey:y}=d,g=h?new Date(h).toLocaleDateString():"";let w=l;!(f>0&&p?.length>0&&f>p?.length)&&(l==="favourite"||l==="reblog")&&(w="favourite+reblog");const b=`${r?.id}-${w}-${g}`,v=s[b];if(pc(l))if(v)p.forEach(_=>{const S=v.sampleAccounts.find(x=>x.id===_.id);S?(S._types.push(l),S._types.sort().reverse()):v.sampleAccounts.push({..._,_types:[l]})}),v.notificationsCount=Math.min(v.notificationsCount,f),v._notificationsCount.push(f),v._sampleAccountsCount.push(p?.length),v._accounts=v.sampleAccounts,y&&v._groupKeys.push(y);else{const _=p.map(S=>({...S,_types:[l]}));s[b]={...d,sampleAccounts:_,type:w,_accounts:_,_groupKeys:y?[y]:[],_notificationsCount:[f],_sampleAccountsCount:[p?.length]},o.push(s[b])}else{if((l==="mention"||l==="quote")&&r?.id){const _=o.find(S=>(l==="quote"&&S.type==="mention"||l==="mention"&&S.type==="quote")&&S.status?.id===r.id);if(_){_.type="mention+quote";continue}}o.push(d)}}const c={},a=[];for(let u=0;u<o.length;u++){const d=o[u],{type:l,account:r,_accounts:h,sampleAccounts:f,createdAt:p,groupKey:y}=d,g=p?new Date(p).toLocaleDateString():"",w=f?.length===1||h?.length===1;if((l==="favourite"||l==="reblog"||l==="favourite+reblog")&&w){const k=`${r?.id}-${l}-${g}`,b=c[k];if(b)b._statuses.push(d.status),b._ids+=`-${d.id}`,b._groupKeys.push(y);else{let v=c[k]={...d,type:l,_ids:d.id,_statuses:[d.status],_groupKeys:y?[y]:[]};a.push(v)}}else a.push(d)}return a}function fu(n){n=mc(n);const i={},s=[];for(let a=0,u=0;a<n.length;a++){const d=n[a],{id:l,status:r,account:h,type:f,createdAt:p}=d,y=p?new Date(p).toLocaleDateString():"";let g=f;(f==="favourite"||f==="reblog")&&(g="favourite+reblog");const w=`${r?.id}-${g}-${y}`,k=i[w];if(!pc(f))s[u++]=d;else if(k?.account){const b=k._accounts.find(v=>v.id===h.id);b?(b._types.push(f),b._types.sort().reverse(),k._ids+=`-${l}`):(h._types=[f],k._accounts.push(h),k._ids+=`-${l}`)}else{h&&(h._types=[f]);let b=i[w]={...d,type:g,_ids:l,_accounts:h?[h]:[]};s[u++]=b}}const o={},c=[];for(let a=0,u=0;a<s.length;a++){const d=s[a],{id:l,account:r,_accounts:h,type:f,createdAt:p}=d,y=p?new Date(p).toLocaleDateString():"";if(f==="favourite+reblog"&&r&&h.length===1){const g=`${r?.id}-${f}-${y}`,w=o[g];if(w)w._statuses.push(d.status),w._ids+=`-${l}`;else{let k=o[g]={...d,type:f,_ids:l,_statuses:[d.status]};c[u++]=k}}else c[u++]=d}return c}const Js=20,pu=new URLSearchParams;function yc({columnMode:n,...i}){const{_:s}=ne(),{masto:o,instance:c}=oe(),[a]=n?[pu]:_t(),[u,d]=R(null),l=i?.type||a.get("type")||u;et(s(l==="private"?{id:"2BApYc"}:{id:"/bZzdR"}),"/mentions");const r=K(),h=K();async function f(v){(v||!r.current)&&(r.current=o.v1.notifications.list({limit:Js,types:["mention"]}).values());const _=await r.current.next();let{value:S}=_;return S?.length&&(S=mc(S),v&&(h.current=S[0].id),S.forEach(({status:x})=>{Je(x,c)})),{..._,value:S?.map(x=>x.status)}}const p=K(),y=K();async function g(v){(v||!p.current)&&(p.current=o.v1.conversations.list({limit:Js}).values());const _=await p.current.next();let{value:S}=_;return S=S?.filter(x=>x.lastStatus),S?.length&&(v&&(y.current=S[0].lastStatus.id),S.forEach(({lastStatus:x})=>{Je(x,c)})),{..._,value:S?.map(x=>x.lastStatus)}}function w(...v){return l==="private"?g(...v):f(...v)}async function k(){if(l==="private")try{const v=await o.v1.conversations.list({limit:1,since_id:y.current}).values().next();let{value:_}=v;const S=_[0]?.id===y.current;return _?.length&&!S?(y.current=_[0].lastStatus.id,!0):!1}catch{return!1}else try{const v=await o.v1.notifications.list({limit:1,types:["mention"],since_id:h.current}).values().next();let{value:_}=v;return _?.length?(h.current=_[0].id,!0):!1}catch{return!1}}const b=Ce(()=>e("div",{class:"filter-bar centered",children:[e(ye,{to:"/mentions",class:l?"":"is-active",onClick:v=>{n&&(v.preventDefault(),d(null))},children:e(m,{id:"N40H+G"})}),e(ye,{to:"/mentions?type=private",class:l==="private"?"is-active":"",onClick:v=>{n&&(v.preventDefault(),d("private"))},children:e(m,{id:"zwBp5t"})})]}),[l]);return e(Pt,{title:s({id:"/bZzdR"}),id:"mentions",emptyText:s({id:"03jFGT"}),errorText:s({id:"pqR9KF"}),instance:c,fetchItems:w,checkForUpdates:k,useItemID:!0,timelineStart:b,refresh:l,filterContext:"notifications"})}const mu=80,gu=20,yu=new URLSearchParams,Dn={block:"start",inline:"center",behavior:"instant"},vc=Vi(()=>mo()?.mastodon>=2,{expires:1e3*60*5});function bc(n={}){const{masto:i}=oe();return vc()?i.v2.notifications.list({limit:gu,...n}):i.v1.notifications.list({limit:mu,...n})}function wc(n={}){return bc(n).values()}function kc(n){return vc()?hu(n):fu(n)}const vu=["forNotFollowing","forNotFollowers","forNewAccounts","forPrivateMentions","forLimitedAccounts"],bu={forNotFollowing:{id:"d+hDoa"},forNotFollowers:{id:"oAwuQj"},forNewAccounts:{id:"Srs8u7"},forPrivateMentions:{id:"IDC5Uw"},forLimitedAccounts:{id:"XMGM2e"}};function wu({columnMode:n}){const{_:i,_:s}=ne();et(s({id:"iDNBZe"}),"/notifications");const{masto:o,instance:c}=oe(),a=We(E),[u,d]=R("default"),[l]=n?[yu]:_t(),r=l.get("id"),h=l.get("access_token"),[f,p]=R(!1),[y,g]=R(!1),w=K(),{nearReachEnd:k,scrollDirection:b,reachStart:v,nearReachStart:_}=bd({scrollableRef:w}),S=b==="end"&&!_,[x,C]=R([]),[A,L]=R([]),P=K(),q=K();async function z(M){if((M||!q.current)&&(P.current=bc({excludeTypes:["follow_request"]}),q.current=P.current.values()),/max_id=($|&)/i.test(q.current?.nextParams))return{done:!0};const me=await q.current.next(),Ne=gc(me.value);if(Ne?.length){Ne.forEach(D=>{Je(D.status,c,{skipThreading:!0})});const Pe=kc(Ne);M?(E.notificationsLast=Pe[0],E.notifications=Pe,o.v1.markers.create({notifications:{lastReadId:Pe[0].id}}).catch(()=>{})):E.notifications.push(...Pe)}return E.notificationsShowNew=!1,E.notificationsLastFetchTime=Date.now(),me}async function H(){try{return await o.v1.followRequests.list({limit:80})}catch{return[]}}const ee=()=>{d("loading"),(async()=>{try{const M=await H();C(M),d("default")}catch{d("error")}})()};async function te(){try{return await o.v1.announcements.list()}catch{return[]}}const Z=Qe("@mastodon/filtered-notifications"),[X,j]=R(!1),[W,$]=R({});function J(){return o.v2.notifications.policy.fetch().catch(()=>{})}function V(){J().then(M=>{$(M)}).catch(()=>{})}const[ve,we]=R(null);function U(){return o.v1.notifications.requests.list()}const Y=M=>{be(!1),d("loading"),(async()=>{try{const me=z(M);M&&(te().then(Pe=>{Pe.sort((D,se)=>Date.parse(se.updatedAt||se.createdAt)-Date.parse(D.updatedAt||D.createdAt)),L(Pe)}).catch(()=>{}),H().then(Pe=>{C(Pe)}).catch(()=>{}),Z&&V());const{done:Ne}=await me;p(!Ne),d("default")}catch{d("error")}})()};G(()=>{Y(!0)},[]),G(()=>{v&&Y(!0)},[v]);const[fe,be]=R(!1),Ie=st(({disableIdleCheck:M=!1}={})=>{u!=="loading"&&a.settings.autoRefresh&&w.current?.scrollTop<16&&(M||window.__IDLE__)&&!ku()&&Y(!0)},[a.notificationsShowNew,a.settings.autoRefresh,u]),ze=K();an(M=>{if(M){const me=Date.now()-ze.current;!ze.current||me>1e3*3?Ie({disableIdleCheck:!0}):ze.current=Date.now()}});const _e=K(!0);G(()=>{let M=Kc(E,"notificationsShowNew",me=>{if(_e.current){_e.current=!1;return}u!=="loading"&&(me&&Ie(),be(me))});return()=>M?.()},[]);const xe=new Date,Ae=new Date(xe-1440*60*1e3);let qe=new Date;const Ue=!a.notifications.some(M=>new Date(M.createdAt).toDateString()===xe.toDateString()),He=K();G(()=>{r&&(E.routeNotification={id:r,accessToken:atob(h)})},[r,h]);const[Ge,ae]=R(null);G(async()=>{const M=new Date;if(M.getMonth()!==11)return;const me=M.getFullYear();if(!Qe("@mastodon/annual-report"))return;let Ne=ke.account.get("annualReportNotification");if(Ne&&Ne?.annualReport?.year==me){ae(Ne);return}const Pe=wc({types:["annual_report"]});try{Ne=(await Pe.next())?.value?.notificationGroups?.[0],Ne?.annualReport?.year==me&&(ae(Ne),ke.account.set("annualReportNotification",Ne))}catch{}},[]);const $e=".notification",Se=Ke("j",()=>{const M=document.activeElement.closest($e),me=M?.getBoundingClientRect(),Ne=Array.from(w.current.querySelectorAll($e));if(M&&me.top<w.current.clientHeight&&me.bottom>0){const Pe=Ne.indexOf(M);let D=Ne[Pe+1];D&&(D.focus(),D.scrollIntoView(Dn))}else{const Pe=Ne.find(D=>{const se=D.getBoundingClientRect();return se.top>=44&&se.left>=0});Pe&&(Pe.focus(),Pe.scrollIntoView(Dn))}},{useKey:!0,ignoreEventWhen:M=>M.metaKey||M.ctrlKey||M.altKey||M.shiftKey}),ie=Ke("k",()=>{const M=document.activeElement.closest($e),me=M?.getBoundingClientRect(),Ne=Array.from(w.current.querySelectorAll($e));if(M&&me.top<w.current.clientHeight&&me.bottom>0){const Pe=Ne.indexOf(M);let D=Ne[Pe-1];D&&(D.focus(),D.scrollIntoView(Dn))}else{const Pe=Ne.find(D=>{const se=D.getBoundingClientRect();return se.top>=44&&se.left>=0});Pe&&(Pe.focus(),Pe.scrollIntoView(Dn))}},{useKey:!0,ignoreEventWhen:M=>M.metaKey||M.ctrlKey||M.altKey||M.shiftKey}),Oe=Ke(["enter","o"],()=>{const me=document.activeElement.closest($e)?.querySelector(".status-link");me&&me.click()},{useKey:!0,ignoreEventWhen:M=>M.metaKey||M.ctrlKey||M.altKey||M.shiftKey}),Te=new Date,Re=Ce(()=>rt(Te,{forceOpts:{weekday:"long"}}),[Te]);return e("div",{id:"notifications-page",class:"deck-container",ref:M=>{w.current=M,Se.current=M,ie.current=M,Oe.current=M},tabIndex:"-1",children:[e("div",{class:`timeline-deck deck ${y?"only-mentions":""}`,children:[e("header",{hidden:S,onClick:M=>{M.target.closest("a, button")||w.current?.scrollTo({top:0,behavior:"smooth"})},onDblClick:M=>{M.target.closest("a, button")||Y(!0)},class:u==="loading"?"loading":"",children:[e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:[e(Ft,{}),e(ye,{to:"/",class:"button plain",children:e(I,{icon:"home",size:"l",alt:s({id:"i0qMbr"})})})]}),e("h1",{children:e(m,{id:"iDNBZe"})}),e("div",{class:"header-side",children:Z&&e("button",{type:"button",class:"button plain4",onClick:()=>{j(!0)},children:e(I,{icon:"settings",size:"l",alt:s({id:"a/+arl"})})})})]}),fe&&u!=="loading"&&e("button",{class:"updates-button shiny-pill",type:"button",onClick:()=>{Y(!0),w.current?.scrollTo({top:0,behavior:"smooth"})},children:[e(I,{icon:"arrow-up"})," ",e(m,{id:"Jy9RU/"})]})]}),A.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(I,{icon:"announce",class:"announcement-icon",size:"l"})," ",e(m,{id:"0whvLM",values:{0:A.length}})," ",e("small",{class:"insignificant",children:c})]}),A.length>1&&e("span",{class:"announcements-nav-buttons",children:A.map((M,me)=>e("button",{type:"button",class:"plain2 small",onClick:()=>{He.current?.children[me].scrollIntoView({behavior:"smooth",block:"nearest"})},children:me+1}))})]}),e("ul",{class:`announcements-list-${A.length>1?"multiple":"single"}`,ref:He,children:A.map(M=>e("li",{children:e(Su,{announcement:M})}))})]})})}),x.length>0&&e("div",{class:"follow-requests",children:[e("h2",{class:"timeline-header",children:e(m,{id:"6Fs1Ba"})}),x.length>5?e("details",{children:[e("summary",{children:e(m,{id:"7dHKu4",values:{0:x.length}})}),e("ul",{children:x.map(M=>e("li",{children:[e(gt,{account:M}),e(zi,{accountID:M.id,onChange:()=>{}})]},M.id))})]}):e("ul",{children:x.map(M=>e("li",{children:[e(gt,{account:M}),e(zi,{accountID:M.id,onChange:()=>{}})]},M.id))})]}),Z&&W?.summary?.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 M=>{const{open:me}=M.target;if(me){const Ne=await U();we(Ne)}},children:[e("summary",{children:e(m,{id:"N3Bq0f",values:{0:W.summary.pendingRequestsCount}})}),ve?ve?.length>0&&e("ul",{children:ve.map(M=>e("li",{children:[e("div",{class:"request-notifcations",children:[!M.lastStatus?.id&&e(gt,{useAvatarStatic:!0,showStats:!0,account:M.account}),M.lastStatus?.id&&e("div",{class:"last-post",children:e(ye,{class:"status-link",to:`/${c}/s/${M.lastStatus.id}`,children:e(je,{status:M.lastStatus,size:"s",readOnly:!0})})}),e(_u,{request:M})]}),e(Iu,{request:M,onChange:()=>{Y(!0)}})]},M.id))}):e("p",{class:"ui-state",children:e(Be,{abrupt:!0})})]})})})}),Ge&&e("div",{class:"shazam-container",children:e("div",{class:"shazam-container-inner",children:e(In,{notification:Ge})})}),e("div",{id:"mentions-option",children:e("label",{children:[e("input",{type:"checkbox",checked:y,onChange:M=>{g(M.target.checked)}})," ",e(m,{id:"0udtPI"})]})}),e("h2",{class:"timeline-header",children:[e(m,{id:"ecUA8p"})," ",e("small",{class:"insignificant bidi-isolate",children:Re})]}),Ue&&e("p",{class:"ui-state insignificant",children:u==="default"?s({id:"KS7iJH"}):e(N,{children:"…"})}),a.notifications.length?e(fi.Provider,{value:"notifications",children:a.notifications.filter(M=>M.type!=="follow_request").map(M=>{if(y&&M.type!=="mention")return null;const me=new Date(M.createdAt),Ne=me.toDateString()!==qe.toDateString();Ne&&(qe=me);const Pe=me.toDateString()===Ae.toDateString()?s({id:"y/0uwd"}):rt(qe,{hideTime:!0}),D=rt(qe,{forceOpts:{weekday:"long"}});return e(N,{children:[Ne&&e("h2",{class:"timeline-header",children:[e("span",{children:Pe})," ",e("small",{class:"insignificant bidi-isolate",children:D})]}),e(In,{instance:c,notification:M},M._ids||M.id)]},M._ids||M.id)})}):e(N,{children:[u==="loading"&&e(N,{children:e("ul",{class:"timeline flat",children:Array.from({length:5}).map((M,me)=>e("li",{class:"notification skeleton",children:[e("div",{class:"notification-type",children:e(I,{icon:"notification",size:"xl"})}),e("div",{class:"notification-content",children:e("p",{children:"███████████ ████"})})]}))})}),u==="error"&&e("p",{class:"ui-state",children:[e(m,{id:"gjzl8E"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>Y(!0),children:e(m,{id:"KDw4GX"})})]})]}),f&&e($t,{onChange:M=>{M&&Y()},children:e("button",{type:"button",class:"plain block",disabled:u==="loading",onClick:()=>Y(),style:{marginBlockEnd:"6em"},children:u==="loading"?e(Be,{abrupt:!0}):e(m,{id:"uXRAkV"})})})]}),Z&&X&&e(Fe,{onClick:M=>{M.target===M.currentTarget&&j(!1)},children:e("div",{class:"sheet",id:"notifications-settings",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:()=>j(!1),children:e(I,{icon:"x",alt:s({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:e(m,{id:"a/+arl"})})}),e("main",{children:e("form",{onSubmit:M=>{M.preventDefault();const{forNotFollowing:me,forNotFollowers:Ne,forNewAccounts:Pe,forPrivateMentions:D,forLimitedAccounts:se}=M.target,T={...W,forNotFollowing:me.value,forNotFollowers:Ne.value,forNewAccounts:Pe.value,forPrivateMentions:D.value,forLimitedAccounts:se.value};$(T),j(!1),(async()=>{try{await o.v2.notifications.policy.update(T),re(s({id:"4+7X9i"}))}catch{}})()},children:[e("p",{children:e(m,{id:"WrkPTf"})}),e("div",{class:"notification-policy-fields",children:vu.map(M=>{const me=W[M];return e("div",{children:e("label",{children:[i(bu[M]),e("select",{name:M,defaultValue:me,class:"small",children:[e("option",{value:"accept",children:e(m,{id:"g3UF2V"})}),e("option",{value:"filter",children:e(m,{id:"o7J4JM"})}),e("option",{value:"drop",children:e(m,{id:"gbbkE7"})})]})]})},M)})}),e("p",{children:e("button",{type:"submit",children:e(m,{id:"tfDRzk"})})})]})})]})})]})}function ku(){return!!document.querySelector(".deck-backdrop, #modal-container > *")}function Su({announcement:n}){const{instance:i}=oe(),{contact:s}=fo(),o=s?.account,{id:c,content:a,startsAt:u,endsAt:d,published:l,allDay:r,publishedAt:h,updatedAt:f,read:p,mentions:y,statuses:g,tags:w,emojis:k,reactions:b}=n,v=new Date(h),_=rt(v),S=new Date(f),x=rt(S);return e("div",{class:"announcement-block",children:[e(gt,{account:o}),e("div",{class:"announcement-content",onClick:Io({mentions:y,instance:i}),dangerouslySetInnerHTML:{__html:Li(a,{emojis:k})}}),e("p",{class:"insignificant",children:[e("time",{datetime:v.toISOString(),children:rt(v)}),f&&x!==_&&e(N,{children:[" ","•"," ",e("span",{class:"ib",children:e(m,{id:"TbFrLc",values:{0:rt(S)},components:{0:e("time",{datetime:S.toISOString()})}})})]})]}),e("div",{class:"announcement-reactions",hidden:!0,children:b.map(C=>{const{name:A,count:L,me:P,staticUrl:q,url:z}=C;return e("button",{type:"button",class:`plain4 small ${P?"reacted":""}`,children:[z||q?e("img",{src:z||q,alt:A,width:"16",height:"16"}):e("span",{children:A})," ",e("span",{class:"count",children:Xe(L)})]})})})]})}function Cu(n){const{masto:i}=oe();return i.v1.notifications.list({accountID:n})}function _u({request:n}){const{instance:i}=oe(),[s,o]=R("loading"),{account:c,lastStatus:a}=n,[u,d]=R(!1),[l,r]=R([]);function h(){d(!1)}return G(()=>{n?.account?.id&&u&&(o("loading"),(async()=>{const f=await Cu(n.account.id);r(f||[]),o("default")})())},[u,n?.account?.id]),e(N,{children:[e("button",{type:"button",class:"plain4 request-notifications-account",onClick:()=>{d(!0)},children:[e(I,{icon:"notification",class:"more-insignificant"})," ",e("small",{children:e(m,{id:"H0wUNM",values:{0:c.username},components:{0:e("span",{class:"bidi-isolate"})}})})," ",e(I,{icon:"chevron-down"})]}),u&&e(Fe,{onClick:f=>{f.target===f.currentTarget&&h()},children:e("div",{class:"sheet",tabIndex:"-1",children:[e("button",{type:"button",class:"sheet-close",onClick:h,children:e(I,{icon:"x",alt:t`Close`})}),e("header",{children:e("b",{children:e(m,{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})}):l.map(f=>e("div",{class:"notification-peek",onClick:p=>{const{target:y}=p;(p.target.tagName==="BUTTON"||p.target.tagName==="A")&&h()},children:e(In,{instance:i,notification:f,isStatic:!0})}))})]})})]})}function Iu({request:n,onChange:i}){const{_:s}=ne(),{masto:o}=oe(),[c,a]=R("default"),[u,d]=R(null),l=u!==null;return e("p",{class:"notification-request-buttons",children:[e("button",{type:"button",disabled:c==="loading"||l,onClick:()=>{a("loading"),(async()=>{try{await o.v1.notifications.requests.$select(n.id).accept(),d("accept"),a("default"),i({request:n,state:"accept"}),re(s({id:"ZtBMwU",values:{0:n.account.username}}))}catch{a("error"),re(s({id:"S92JKG"}))}})()},children:e(m,{id:"h7peZQ"})})," ",e("button",{type:"button",disabled:c==="loading"||l,class:"light danger",onClick:()=>{a("loading"),(async()=>{try{await o.v1.notifications.requests.$select(n.id).dismiss(),d("dismiss"),a("default"),i({request:n,state:"dismiss"}),re(s({id:"ibBDry",values:{0:n.account.username}}))}catch{a("error"),re(s({id:"S5aemF"}))}})()},children:e(m,{id:"1QfxQT"})}),e("span",{class:"notification-request-states",children:c==="loading"?e(Be,{abrupt:!0}):u==="accept"?e(I,{icon:"check-circle",alt:s({id:"bzMKg7"}),class:"notification-accepted"}):u==="dismiss"&&e(I,{icon:"x-circle",alt:s({id:"J6hrEy"}),class:"notification-dismissed"})})]})}const Sc=lt(wu),xu=20;function Bi({local:n,columnMode:i,...s}){const{_:o}=ne(),c=We(E),a=!!n,u=i?{}:qt(),{masto:d,instance:l}=oe({instance:s?.instance||u.instance}),{masto:r,instance:h}=oe(),f=o(a?{id:"u96B/B",values:{instance:l}}:{id:"PgVqvd",values:{instance:l}});et(f,a?"/:instance?/p/l":"/:instance?/p");const p=K(),y=K();async function g(k){if(k||!y.current){const _={limit:xu,local:a||void 0};!a&&Qe("@pixelfed/global-feed")&&(_.remote=!0),y.current=d.v1.timelines.public.list(_).values()}const b=await y.current.next();let{value:v}=b;return v?.length&&(k&&(p.current=v[0].id),v.forEach(_=>{Je(_,l)})),{...b,value:v}}async function w(){try{const k=await d.v1.timelines.public.list({limit:1,local:a,since_id:p.current}).values().next();let{value:b}=k;const v=b[0]?.id===p.current;return b?.length&&!v?(b=Gt(b,"public"),!0):!1}catch{return!1}}return e(Pt,{title:f,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:o(a?{id:"pJQgQV"}:{id:"cg0I+x"})}),e("div",{children:l})]}),id:"public",instance:l,emptyText:o({id:"BiZJ6G"}),errorText:o({id:"scd9lw"}),fetchItems:g,checkForUpdates:w,useItemID:!0,headerStart:e(N,{}),boostsCarousel:c.settings.boostsCarousel,filterContext:"public",headerEnd:e(ft,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(I,{icon:"more",size:"l",alt:o({id:"2FYpfJ"})})}),children:[e(ge,{href:a?`/#/${l}/p`:`/#/${l}/p/l`,children:a?e(N,{children:[e(I,{icon:"transfer"})," ",e("span",{children:e(m,{id:"dXMiUw"})})]}):e(N,{children:[e(I,{icon:"transfer"})," ",e("span",{children:e(m,{id:"t2B/we"})})]})}),e(Ye,{}),e(ge,{onClick:()=>{let k=prompt(o({id:"4CZnNE"}));if(!/\./.test(k)){k&&alert(o({id:"Q5COHO"}));return}k&&(k=k.toLowerCase().trim(),location.hash=a?`/${k}/p/l`:`/${k}/p`)},children:[e(I,{icon:"bus"})," ",e("span",{children:e(m,{id:"kesYbo"})})]}),h!==l&&e(ge,{onClick:()=>{location.hash=a?`/${h}/p/l`:`/${h}/p`},children:[e(I,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(m,{id:"/AfxaA",values:{currentInstance:h},components:{0:e("b",{})}})})]})]})},l+a)}function Au({onItemClick:n}){const{_:i}=ne(),{instance:s}=oe(),[,o]=Mt(l=>l+1,0),c=vi(),a=()=>{ud(),re({text:i({id:"hgPsUe"}),delay:1e3}),o()},u=(l,r)=>{dd(l,r),o()},[d]=mi();return c.length===0?null:e("div",{class:"recent-searches",children:[e("div",{class:"recent-searches-header",children:[e(I,{icon:"history"})," ",e("span",{children:e(m,{id:"4R1B1H"})}),e("span",{class:"spacer"}),e("button",{type:"button",class:"plain4 small",onClick:a,disabled:c.length<=0,children:e("span",{children:e(m,{id:"yYxB17"})})})]}),e("ul",{class:"link-list recent-searches-list",ref:d,children:c.map(l=>{const{label:r,to:h,icon:f}=Ht(l.query,l.queryType,s);return e("li",{class:"recent-searches-item",children:[e(ye,{to:h,class:"recent-searches-link",onClick:p=>{Yn(l.query,l.queryType),n?.(p)},children:[e(I,{icon:f,class:"more-insignificant"}),e("span",{class:"recent-searches-label",children:r})]}),e("button",{type:"button",class:"plain4 small",onClick:()=>u(l.query,l.queryType),children:e(I,{icon:"trash",alt:i({id:"xCJdfg"})})})]},`${l.query}-${l.queryType}-${l.timestamp}`)})})]})}const Nn=5,Ri=40,Tu=new URLSearchParams,On={block:"start",inline:"center",behavior:"instant"};function Cc({columnMode:n,...i}){const{_:s}=ne(),o=n?{}:qt(),{masto:c,instance:a,authenticated:u}=oe({instance:o.instance}),[d,l]=R("default"),[r]=n?[Tu]:_t(),h=K(),f=i?.query||r.get("q"),p=n?"statuses":i?.type||r.get("type");let y=s({id:"A1taO8"});if(f)switch(p){case"statuses":y=s({id:"6YeoAt",values:{q:f}});break;case"accounts":y=s({id:"fpgumQ",values:{q:f}});break;case"hashtags":y=s({id:"AuiMZZ",values:{q:f}});break;default:y=s({id:"wr3GZI",values:{q:f}})}et(y,"/search");const[g,w]=R(!1),k=K(0);G(()=>{k.current=0},[f,p]);const b=K();St(()=>{b.current?.scrollTo?.(0,0)},[f,p]);const[v,_]=R([]),[S,x]=R([]),[C,A]=R([]);G(()=>{_([]),x([]),A([])},[f]);const L={statuses:v,accounts:S,hashtags:C},P={statuses:_,accounts:x,hashtags:A},[q,z]=R({}),H=async $=>{if(!$?.length)return;const J=await hi($,q);J&&z({...q,...J})};function ee($){$&&(k.current=0),!(!$&&!u)&&(l("loading"),$&&!p&&(_(v.slice(0,Nn)),x(S.slice(0,Nn)),A(C.slice(0,Nn))),(async()=>{const J={q:f,resolve:u,limit:Nn};p&&(J.limit=Ri,J.type=p,u&&(J.offset=k.current));try{const V=await c.v2.search.list(J);if(p)if($){P[p](V[p]);const ve=V[p]?.length;k.current=Ri,w(!!ve)}else if(V[p]?.[0]?.id===L[p]?.[0]?.id)w(!1);else{P[p](we=>[...we,...V[p]]);const ve=V[p]?.length;k.current=k.current+Ri,w(!!ve)}else _(V.statuses||[]),x(V.accounts||[]),A(V.hashtags||[]),k.current=0,w(!1);H(V.accounts),l("default")}catch{l("error")}})())}const te=K();an($=>{const J=b.current?.scrollTop===0;if($&&J){const V=Date.now()-te.current;!te.current||V>1e3*3?ee(!0):te.current=Date.now()}}),G(()=>{let $;return h.current?.setValue?.(f||""),f?ee(!0):$=setTimeout(()=>{h.current?.focus?.()},150),()=>clearTimeout($)},[f,p,a]),Ke(["Slash","/"],$=>{h.current?.focus?.(),h.current?.select?.()},{useKey:!0,preventDefault:!0,ignoreEventWhen:$=>$.metaKey||$.ctrlKey||$.altKey||$.shiftKey});const Z=".timeline > li > a, .hashtag-list > li > a",X=Ke("j",()=>{const $=document.activeElement.closest(Z),J=$?.getBoundingClientRect(),V=Array.from(b.current.querySelectorAll(Z));if($&&J.top<b.current.clientHeight&&J.bottom>0){const ve=V.indexOf($);let we=V[ve+1];we&&(we.focus(),we.scrollIntoView(On))}else{const ve=V.find(we=>{const U=we.getBoundingClientRect();return U.top>=44&&U.left>=0});ve&&(ve.focus(),ve.scrollIntoView(On))}},{useKey:!0,ignoreEventWhen:$=>$.metaKey||$.ctrlKey||$.altKey||$.shiftKey}),j=Ke("k",()=>{const $=document.activeElement.closest(Z),J=$?.getBoundingClientRect(),V=Array.from(b.current.querySelectorAll(Z));if($&&J.top<b.current.clientHeight&&J.bottom>0){const ve=V.indexOf($);let we=V[ve-1];we&&(we.focus(),we.scrollIntoView(On))}else{const ve=V.find(we=>{const U=we.getBoundingClientRect();return U.top>=44&&U.left>=0});ve&&(ve.focus(),ve.scrollIntoView(On))}},{useKey:!0,ignoreEventWhen:$=>$.metaKey||$.ctrlKey||$.altKey||$.shiftKey}),[W]=mi();return e("div",{id:"search-page",class:"deck-container",tabIndex:"-1",ref:$=>{b.current=$,X.current=$,j.current=$},children:e("div",{class:"timeline-deck deck",children:[e("header",{class:d==="loading"?"loading":"",children:e("div",{class:"header-grid",children:[e("div",{class:"header-side",children:e(Ft,{})}),e(cc,{ref:h}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>{ee(!0)},disabled:d==="loading",children:e(I,{icon:"search",size:"l",alt:s({id:"A1taO8"})})})})]})}),e("main",{children:[!!f&&!n&&e("div",{ref:W,class:`filter-bar ${d==="loading"?"loading":""}`,children:[!!p&&e(ye,{to:`/search${f?`?q=${encodeURIComponent(f)}`:""}`,children:[e(I,{icon:"chevron-left"})," ",e(m,{id:"N40H+G"})]}),[{label:s({id:"bPwFdf"}),type:"accounts",to:`/search?q=${encodeURIComponent(f)}&type=accounts`},{label:s({id:"VwUsHI"}),type:"hashtags",to:`/search?q=${encodeURIComponent(f)}&type=hashtags`},{label:s({id:"+owNNn"}),type:"statuses",to:`/search?q=${encodeURIComponent(f)}&type=statuses`}].sort(($,J)=>$.type===p?-1:J.type===p?1:0).map($=>e(ye,{to:$.to,children:$.label},$.type))]}),f?e(N,{children:[(!p||p==="accounts")&&e(N,{children:[p!=="accounts"&&e("h2",{class:"timeline-header",children:[e(m,{id:"bPwFdf"})," ",e(ye,{to:`/search?q=${encodeURIComponent(f)}&type=accounts`,children:e(I,{icon:"arrow-right",size:"l",alt:s({id:"V1fa9u"})})})]}),S.length>0?e(N,{children:[e("ul",{class:"timeline flat accounts-list",children:S.map($=>e("li",{children:e(gt,{account:$,instance:a,showStats:!0,relationship:q[$.id]})},$.id))}),p!=="accounts"&&e("div",{class:"ui-state",children:e(ye,{class:"plain button",to:`/search?q=${encodeURIComponent(f)}&type=accounts`,children:[e(m,{id:"BMmtZ8"})," ",e(I,{icon:"arrow-right"})]})})]}):!p&&(d==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("p",{class:"ui-state",children:e(m,{id:"YYB61U"})}))]}),(!p||p==="hashtags")&&e(N,{children:[p!=="hashtags"&&e("h2",{class:"timeline-header",children:[e(m,{id:"VwUsHI"})," ",e(ye,{to:`/search?q=${encodeURIComponent(f)}&type=hashtags`,children:e(I,{icon:"arrow-right",size:"l",alt:s({id:"V1fa9u"})})})]}),C.length>0?e(N,{children:[e("ul",{class:"link-list hashtag-list",children:C.map($=>{const{name:J,history:V}=$,ve=V?.reduce?.((we,U)=>we+ +U.uses,0);return e("li",{children:e(ye,{to:a?`/${a}/t/${J}`:`/t/${J}`,children:[e(I,{icon:"hashtag",alt:"#"}),e("span",{children:J}),!!ve&&e("span",{class:"count",children:Xe(ve)})]})},`${J}-${ve}`)})}),p!=="hashtags"&&e("div",{class:"ui-state",children:e(ye,{class:"plain button",to:`/search?q=${encodeURIComponent(f)}&type=hashtags`,children:[e(m,{id:"Nc/W5J"})," ",e(I,{icon:"arrow-right"})]})})]}):!p&&(d==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("p",{class:"ui-state",children:e(m,{id:"4MFM3P"})}))]}),(!p||p==="statuses")&&e(N,{children:[p!=="statuses"&&e("h2",{class:"timeline-header",children:[e(m,{id:"+owNNn"})," ",e(ye,{to:`/search?q=${encodeURIComponent(f)}&type=statuses`,children:e(I,{icon:"arrow-right",size:"l",alt:s({id:"V1fa9u"})})})]}),v.length>0?e(N,{children:[e("ul",{class:"timeline",children:v.map($=>e("li",{children:e(ye,{class:"status-link",to:a?`/${a}/s/${$.id}`:`/s/${$.id}`,children:e(je,{status:$})})},$.id))}),p!=="statuses"&&e("div",{class:"ui-state",children:e(ye,{class:"plain button",to:`/search?q=${encodeURIComponent(f)}&type=statuses`,children:[e(m,{id:"LYCgej"})," ",e(I,{icon:"arrow-right"})]})})]}):!p&&(d==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e("p",{class:"ui-state",children:e(m,{id:"Hzi9AA"})}))]}),!!p&&(d==="default"?g?e($t,{onChange:$=>{$&&ee()},children:e("button",{type:"button",class:"plain block",onClick:()=>ee(),style:{marginBlockEnd:"6em"},children:e(m,{id:"uXRAkV"})})}):e("p",{class:"ui-state insignificant",children:e(m,{id:"2EYeAZ"})}):d==="loading"&&e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}))]}):d==="loading"?e("p",{class:"ui-state",children:e(Be,{abrupt:!0})}):e(N,{children:[e("p",{class:"ui-state insignificant",children:e(m,{id:"fGn1Hk"})}),e(Au,{})]})]})]})})}const Eu=20,_c=600*1e3,Ru=Ct(n=>n.v1.trends.links.list().values().next(),{expires:_c}),Lu=Ct(n=>n.v1.trends.tags.list().values().next(),{expires:_c});function $u(n){return Qe("@pixelfed/trending")?n.pixelfed.v2.discover.posts.trending.list({range:"daily"}).values():n.v1.trends.statuses.list({limit:Eu}).values()}function Mu(n,i){return n.v1.timelines.link.list(i).values()}function Ic({columnMode:n,...i}){const{_:s}=ne(),o=We(E),c=n?{}:qt(),{masto:a,instance:u}=oe({instance:i?.instance||c.instance}),{masto:d,instance:l}=oe(),r=s({id:"cI3UEs",values:{instance:u}});et(r,"/:instance?/trending");const h=K(),f=u===l,[p,y]=R([]),[g,w]=R([]),k=K();async function b(te){if(te||!k.current){if(k.current=$u(a),Qe("@mastodon/trending-hashtags"))try{const{value:j}=await Lu(a);j?.length&&y(j)}catch{}if(Qe("@mastodon/trending-links"))try{const{value:j}=await Ru(a,u),W=j?.filter?.($=>$.type==="link");W?.length&&w(W)}catch{}}const Z=await k.current.next();let{value:X}=Z;return X?.length&&(te&&(h.current=X[0].id),X.forEach(j=>{Je(j,u)})),{...Z,value:X}}const[v,_]=R(!1),S=K(),[x,C]=R(null),A=!!x,L=K(),P=f&&Qe("@mastodon/trending-link-posts");G(()=>{x&&L.current&&L.current.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})},[x]);const q=K();async function z(te){(te||!S.current)&&(_(!0),S.current=Mu(a,{url:x})),q.current=x;const Z=await S.current.next();let{value:X}=Z;return X?.length&&(X=Gt(X,"public"),X.forEach(j=>{Je(j,u)})),q.current===x&&_(!1),{...Z,value:X}}async function H(){try{const te=await a.v1.trends.statuses.list({limit:1}).values().next();let{value:Z}=te;return Z=Gt(Z,"public"),Z?.length&&Z[0].id!==h.current?(h.current=Z[0].id,!0):!1}catch{return!1}}const ee=Ce(()=>e(N,{children:[!!p.length&&e("div",{class:"filter-bar expandable",children:[e(I,{icon:"chart",class:"insignificant",size:"l"}),p.map((te,Z)=>{const{name:X,history:j}=te,W=j.reduce(($,J)=>$+ +J.uses,0);return e(ye,{to:`/${u}/t/${X}`,children:[e("span",{dir:"auto",children:[e("span",{class:"more-insignificant",children:"#"}),X]}),e("span",{class:"filter-count",children:Xe(W)})]},X)})]}),!!g.length&&e("div",{class:"links-bar",children:[e("header",{children:e("h3",{children:e(m,{id:"9veeTb"})})}),g.map(te=>{const{authors:Z,authorName:X,authorUrl:j,blurhash:W,description:$,height:J,image:V,imageDescription:ve,language:we,providerName:U,providerUrl:Y,publishedAt:fe,title:be,url:Ie,width:ze}=te,_e=Z?.[0]?.account?.id?Z[0].account:null,xe=be.length<30,Ae=!!(X||_e),qe=Ki(Ie);let Ue;if(W){const He=Zi(W),Ge=us(He);Ue=ds([.6,Ge[1],Ge[2]])}return e("div",{children:[e("a",{ref:x===Ie?L:null,href:Ie,target:"_blank",rel:"noopener",class:`link-block ${A?x===Ie?"active":"inactive":""}`,style:Ue?{"--accent-color":`rgb(${Ue.join(",")})`,"--accent-alpha-color":`rgba(${Ue.join(",")}, 0.4)`}:{},children:e("article",{children:[e("figure",{children:e("img",{src:V,alt:ve,width:ze,height:J,loading:"lazy"})}),e("div",{class:"article-body",children:[e("header",{children:[e("div",{class:"article-meta",children:[e("span",{class:"domain",children:qe})," ",!!fe&&e(N,{children:"· "}),!!fe&&e(N,{children:e(Tt,{datetime:fe,format:"micro"})})]}),!!be&&e("h1",{class:"title",lang:we,dir:"auto",title:be,children:be})]}),!!$&&e("p",{class:`description ${Ae&&!xe?"":"more-lines"}`,lang:we,dir:"auto",title:$,children:$}),Ae&&e(N,{children:[e("hr",{}),e("p",{class:"byline",children:e("small",{children:e(m,{id:"aavdrC",values:{0:_e?e(mt,{account:_e,showAvatar:!0}):j?e("a",{href:j,target:"_blank",rel:"noopener",children:X}):X}})})})]})]})]})}),P&&e("button",{type:"button",class:"small plain4 block",onClick:()=>{C(Ie)},disabled:Ie===x,children:[e(I,{icon:"comment2"})," ",e("span",{children:e(m,{id:"/bZzdR"})})," ",e(I,{icon:"chevron-down"})]})]},Ie)})]}),P&&!!g.length&&e("div",{class:`timeline-header-block ${A?"blended":""}`,children:A?e(N,{children:[e("div",{style:{width:50,flexShrink:0,textAlign:"center"},children:v?e(Be,{abrupt:!0}):e("button",{type:"button",class:"light",onClick:()=>{C(null)},children:e(I,{icon:"x",alt:s({id:"9Q/4xJ"})})})}),e("p",{children:e(m,{id:"BATCqf",values:{0:x.replace(/^https?:\/\/(www\.)?/i,"").replace(/\/$/,"")},components:{0:e("span",{class:"link-text"})}})})]}):e("p",{class:"insignificant",children:e(m,{id:"Vosm4k"})})})]}),[p,g,x,v]);return e(Pt,{title:r,titleComponent:e("h1",{class:"header-double-lines",children:[e("b",{children:e(m,{id:"4/iCqx"})}),e("div",{children:u})]}),id:"trending",instance:u,emptyText:s({id:"6HA9+s"}),errorText:s({id:"scd9lw"}),fetchItems:A?z:b,checkForUpdates:A?void 0:H,checkForUpdatesInterval:300*1e3,useItemID:!0,headerStart:e(N,{}),boostsCarousel:o.settings.boostsCarousel,filterContext:"public",timelineStart:ee,refresh:x,clearWhenRefresh:!0,view:A?"link-mentions":void 0,headerEnd:e(ft,{portal:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(I,{icon:"more",size:"l",alt:s({id:"2FYpfJ"})})}),children:[e(ge,{onClick:()=>{let te=prompt(s({id:"4CZnNE"}));if(!/\./.test(te)){te&&alert(s({id:"Q5COHO"}));return}te&&(te=te.toLowerCase().trim(),location.hash=`/${te}/trending`)},children:[e(I,{icon:"bus"})," ",e("span",{children:e(m,{id:"kesYbo"})})]}),l!==u&&e(ge,{onClick:()=>{location.hash=`/${l}/trending`},children:[e(I,{icon:"bus"})," ",e("small",{class:"menu-double-lines",children:e(m,{id:"/AfxaA",values:{currentInstance:l},components:{0:e("b",{})}})})]})]})},u)}const eo={block:"nearest",inline:"nearest",behavior:"instant"};function Pu(){const{_:n}=ne();et(n({id:"i0qMbr"}),"/");const i=We(E),{shortcuts:s}=i,o=s.map(c=>{if(!c)return null;const{type:a,...u}=c,d={following:ps,notifications:Sc,list:fc,public:Bi,bookmarks:rc,favourites:dc,hashtag:hc,mentions:yc,trending:Ic,search:Cc}[a];return!d||a==="search"&&!u.query||a==="list"&&!u.id?null:e(d,{...u,columnMode:!0},a+JSON.stringify(u))});return Ke(["1","2","3","4","5","6","7","8","9"],c=>{try{const a=parseInt(c.key,10)-1,u=document.querySelectorAll("#columns > *")[a];u&&(u.focus(),u.scrollIntoView(eo))}catch{}},{useKey:!0,ignoreEventWhen:c=>c.metaKey||c.ctrlKey||c.altKey||c.shiftKey}),Ke(["[","]"],(c,a)=>{const u=a.keys[0],d=document.activeElement.closest("#columns > *"),l=Vt(),r=l?"]":"[",h=l?"[":"]";let f;u===r?f=d?d.previousElementSibling:document.querySelectorAll("#columns > *")[0]:u===h&&(f=d?d.nextElementSibling:document.querySelectorAll("#columns > *")[1]),f&&(f.focus(),f.scrollIntoView(eo))},{useKey:!0,ignoreEventWhen:c=>c.metaKey||c.ctrlKey||c.altKey||c.shiftKey}),e("div",{id:"columns",onContextMenu:c=>{c.target.closest(".deck > header")&&!c.target.closest("a")&&!c.target.closest("button")&&(c.preventDefault(),E.showShortcutsSettings=!0)},onFocus:()=>{const c=document.activeElement.closest("#columns > *");c&&document.querySelectorAll("#columns > *").forEach(a=>{a.classList.toggle("focus",a===c)})},children:o})}function Du(){const{_:n}=ne(),i=We(E);return __BENCHMARK.end("time-to-home"),G(()=>{(async()=>{const s=await wt.drafts.keys();if(s.length){const o=Jn();s.filter(a=>a.startsWith(o)).length&&(E.showDrafts=!0)}})()},[]),e(N,{children:(i.settings.shortcutsViewMode==="multi-column"||!i.settings.shortcutsViewMode&&i.settings.shortcutsColumnsMode)&&i.shortcuts?.length?e(Pu,{}):e(ps,{title:n({id:"i0qMbr"}),path:"/",id:"home",headerStart:!1,headerEnd:e(Nu,{})})})}function Nu(){const{_:n}=ne(),i=We(E),s=K(),[o,c]=R(void 0);return e(N,{children:[e(ye,{ref:s,to:"/notifications",class:`button plain notifications-button ${i.notificationsShowNew?"has-badge":""} ${o||""}`,onClick:a=>{a.stopPropagation(),window.matchMedia("(min-width: calc(40em))").matches&&(a.preventDefault(),c(u=>u?void 0:"open"))},children:e(I,{icon:"notification",size:"l",alt:n({id:"iDNBZe"})})}),e(zu,{state:o,anchorRef:s,onClose:()=>c(void 0)})]})}const Ou=5;function zu({anchorRef:n,state:i,onClose:s}){const{masto:o,instance:c}=oe(),a=We(E),[u,d]=R("default"),l=wc();async function r(){const k=await l.next(),b=gc(k.value);if(b?.length){b.forEach(_=>{Je(_.status,c,{skipThreading:!0})});const v=kc(b);E.notificationsLast=v[0],E.notifications=v,o.v1.markers.create({notifications:{lastReadId:v[0].id}}).catch(()=>{})}return E.notificationsShowNew=!1,E.notificationsLastFetchTime=Date.now(),k}const[h,f]=R(!1);function p(){return o.v1.followRequests.list({limit:1})}function y({skipFollowRequests:k=!1}={}){d("loading"),(async()=>{try{if(await r(),!k){const b=await p();f(!!b?.length)}d("default")}catch{d("error")}})()}const g=K(),w=52;return G(()=>{i==="open"&&(a.notificationsShowNew?g.current?.scrollTop<=w&&y({skipFollowRequests:!0}):y())},[i,a.notificationsShowNew]),e(Gi,{ref:g,menuClassName:"notifications-menu",state:i,anchorRef:n,onClose:s,portal:{target:document.body},containerProps:{onClick:()=>{g.current?.closeMenu?.()}},overflow:"auto",viewScroll:"close",position:"anchor",align:"center",boundingBoxPadding:"8 8 8 8",children:[e("header",{children:e("h2",{children:e(m,{id:"iDNBZe"})})}),e(fi.Provider,{value:"notifications",children:e("main",{children:a.notifications.length?e(N,{children:a.notifications.slice(0,Ou).map(k=>e(In,{instance:c,notification:k,disableContextMenu:!0},k._ids||k.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(m,{id:"5GFQTh"})}),e("p",{children:e("button",{type:"button",onClick:y,children:e(m,{id:"KDw4GX"})})})]})})}),e("footer",{children:[e(ye,{to:"/mentions",class:"button plain",children:[e(I,{icon:"at"})," ",e("span",{children:e(m,{id:"/bZzdR"})})]}),e(ye,{to:"/notifications",class:"button plain2",children:[h?e(m,{id:"OdVhdR",components:{0:e("span",{class:"tag collapsed"}),1:e("span",{})}}):e("b",{children:e(m,{id:"gukqfD"})})," ",e(I,{icon:"arrow-right"})]})]})]})}const Bu=lt(Du),qu=[/^\/@[^@\/]+\/(?:statuses|posts)\/([^\/]+)/i,/\/notes\/([^\/]+)/i,/^\/(?:notice|objects)\/([a-z0-9-]+)/i,/\/@[^@\/]+\/post\/([^\/]+)/i,/\/@[^@\/]+@?[^\/]+?\/([^\/]+)/i,/^\/p\/[^\/]+\/([^\/]+)/i];function xc(n){const i=URL.parse(n);if(!i)return{};const{hostname:s,pathname:o}=i;for(const c of qu){const[,a]=o.match(c)||[];if(a)return{instance:s,id:a}}return{}}function Fu(n){const{instance:i,id:s}=xc(n);return i&&s?`/${i}/s/${s}`:null}function Uu(){const i=Qt().pathname.replace(/^\//,""),s=xc(i),o=s?.instance?`/${s.instance}/s/${s.id}`:null,[c,a]=R("loading");return St(()=>{a("loading"),(async()=>{try{const{instance:u,id:d}=s;if(d){const{masto:l}=oe({instance:u});if(await l.v1.statuses.$select(d).fetch()){window.location.hash=o+"?view=full";return}}}catch{}{const{masto:u,instance:d}=oe(),l=await u.v2.search.list({q:i,limit:1,resolve:!0});if(l.statuses.length){const r=l.statuses[0];window.location.hash=`/${d}/s/${r.id}?view=full`}else if(l.accounts.length){const r=l.accounts[0];window.location.hash=`/${d}/a/${r.id}`}else o?window.location.hash=o+"?view=full":a("error")}})()},[o]),e("div",{class:"ui-state",tabIndex:"-1",children:[c==="loading"?e(N,{children:[e(Be,{abrupt:!0}),e("h2",{children:e(m,{id:"RTAr/z"})}),e("p",{children:e("a",{href:i,target:"_blank",rel:"noopener",children:i})})]}):e(N,{children:[e("h2",{children:e(m,{id:"ufzZSJ"})}),e("p",{children:e("a",{href:i,target:"_blank",rel:"noopener",children:i})})]}),e("hr",{}),e("p",{children:e(ye,{to:"/",children:e(m,{id:"iWpEwy"})})})]})}function Ku(){const{_:n}=ne();et(n({id:"h16FyT"}),"/l");const[i,s]=R("default"),[o,c]=Mt(h=>h+1,0),[a,u]=R([]);G(()=>{s("loading"),(async()=>{try{const h=await Pi();u(h),s("default")}catch{s("error")}})()},[o]);const[d,l]=R(!1),r=a.some(h=>h.exclusive);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(Ft,{}),e(ye,{to:"/",class:"button plain",children:e(I,{icon:"home",size:"l"})})]}),e("h1",{children:e(m,{id:"h16FyT"})}),e("div",{class:"header-side",children:e("button",{type:"button",class:"plain",onClick:()=>l(!0),children:e(I,{icon:"plus",size:"l",alt:n({id:"Sb2gYF"})})})})]})}),e("main",{children:a.length>0?e(N,{children:[e("ul",{class:"link-list",children:a.map(h=>e("li",{children:e(ye,{to:`/l/${h.id}`,children:[e(I,{icon:"list"})," ",e("span",{children:[h.title,h.exclusive&&e(N,{children:[" ",e(Xt,{insignificant:!0})]})]})]})}))}),a.length>1&&e("footer",{class:"ui-state",children:[r&&e("p",{children:e("small",{class:"insignificant",children:[e(Xt,{})," ",e(m,{id:"FNptcJ"})]})}),e("p",{children:e("small",{class:"insignificant",children:e(m,{id:"8prZNK",values:{0:a.length}})})})]})]}):i==="loading"?e("p",{class:"ui-state",children:e(Be,{})}):i==="error"?e("p",{class:"ui-state",children:e(m,{id:"v/l5uA"})}):e("p",{class:"ui-state",children:e(m,{id:"IvPikw"})})})]}),d&&e(Fe,{onClick:h=>{h.target===h.currentTarget&&l(!1)},children:e(ls,{list:d?.list,onClose:h=>{h.state==="success"&&c(),l(!1)}})})]})}const Hu=""+new URL("instances-Dd-nff5Z.json",import.meta.url).href;function ju(n){const i=Math.min(500,Math.floor(window.screen.width*.9)),s=Math.min(600,Math.floor(window.screen.height*.8)),o=`popup,width=${i},height=${s}`;try{const c=window.open(n,"auth-popup",o);return!c||c.closed||typeof c.closed>"u"?null:c}catch{return null}}function Vu(n){if(n&&!n.closed)try{n.close()}catch{}}function Yu(n,i,s){let o=!1;const c=d=>{d.origin===window.location.origin&&d.data&&d.data.type==="oauth-callback"&&(o=!0,u(),d.data.code?i(d.data.code):s(new Error("No authorization code received")))};window.addEventListener("message",c);const a=setInterval(()=>{(!n||n.closed)&&(clearInterval(a),o||(o=!0,u(),s(new Error("Popup was closed before authentication completed"))))},500),u=()=>{window.removeEventListener("message",c),clearInterval(a),Vu(n)};return u}const Wu={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:Gu}=Wu;function Zu(){const{_:n}=ne();et(n({id:"sQia9P"}),"/login");const i=K(),s=ke.local.get("instanceURL"),[o,c]=R("default"),[a]=_t(),u=a.get("instance"),d=a.get("submit"),[l,r]=R(u||s?.toLowerCase()||""),[h,f]=R([]),p=K();G(()=>{(async()=>{try{const S=await(await fetch(Hu)).json();f(S),p.current=new wa(S)}catch{}})()},[]);const y=_=>{_&&(async()=>{try{const x=await(await fetch(`https://${_}/.well-known/host-meta`)).text(),P=new DOMParser().parseFromString(x,"text/xml").getElementsByTagName("Link")[0].getAttribute("template"),q=URL.parse(P),{host:z}=q;_!==z&&(_=z)}catch{}ke.local.set("instanceURL",_),c("loading");try{let S=yo(_);(!S||!S.client_id||!S.client_secret)&&(S=await Ja({instanceURL:_}),Hc(_,S));const{client_id:x,client_secret:C}=S,A=await Wa({instanceURL:_}),L=jc(_);let P;if(A&&window.isSecureContext)if(x&&C){const[z,H]=await er({instanceURL:_,client_id:x,forceLogin:L});ke.sessionCookie.set("codeVerifier",H),P=z}else{alert(n({id:"ZP1FIA"})),c("default");return}else if(x&&C)P=await tr({instanceURL:_,client_id:x,forceLogin:L});else{alert(n({id:"ZP1FIA"})),c("default");return}const q=ju(P);q?Yu(q,z=>{const H=`${window.location.origin}${window.location.pathname}?code=${encodeURIComponent(z)}`;window.location.href=H},z=>{c("error")}):location.href=P,c("default")}catch{c("error")}})()},g=l?l.replace(/^https?:\/\//,"").replace(/\/+$/,"").replace(/^@?[^@]+@/,"").trim():null,w=/[^\s\r\n\t\/\\]+\.[^\s\r\n\t\/\\]+/.test(g)&&!/[\s\/\\@]/.test(g),k=g?p.current?.search(g,{limit:10})?.map(_=>_.item):[],b=w?g:k?.length?k[0]:l?h.find(_=>_.includes(l)):null,v=_=>{_.preventDefault(),y(b)};return d&&G(()=>{y(u||b)},[]),e("main",{id:"login",style:{textAlign:"center"},children:e("form",{onSubmit:v,children:[e("h1",{children:[e("img",{src:cs,alt:"",width:"80",height:"80"}),e("br",{}),e(m,{id:"sQia9P"})]}),e("label",{children:[e("p",{children:e(m,{id:"sGH11W"})}),e("input",{value:l,required:!0,type:"text",class:"large",id:"instanceURL",ref:i,disabled:o==="loading",autocorrect:"off",autocapitalize:"off",autocomplete:"off",spellCheck:!1,placeholder:n({id:"0hbkwr"}),enterKeyHint:"go",onInput:_=>{r(_.target.value)},dir:"auto"}),k?.length>0?e("ul",{id:"instances-suggestions",children:k.map((_,S)=>e("li",{children:e("button",{type:"button",class:"plain5",onClick:()=>{y(_)},children:_})}))}):e("div",{id:"instances-eg",children:e(m,{id:"/OvbEC"})})]}),o==="error"&&e("p",{class:"error",children:e(m,{id:"yCXori"})}),e("div",{children:[e("button",{disabled:o==="loading"||!l||!b,children:n(b?{id:"2xahsi",values:{selectedInstanceText:b}}:{id:"xGVfLh"})})," "]}),e(Be,{hidden:o!=="loading"}),e("hr",{}),!Gu&&e("p",{children:e("a",{href:"https://joinmastodon.org/servers",target:"_blank",children:e(m,{id:"LcOiWS"})})}),e("p",{children:e(ye,{to:"/",children:e(m,{id:"iWpEwy"})})}),e(as,{})]})})}const Xu=40;function Qu(){const{_:n}=ne(),i=We(E);et(n({id:"+GkIdc"}),"/sp");const{masto:s}=oe(),[o,c]=R([]),[a,u]=R("default"),[d,l]=Mt(f=>f+1,0),[r,h]=R(!1);return G(l,[i.reloadScheduledPosts]),G(()=>{u("loading"),(async()=>{try{const f=s.v1.scheduledStatuses.list({limit:Xu}).values(),p=[];let y;do y=(await f.next()).value,y?.length&&p.push(...y);while(y?.length);c(p)}catch{u("error")}finally{u("default")}})()},[d]),e("div",{id:"scheduled-posts-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(Ft,{}),e(ye,{to:"/",class:"button plain",children:e(I,{icon:"home",size:"l",alt:n({id:"i0qMbr"})})})]}),e("h1",{children:e(m,{id:"+GkIdc"})}),e("div",{class:"header-side",children:e(ft,{portal:!0,setDownOverflow:!0,overflow:"auto",viewScroll:"close",position:"anchor",menuButton:e("button",{type:"button",class:"plain",children:e(I,{icon:"more",size:"l",alt:n({id:"2FYpfJ"})})}),children:e(ge,{onClick:()=>{l()},children:[e(I,{icon:"refresh",size:"l"}),e("span",{children:e(m,{id:"lCF0wC"})})]})})})]})}),e("main",{children:[o.length?e("ul",{class:"posts-list",children:o.map(f=>{const{id:p,params:y,scheduledAt:g,mediaAttachments:w}=f,{inReplyToId:k,language:b,poll:v,sensitive:_,spoilerText:S,text:x,visibility:C,quotedStatusId:A,quoteApprovalPolicy:L}=y,P={id:p,inReplyToId:k,language:b,mediaAttachments:w,poll:v?{...v,expiresAt:new Date(Date.now()+v.expiresIn*1e3),options:v.options.map(q=>({title:q,votesCount:0}))}:void 0,sensitive:_,spoilerText:S,text:x,visibility:C,content:`<p>${x}</p>`,quotedStatusId:A,quoteApprovalPolicy:L};return e("li",{children:e(Ju,{status:P,scheduledAt:g,onClick:()=>{h({post:P,scheduledAt:new Date(g)})}})},p)})}):e("p",{class:"ui-state",children:a==="loading"?e(Be,{}):n({id:"mZYb1f"})}),r&&e(Fe,{onClick:f=>{f.target===f.currentTarget&&h(!1)},children:e(eh,{post:r.post,scheduledAt:r.scheduledAt,onClose:()=>h(!1)})})]})]})})}function Ju({status:n,scheduledAt:i,onClick:s}){const o=Ce(()=>{const c=(Date.parse(i)-Date.now())/36e5;return c<24?"time":c<720?"day":"month"},[i]);return e("button",{type:"button",class:"textual block",onClick:s,children:[e("div",{class:`post-schedule-meta post-schedule-${o}`,children:[e(I,{icon:o,class:"insignificant"})," ",e("span",{children:e(m,{id:"aEp6lO",values:{0:rt(i,{formatOpts:{weekday:"short",second:"numeric"}})},components:{0:e("b",{}),1:e(Tt,{datetime:i}),2:e("small",{})}})})]}),e(je,{status:n,size:"s",previewMode:!0,readOnly:!0})]})}function eh({post:n,scheduledAt:i,onClose:s}){const{masto:o,instance:c}=oe(),{_:a}=ne(),[u,d]=R("default"),[l,r]=R(),h=l&&l.getTime()!==i.getTime(),f=ka(),p=i&&i<=Date.now(),{inReplyToId:y}=n,[g,w]=R(null),{quotedStatusId:k}=n;return e("div",{id:"scheduled-post-sheet",class:"sheet",children:[e("button",{type:"button",class:"sheet-close",onClick:s,children:e(I,{icon:"x",size:"l",alt:a({id:"yz7wBu"})})}),e("header",{children:e("h2",{children:[e(m,{id:"orjBLU",components:{0:e("b",{}),1:e(Tt,{datetime:i})}}),e("br",{}),e("small",{children:rt(i,{formatOpts:{weekday:"short",second:"numeric"}})})]})}),e("main",{tabIndex:"-1",children:[!!g&&e("div",{class:"status-reply",children:e(je,{status:g,size:"s",previewMode:!0,readOnly:!0})}),e(je,{status:n,size:"s",previewMode:!0,readOnly:!0,onMediaClick:(b,v,_,S)=>{b.preventDefault(),E.showMediaModal={mediaAttachments:n.mediaAttachments,mediaIndex:v}}}),e("form",{onSubmit:b=>{b.preventDefault(),d("loading"),(async()=>{try{await o.v1.scheduledStatuses.$select(n.id).update({scheduledAt:l.toISOString()}),re(a({id:"40naR1"})),s(),d("default"),E.reloadScheduledPosts++}catch{d("error"),re(a({id:"ZM3jAs"}))}})()},children:e("footer",{children:[e("div",{class:"row",children:e("span",{children:[e(Sa,{scheduledAt:i,setScheduledAt:b=>{r(b)}})," ",e("small",{class:"ib",children:f})]})}),e("div",{class:"row",children:[e("button",{disabled:!h||u==="loading"||p,children:e(m,{id:"QqW27M"})}),e("span",{class:"grow"}),e(vt,{align:"end",menuItemClassName:"danger",confirmLabel:a({id:"09u3Kk"}),onClick:()=>{d("loading"),(async()=>{try{await oe().masto.v1.scheduledStatuses.$select(n.id).remove(),re(a({id:"/zL/Mq"})),s(),d("default"),E.reloadScheduledPosts++}catch{d("error"),re(a({id:"aOh6Md"}))}})()},children:e("button",{type:"button",class:"light danger",disabled:u==="loading"||p,children:e(m,{id:"Jb6/SB"})})})]})]})})]})]})}function th(){const{_:n}=ne(),{prevEditedAt:i,nextEditedAt:s,editedAtIndex:o,editHistoryMode:c,editHistoryRef:a,exitEditHistory:u}=Eo();return c?e("div",{class:"edit-history-controls",children:[e(I,{icon:"edit"}),e("b",{class:"edit-history-heading",children:n({id:"HSA2au"})}),e("span",{class:"spacer"}),e("span",{class:"edit-history-pagination",children:[e("button",{type:"button",class:"plain4",onClick:()=>{i()},disabled:!c||o+1>=a.current.length,children:e(I,{icon:"chevron-left",alt:n({id:"DHhJ7s"})})})," ",a.current.length-o," /"," ",a.current.length," ",e("button",{type:"button",class:"plain4",onClick:()=>{s()},disabled:!c||o<=0,children:e(I,{icon:"chevron-right",alt:n({id:"hXzOVo"})})})]}),e("button",{type:"button",class:"plain3",onClick:()=>{u()},children:e(I,{icon:"exit",alt:n({id:"ydzS9x"})})})]}):null}const nh={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:to}=nh,zn=40,ih=10,sh=5;let qi={},Wn={},Gn={};function Zn(n){delete Wn[n],delete Gn[n]}const mn={block:"nearest",inline:"center",behavior:"instant"},no=".status-link:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *), .status-focus:not(details:not([open]) > summary ~ *, details:not([open]) > summary ~ * *)",io=/\/s\//i;function oh(n){const{id:i}=n,{masto:s,instance:o}=oe({instance:n.instance}),c=We(E),[a,u]=_t(),d=a.get("media"),l=a.get("media-only"),r=parseInt(d||l,10);let h=r>0;const f=a.get("mediaStatusID"),p=go(f,o);f&&!p&&(h=!1);const y=h&&!!l,g=ht(i,o),[w,k]=R(E.statuses[g]);G(()=>{E.statuses[g]&&k(E.statuses[g])},[g]),G(()=>{if(!w||!w.url)return;const C=document.querySelector('link[rel="canonical"]');let A=null,L;return C?(A=C.href,C.href=w.url):(L=document.createElement("link"),L.rel="canonical",L.href=w.url,document.head.appendChild(L)),()=>{C&&A?C.href=A:L&&document.head.removeChild(L)}},[w?.url]);const b=Ce(()=>{const{prevLocation:C}=E,A=(C?.pathname||"")+(C?.search||""),L=bn("/:instance/s/:id",A)||bn("/s/:id",A);return!A||L?"/":A},[]);G(()=>{!w&&h&&(async()=>{try{const C=await s.v1.statuses.$select(i).fetch();Je(C,o),k(C)}catch{alert("Unable to load post."),location.hash=b}})()},[h]);const v=f?c.statuses[ht(f,o)]?.mediaAttachments:w?.mediaAttachments,_=()=>window.matchMedia("(min-width: calc(40em + 350px))").matches?"large":"small",S=st(()=>{_()==="small"&&c.prevLocation?history.back():y?location.hash=b:(a.delete("media"),a.delete("mediaStatusID"),u(a))},[y,b,c.prevLocation]),x=st((C,A,L,P)=>{if(_()==="large"&&!y){S();return}if(h&&document.startViewTransition){const q=L[A],{id:z,blurhash:H,url:ee}=q,te=Ca(z||H||ee),X=[...document.querySelectorAll(`.status .media [data-view-transition-name="${te}"]`)].filter?.(W=>{const $=W.getBoundingClientRect();return $.top<window.innerHeight&&$.bottom>0&&$.left<window.innerWidth&&$.right>0}),j=X.length===1?X[0]:X.find(W=>!!W.closest(".status-deck"));j?document.startViewTransition(()=>{j.style.viewTransitionName=te,P?.current&&P.current.querySelectorAll(".media img, .media video")?.forEach($=>{$.style.viewTransitionName=""}),S()}).ready.finally(()=>{j.style.viewTransitionName="",j.dataset.viewTransitioned=te}):S()}else S()},[h,y]);return G(()=>{let C=setTimeout(()=>{const A=document.querySelector(".carousel");A&&A.focus()},100);return()=>clearTimeout(C)},[y]),G(()=>{const C=document.querySelectorAll(".deck-container");return C.forEach(A=>{A.setAttribute("inert","")}),()=>{C.forEach(A=>{A.removeAttribute("inert")})}},[]),e("div",{class:"deck-backdrop",children:[h?v?.length?e(Go,{mediaAttachments:v,statusID:f||i,instance:o,lang:w?.language,index:r-1,onClose:x}):e("div",{class:"media-modal-container loading",children:e(Be,{abrupt:!0})}):e(ye,{to:b}),!y&&e(_a,{statusID:i,children:e(ah,{id:i,instance:n.instance,closeLink:b})})]})}function ch(n){const{linkable:i,to:s,onClick:o,...c}=n;return i?e(ye,{class:"status-link",to:s,onClick:o,...c}):e("div",{class:"status-focus",tabIndex:0,...c})}function so(n,i){return Date.parse(n.createdAt)-Date.parse(i.createdAt)}const oo=1e3*60*60*24*30;function ah({id:n,closeLink:i="/",instance:s}){const{_:o}=ne(),[c,a]=_t(),u=c.get("media"),d=c.get("mediaStatusID"),l=parseInt(u,10)>0,r=K(!E.prevLocation&&(history.length===1||"navigation"in window&&navigation?.entries?.()?.length===1)),[h,f]=R(c.get("view")||r.current?"full":null),p=!!parseInt(c.get("translate")),{masto:y,instance:g}=oe({instance:s}),{masto:w,instance:k,authenticated:b}=oe(),v=g===k,_=We(E),[S,x]=R([]),[C,A]=R("default"),L=K(),P=ht(n,g),q=K(0),z=K();G(()=>{z.current?.focus()},[]),G(()=>{const D=Ro(()=>{if(!z.current)return;const{scrollTop:se}=z.current;C!=="loading"&&(Gn[n]=se)},50);return z.current?.addEventListener("scroll",D,{passive:!0}),D(),()=>{D.cancel(),z.current?.removeEventListener("scroll",D)}},[n,C!=="loading"]);const{editHistoryMode:H,initEditHistory:ee,editedAtIndex:te,editHistoryRef:Z}=Eo(),X=K(),j=K(),[W,$]=R(0),J=K(null),V=()=>{if(!J.current)return;let{ancestors:D,descendants:se,heroStatus:T}=J.current;if(H&&se?.length){const F=Z.current[te],de=Date.parse(F.createdAt),De=Z.current[te-1],Me=De?Date.parse(De.createdAt):null;se=se.filter(nt=>{const tt=Date.parse(nt.editedAt||nt.createdAt);return tt>=de&&(!Me||tt<=Me)})}D.sort(so),se.sort(so),q.current=se?.length||0;const B=new Set;D.forEach(F=>{Je(F,g,{skipThreading:!0}),F.inReplyToId&&!D.find(de=>de.id===F.inReplyToId)&&B.add(F.inReplyToId)}),T.inReplyToId&&!D.find(F=>F.id===T.inReplyToId)&&B.add(T.inReplyToId),B.forEach(F=>{const de=D.find(De=>De.inReplyToId===F)||(T.inReplyToId===F?T:null);if(de){const De={id:F,ghost:{inReplyToAccountId:de.inReplyToAccountId}};if(de===T)D.push(De);else{const Me=D.indexOf(de);D.splice(Me,0,De)}}});const Q=new Set,ce=D.every(F=>F.ghost||F.account.id===T.account.id),O=[];se.forEach(F=>{if(Je(F,g,{}),F.inReplyToId&&!se.find(de=>de.id===F.inReplyToId)&&F.inReplyToId!==T.id&&Q.add(F.inReplyToId),F.inReplyToAccountId===F.account.id)O.push(F);else if(F.inReplyToId===T.id)O.push(F);else if(!F.inReplyToAccountId&&O.find(de=>de.id===F.inReplyToId&&de.account.id===T.account.id)&&F.account.id===T.account.id)O.push(F);else{const de=se.find(De=>De.id===F.inReplyToId);de&&(de.__replies||(de.__replies=[]),de.__replies.push(F))}}),O.sort((F,de)=>{const De=T.account.id;return F.account.id===De&&de.account.id!==De?-1:de.account.id===De&&F.account.id!==De?1:0}),Q.size;let le=1;function Ee(F,de){const De=de+1;return De>le&&(le=de),F?.map(Me=>({id:Me.id,account:Me.account,repliesCount:Me.repliesCount,content:Me.content,weight:vn(Me),level:De,replies:Ee(Me.__replies,De)}))}const pe=O.map(F=>({id:F.id,account:F.account,accountID:F.account.id,descendant:!0,thread:F.account.id===T.account.id,weight:vn(F),level:1,replies:Ee(F.__replies,1),createdAt:F.createdAt}));return{allStatuses:[...D.map(F=>({id:F.id,ancestor:!0,ghost:F.ghost,isThread:ce&&!F.ghost,accountID:F.account?.id,account:F.account,repliesCount:F.repliesCount,weight:F.ghost?0:vn(F),createdAt:F.createdAt})),{id:n,accountID:T.account.id,weight:vn(T),createdAt:T.createdAt},...pe],ancestorsIsThread:ce,mappedNestedDescendants:pe}},ve=({reloadHero:D}={})=>{A("loading");let se;const T=Wn[n];if(T){const B=T.filter(Q=>E.statuses[P]);x(B)}else x([{id:n}]);return(async()=>{const B=()=>ws(()=>y.v1.statuses.$select(n).fetch(),{retries:4}),Q=ws(()=>y.v1.statuses.$select(n).context.fetch(),{retries:8}),ce=!!_.statuses[P];let O=_.statuses[P];if(!(ce&&!D))try{O=await B(),Je(O,g),await new Promise(le=>{setTimeout(le,100)})}catch{A("error");return}try{const le=await Q,{ancestors:Ee}=le;J.current={...le,heroStatus:O};const{allStatuses:pe,ancestorsIsThread:Le,mappedNestedDescendants:F}=V(),de=Ee.length&&!Le?[]:F.filter(nt=>nt.thread),De=(Le?Ee.length:0)+de.length;De>0&&De<100&&$(De+1),A("default"),X.current={offsetTop:L.current?.offsetTop,scrollTop:z.current?.scrollTop};const Me=Ee.length||0;Me>=_e&&xe(Me+1),x(pe),Wn[n]=pe,Vc(O,g)}catch{A("error")}})(),j.current=Date.now(),()=>{clearTimeout(se)}};G(ve,[n,y]),G(()=>{try{const{allStatuses:D}=V();x(D)}catch{}},[H,te]);const[we,U]=R(!1);G(()=>{let D=setInterval(()=>{const se=Date.now();j.current&&se-j.current>=6e4&&U(!0)},6e4);return()=>{clearInterval(D)}},[]),St(()=>{if(!S.length)return;const D=Gn[n];if(D)z.current.scrollTop=D;else if(X.current){const se={offsetTop:L.current?.offsetTop,scrollTop:z.current?.scrollTop},T=se.offsetTop-X.current.offsetTop+se.scrollTop;z.current.scrollTop=T}else S.length===1&&(z.current.scrollTop=0);X.current=null},[S]),G(()=>{_.reloadStatusPage<=0||(async()=>{try{const{instanceURL:D}=wn(),se=`https://${D}/api/v1/statuses/${n}/context`;return await(await caches.open("api")).delete(se,{ignoreVary:!0}),ve({reloadHero:!0})}catch{}})()},[_.reloadStatusPage]),G(()=>()=>{Gn={},E.reloadStatusPage=0,Wn={},qi={},Fi.clear()},[]);const Y=_.statuses[P]||_.statuses[n],fe=Ce(()=>{if(!Y)return"";const{account:D}=Y,se=document.createElement("div");return se.innerHTML=D.displayName,se.innerText.trim()},[Y]),be=Ce(()=>{if(!Y)return"";let D=ui(Y);return D.length>64&&(D=D.slice(0,64)+"…"),D},[Y]);et(fe&&be?`${fe}: "${be}"`:o({id:"post.title"}),"/:instance?/s/:id");const Ie=Ce(()=>{if(!Y)return;const{url:D}=Y;if(D)return URL.parse(D)?.hostname},[Y]),ze=Ce(()=>{if(Ie)return Ie===g},[Ie,g]),[_e,xe]=R(zn),Ae=Ce(()=>S.length-_e,[S.length,_e]),qe=S.some(D=>D.descendant),Ue=S.filter(D=>D.ancestor),[He,Ge]=R(!0),ae=Ce(()=>{if(!L.current||He)return null;const{top:D}=L.current.getBoundingClientRect();return D>0?"down":"up"},[He]);Ke("esc",()=>{location.hash=i},{enabled:!l,ignoreEventWhen:D=>!!document.querySelector("#modal-container > *")||D.metaKey||D.ctrlKey||D.altKey||D.shiftKey,useKey:!0}),Ke("backspace",()=>{location.hash=i},{useKey:!0,ignoreEventWhen:D=>D.metaKey||D.ctrlKey||D.altKey||D.shiftKey}),Ke("j",()=>{const D=document.activeElement.closest(".status-link, .status-focus"),se=D?.getBoundingClientRect(),T=Array.from(z.current.querySelectorAll(no));if(D&&se.top<z.current.clientHeight&&se.bottom>0){const B=T.indexOf(D);let Q=T[B+1];Q&&(Q.focus(),Q.scrollIntoView(mn))}else{const B=T.find(Q=>{const ce=Q.getBoundingClientRect();return ce.top>=44&&ce.left>=0});B&&(B.focus(),B.scrollIntoView(mn))}},{useKey:!0,ignoreEventWhen:D=>D.metaKey||D.ctrlKey||D.altKey||D.shiftKey}),Ke("k",()=>{const D=document.activeElement.closest(".status-link, .status-focus"),se=D?.getBoundingClientRect(),T=Array.from(z.current.querySelectorAll(no));if(D&&se.top<z.current.clientHeight&&se.bottom>0){const B=T.indexOf(D);let Q=T[B-1];Q&&(Q.focus(),Q.scrollIntoView(mn))}else{const B=T.find(Q=>{const ce=Q.getBoundingClientRect();return ce.top>=44&&ce.left>=0});B&&(B.focus(),B.scrollIntoView(mn))}},{useKey:!0,ignoreEventWhen:D=>D.metaKey||D.ctrlKey||D.altKey||D.shiftKey}),Ke("x",()=>{const D=document.activeElement.closest(".status-link, .status-focus");if(D){const se=D.nextElementSibling;se&&se.tagName.toLowerCase()==="details"&&(se.open=!se.open)}},{useKey:!0,ignoreEventWhen:D=>D.metaKey||D.ctrlKey||D.altKey||D.shiftKey}),Ke("o",()=>{const D=document.activeElement.closest(".status-link, .status-focus");if(D){const se=D.querySelector("a.media:not(.status-card a.media)");se&&se.click()}},{useKey:!0,ignoreEventWhen:D=>D.metaKey||D.ctrlKey||D.altKey||D.shiftKey});const[$e,Se]=R(!1),ie=K(l?"media+status":"status"),Oe=st((D,se,T,B)=>{D.preventDefault(),D.stopPropagation(),a({media:se+1,mediaStatusID:B.id})},[n]),Te=st((D,se)=>{Zn(se.id)},[]);G(()=>{let D;return d&&l&&(D=setTimeout(()=>{const se=z.current?.querySelector(`.status-link[href*="/${d}"]`);se&&se.scrollIntoView(mn)},400)),()=>{clearTimeout(D)}},[d,l]);const Re=st((D,se)=>{const{id:T,ancestor:B,ghost:Q,isThread:ce,descendant:O,thread:le,replies:Ee,repliesCount:pe,weight:Le,level:F}=D,de=T===n;return e("li",{ref:de?L:null,class:`${B?"ancestor":""} ${O?"descendant":""} ${le?"thread":""} ${de?"hero":""}`,children:[de?e(N,{children:[e($t,{threshold:.1,onChange:Me=>{queueMicrotask(()=>{requestAnimationFrame(()=>{Ge(Me)})})},class:"status-focus",tabIndex:0,children:e(je,{statusID:T,instance:g,withinContext:!0,size:"l",enableTranslate:!0,forceTranslate:p})}),C!=="loading"&&!b?e("div",{class:"post-status-banner",children:[e("p",{children:e(m,{id:"Vyeh4F"})}),e(ye,{to:to?`/login?instance=${to}&submit=1`:"/login",class:"button",children:e(m,{id:"sQia9P"})})]}):!v&&e("div",{class:"post-status-banner",children:[e("p",{children:e(m,{id:"BrLbQp",values:{instance:g},components:{0:e("b",{})}})}),e("button",{type:"button",disabled:C==="loading",onClick:()=>{A("loading"),(async()=>{try{const Me=await w.v2.search.list({q:Y.url,type:"statuses",resolve:!0,limit:1});if(Me.statuses.length){const nt=Me.statuses[0];location.hash=k?`/${k}/s/${nt.id}`:`/s/${nt.id}`}else throw new Error("No results")}catch(Me){A("default"),alert(o({id:"DnepCE",values:{e:Me}}))}})()},children:[e(I,{icon:"transfer"})," ",e(m,{id:"jtQUzv"})]})]})]}):e(ch,{linkable:!Q&&(ce||B),to:g?`/${g}/s/${T}`:`/s/${T}`,onClick:()=>{Zn(T)},children:[Q?e(je,{statusID:T,instance:g,withinContext:!0,size:"m",ghost:Q}):se===0&&B?e($t,{threshold:.5,onChange:Me=>{queueMicrotask(()=>{requestAnimationFrame(()=>{Se(Me)})})},children:e(je,{statusID:T,instance:g,withinContext:!0,size:le||B?"m":"s",enableTranslate:!0,onMediaClick:Oe,onStatusLinkClick:Te})}):e(je,{statusID:T,instance:g,withinContext:!0,size:le||B?"m":"s",enableTranslate:!0,onMediaClick:Oe,onStatusLinkClick:Te,showActionsBar:!!O}),B&&pe>1&&e("div",{class:"replies-link",children:[e(I,{icon:"comment2",alt:o({id:"N8UzTV"})})," ",e("span",{title:pe,children:Xe(pe)})]})," "]}),O&&Ee?.length>0&&e(Ac,{instance:g,replies:Ee,hasParentThread:le,level:F,accWeight:Le,openAll:q.current<ih,parentLink:{to:g?`/${g}/s/${T}`:`/s/${T}`,onClick:()=>Zn(T)}}),C==="loading"&&de&&!!Y?.repliesCount&&!qe&&e("div",{class:"status-loading",children:e(Be,{abrupt:Y.repliesCount>=3})}),C==="error"&&de&&!!Y?.repliesCount&&!qe&&e("div",{class:"status-error",children:[e(m,{id:"HQJU6W"}),e("br",{}),e("button",{type:"button",class:"plain",onClick:()=>{E.reloadStatusPage++},children:e(m,{id:"KDw4GX"})})]})]},T)},[n,g,C,b,v,p,Oe,Te,qe]),M=Ce(()=>{if("navigation"in window&&navigation?.entries){const D=navigation.entries()[navigation.currentEntry.index-1];if(D?.url)return io.test(D.url)}return io.test(E.prevLocation?.pathname)},[P]),me=Ce(()=>{if(!Ae)return[];const D=[];function se(T){D.push(T.id),T.replies&&T.replies.forEach(se)}return S.slice(_e).forEach(se),D.map(T=>ht(T,g))},[Ae,S,_e,g]);function Ne(D){if(D<12)return he._({id:"DqsEm+",values:{months:D}});{const se=Math.floor(D/12);return he._({id:"24w+FD",values:{years:se}})}}const Pe=Ce(()=>{const D=[],se=S.slice(0,_e);for(let T=0;T<se.length;T++){const B=se[T];if(T>0){const Q=se[T-1],{createdAt:ce,descendant:O,thread:le,id:Ee}=B;if(Q?.createdAt&&ce){const pe=Date.parse(ce);if(isFinite(pe)&&pe>oo){const Le=Date.parse(Q.createdAt);if(Le&&isFinite(Le)){const{ancestor:F,id:de}=Q,Me=~~((pe-Le)/oo);Me>0&&D.push(e("li",{style:{"--time-gap-range":Math.min(12,Me)},class:`time-gap ${F?"ancestor":""} ${O?"descendant":""} ${le?"thread":""}`,children:Ne(Me)},`time-gap-${Ee}-${de}`))}}}}D.push(Re(B,T))}return D},[S,_e,Re,H,te]);return G(()=>{let D=setTimeout(()=>{if(!L.current)return;const se=L.current.querySelector(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)");se&&se.click()},1e3);return()=>clearTimeout(D)},[n]),e(Ia.Provider,{value:W,children:e("div",{tabIndex:"-1",ref:z,class:`status-deck deck contained ${S.length>1?"padded-bottom":""} ${ie.current==="status"&&!r.current?"slide-in":""} ${h?`deck-view-${h}`:""} ${H?"edit-history-mode":""}`,style:H?{"--edit-history-percentage":`${te/(Z.current.length-1)}`}:void 0,onAnimationEnd:D=>{ie.current==="status"&&(ie.current=null)},children:[e("header",{class:`${C==="loading"?"loading":""}`,onDblClick:D=>{E.reloadStatusPage++},children:e("div",{class:"header-grid header-grid-2",children:[e("h1",{children:[M&&e("button",{type:"button",class:"plain deck-back",onClick:()=>{history.back()},children:e(I,{icon:"chevron-left",size:"xl",alt:o({id:"iH8pgl"})})}),!He&&Y&&C!=="loading"?e(N,{children:[e("span",{class:"hero-heading",children:[e(mt,{account:Y.account,instance:g,showAvatar:!0,short:!0})," ",e("span",{class:"insignificant",children:["•"," ",e(Tt,{datetime:Y.createdAt,format:"micro"})]})]})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:D=>{D.preventDefault(),D.stopPropagation(),L.current.scrollIntoView({behavior:"smooth",block:"start"})},title:o({id:"NCy+Nw"}),children:e(I,{icon:ae==="down"?"arrow-down":"arrow-up"})})]}):e(N,{children:[e(m,{id:"post.title"})," ",e("button",{type:"button",class:"ancestors-indicator light small",onClick:D=>{D.preventDefault(),D.stopPropagation(),z.current.scrollTo({top:0,behavior:"smooth"})},hidden:!Ue.length||$e,title:o({id:"R8CUl0",values:{0:Ue.length}}),children:[e(I,{icon:"arrow-up"}),Ue.filter(D=>!D.ghost).filter((D,se,T)=>T.findIndex(B=>B.accountID===D.accountID)===se).slice(0,3).map(D=>e(ut,{url:D.account.avatarStatic||D.account.avatar,alt:D.account.displayName,squircle:D.account?.bot},D.account.id)),Ue.length>3&&e(N,{children:[" ",e("span",{class:"insignificant",children:Xe(Ue.length)})]})]})]})]}),e("div",{class:"header-side",children:[e("button",{type:"button",class:"plain4 button-switch-view",style:{display:h==="full"?"":"none"},onClick:()=>{f(null),c.delete("media"),c.delete("media-only"),c.delete("view"),a(c)},title:o({id:"+/xYEI"}),children:e(I,{icon:"layout4",size:"l"})}),we&&e("button",{type:"button",class:"plain button-refresh",onClick:()=>{E.reloadStatusPage++,U(!1)},children:e(I,{icon:"refresh",size:"l",alt:o({id:"lCF0wC"})})}),e(ft,{align:"end",portal:{target:z.current},menuButton:e("button",{type:"button",class:"button plain4",children:e(I,{icon:"more",alt:o({id:"2FYpfJ"}),size:"xl"})}),children:[e(ge,{disabled:C==="loading",onClick:()=>{E.reloadStatusPage++},children:[e(I,{icon:"refresh"}),e("span",{children:e(m,{id:"lCF0wC"})})]}),e(ge,{className:"menu-switch-view",onClick:()=>{f(h==="full"?null:"full"),c.delete("media"),c.delete("media-only"),h==="full"?c.delete("view"):c.set("view","full"),a(c)},children:[e(I,{icon:{"":"layout5",full:"layout4"}[h||""]}),e("span",{children:o(h==="full"?{id:"+/xYEI"}:{id:"2LiWsE"})})]}),e(ge,{onClick:()=>{Array.from(z.current.querySelectorAll(".spoiler-button:not(.spoiling), .spoiler-media-button:not(.spoiling)")).forEach(se=>{se.click()})},children:[e(I,{icon:"eye-open"})," ",e("span",{children:e(m,{id:"8r8KmB"})})]}),e(Ye,{}),e(Xi,{className:"plain",children:e(m,{id:"Rsjgm0"})}),e(ge,{disabled:!Ie||ze,onClick:()=>{const D=Fu(Y.url);D?location.hash=D:alert(o({id:"9J6biQ"}))},children:[e(I,{icon:"transfer"}),e("small",{class:"menu-double-lines",children:o(Ie?{id:"yi60j9",values:{0:li.toUnicode(Ie)}}:{id:"rWTcqf"})})]}),e(ge,{disabled:!v||C==="loading"||!Y?.editedAt||!q.current,onClick:ee,children:[e(I,{icon:"edit"}),e("span",{children:o({id:"OqaQnE"})})]})]}),e(ye,{class:"button plain deck-close",to:i,children:e(I,{icon:"x",size:"xl",alt:o({id:"yz7wBu"})})})]})]})}),e(th,{}),S.length&&Y?e("ul",{class:`timeline flat contextual grow ${C==="loading"?"loading":""}`,children:[Pe,Ae>0&&e("li",{class:"descendant descendant-more",children:e("button",{type:"button",class:"plain block show-more",disabled:C==="loading",onClick:()=>xe(D=>D+zn),style:{marginBlockEnd:"6em"},"data-state-post-ids":me.join(" "),children:[e("div",{class:"ib avatars-bunch",children:S.slice(_e,_e+5).map(D=>e(ut,{url:D.account.avatarStatic},D.id))})," ",e("div",{class:"ib",children:[e(m,{id:"uXRAkV"})," ",e("span",{class:"tag",children:Ae>zn?`${zn}+`:Ae})]})]})})]}):e(N,{children:[C==="loading"&&e("ul",{class:"timeline flat contextual grow loading",children:e("li",{children:e(je,{skeleton:!0,size:"l"})})}),C==="error"&&e("p",{class:"ui-state",children:[e(m,{id:"JWxodU"}),e("br",{}),e("br",{}),e("button",{type:"button",onClick:()=>{E.reloadStatusPage++},children:e(m,{id:"KDw4GX"})})]})]})]})})}function Ac({replies:n,instance:i,hasParentThread:s,level:o,accWeight:c,openAll:a,parentLink:u}){const{_:d}=ne(),[l,r]=_t(),h=A=>A.reduce((L,P)=>{const{repliesCount:q,replies:z}=P,H=z?.length||q;return L+H+h(z||[])},0),f=n.length+h(n),p=n.length===f,y=n.map(A=>A.account).filter((A,L,P)=>P.findIndex(q=>q.id===A.id)===L).slice(0,3),g=Ce(()=>n?.reduce((A,L)=>A+L?.weight,c),[c,n?.length]);let w=!1;(a||g<=sh||!s&&f===1&&vn(n[0])<2)&&(w=!0);const k=qi[n[0].id],b=st((A,L,P,q)=>{A.preventDefault(),A.stopPropagation(),r({media:L+1,mediaStatusID:q.id})},[]),v=K();St(()=>{function A(L){L.target.dataset.scrollLeft=L.target.scrollLeft}return v.current?.addEventListener("scroll",A,{passive:!0}),()=>{v.current?.removeEventListener("scroll",A)}},[]);const[_,S]=R(k||w);G(()=>{let A;return!k&&!w&&(A=setTimeout(()=>S(!0),100)),()=>clearTimeout(A)},[k,w]);const x=w?"div":"details",C=x==="details";return e(x,{ref:v,class:"replies",open:C?k||w:void 0,onToggle:C?A=>{const{open:L}=A.target;qi[n[0].id]=L}:void 0,style:{"--comments-level":o},"data-comments-level":o,"data-comments-level-overflow":o>4,children:[!w&&e("summary",{class:"replies-summary",hidden:w,children:[e("span",{class:"avatars",children:y.map(A=>e(ut,{url:A.avatarStatic,title:`${A.displayName} @${A.username}`,squircle:A?.bot},A.id))}),e("span",{class:"replies-counts",children:[e("b",{children:e(m,{id:"DOQUen",values:{0:n.length,1:Xe(n.length)},components:{0:e("span",{title:n.length})}})}),!p&&f>1&&e(N,{children:[" ","·"," ",e("span",{children:e(m,{id:"qSQQSe",values:{0:Xe(f),totalComments:f},components:{0:e("span",{title:f})}})})]})]}),e(I,{icon:"chevron-down",class:"replies-summary-chevron"}),!!u&&e(ye,{class:"replies-parent-link",to:u.to,onClick:u.onClick,title:d({id:"ZlV82A"}),children:"»"})]}),_&&e("ul",{children:n.map(A=>e("li",{children:[e("div",{class:"status-focus",tabIndex:0,children:[e(je,{statusID:A.id,instance:i,withinContext:!0,size:"s",enableTranslate:!0,onMediaClick:b,showActionsBar:!0}),!A.replies?.length&&A.repliesCount>0&&e("div",{class:"replies-link",children:[e(I,{icon:"comment2",alt:d({id:"N8UzTV"})})," ",e("span",{title:A.repliesCount,children:Xe(A.repliesCount)})]})]}),A.replies?.length&&e(Ac,{instance:i,replies:A.replies,level:A.level,accWeight:w?g:A.weight,openAll:a,parentLink:{to:i?`/${i}/s/${A.id}`:`/s/${A.id}`,onClick:()=>{Zn(A.id)}}})]},A.id))})]})}const rh=140,lh=35,dh=70,uh=140,Fi=new Map;function vn(n){const i=Fi.get(n.id);if(i)return i;const{spoilerText:s,content:o,mediaAttachments:c,poll:a,card:u}=n,d=To(s+o),l=c?.length?rh:0,r=(a?.options?.length||0)*lh,h=u&&(c?.length||a?.options?.length)?0:dh,p=(d+l+r+h)/uh;return Fi.set(n.id,p),p}const hh=lt(oh);function fh(){const n=qt(),{id:i,instance:s}=n;return e(hh,{id:i,instance:s})}const ph=""+new URL("boosts-carousel-BiOaNdMT.jpg",import.meta.url).href,mh=""+new URL("multi-column-ROck0NVt.jpg",import.meta.url).href,gh=""+new URL("multi-hashtag-timeline-DH5INVHi.jpg",import.meta.url).href,yh=""+new URL("nested-comments-thread-hv59kZLc.jpg",import.meta.url).href,vh="data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2093%2027'%3e%3cpath%20fill='%2382a0ef'%20d='M1.96%2021.31c1.26%200%201.99-.79%201.99-2.14v-4.86h3.79c4.29%200%207-2.45%207-6.58%200-3.96-2.68-6.56-6.84-6.56H2.85c-2.07%200-2.86.81-2.86%202.89v15.12c0%201.35.72%202.14%201.96%202.14Zm1.99-10.08v-6.9h3.46c2.17%200%203.4%201.26%203.4%203.46%200%202.55-1.25%203.44-4.32%203.44zm26.04%207.96v-8.41c0-3.38-1.93-5.41-5.17-5.41-2.21%200-4.12%201.23-4.64%202.99h-.19V2.13c0-1.36-.69-2.14-1.92-2.14-1.25%200-1.93.78-1.93%202.14v17.05c0%201.36.69%202.12%201.92%202.12s1.93-.76%201.93-2.12v-6.67c0-2.39%201.3-3.9%203.28-3.9%201.8%200%202.86%201.16%202.86%203.19v7.37c0%201.36.69%202.12%201.93%202.12%201.23%200%201.93-.78%201.93-2.12Zm10.95%200h.19v.54c.12%201.01.79%201.58%201.82%201.58%201.2%200%201.88-.75%201.88-2.07v-8.5c0-3.44-2.29-5.38-6.36-5.38q-2.53.01-3.98.81c-1.36.69-1.99%201.61-1.99%202.52%200%20.79.53%201.36%201.38%201.36.63%200%201.04-.16%201.48-.51a4%204%200%200%201%202.87-1.22c1.77%200%202.75.82%202.75%202.39v1.27h-3.69c-3.53%200-5.65%201.77-5.65%204.64%200%202.83%202.05%204.73%205.08%204.73%201.9%200%203.44-.79%204.23-2.18Zm-5.48-2.78c0-1.27.94-2.04%202.52-2.04h2.99v1.61c0%201.46-1.3%202.61-2.97%202.61-1.51%200-2.53-.89-2.53-2.18Zm25.55%202.79v-8.45c0-3.41-1.88-5.38-5.19-5.38-2.29%200-4.03%201.14-4.63%202.99H51v-.95c-.04-1.25-.72-1.93-1.88-1.93-1.17%200-1.9.79-1.9%202.07V19.2c0%201.36.7%202.12%201.93%202.12s1.93-.76%201.93-2.12v-6.67c0-2.42%201.26-3.9%203.27-3.9%201.79%200%202.8%201.14%202.8%203.18v7.38c0%201.36.69%202.12%201.93%202.12%201.23%200%201.92-.75%201.92-2.11Zm6.36%205.37V18.8h.19c.69%201.64%202.29%202.58%204.41%202.58%203.65%200%205.84-2.61%205.84-6.93V12.3c0-4.32-2.17-6.91-5.79-6.91-2.18%200-3.9%201.04-4.53%202.71h-.19v-.75c-.09-1.2-.76-1.86-1.9-1.86-1.22%200-1.89.76-1.89%202.14v16.95c0%201.36.69%202.12%201.92%202.12%201.25%200%201.93-.76%201.93-2.12Zm0-10.06v-2.07c0-2.49%201.25-3.97%203.27-3.97%202.07%200%203.24%201.52%203.24%204.2v1.41c0%202.67-1.17%204.2-3.21%204.2-1.98%200-3.3-1.49-3.3-3.78ZM78.73%2025q0%20.62.42%201.04c.45.44%201.25.67%202.26.67%203.12%200%204.92-1.44%206.14-4.92l4.67-13.4c.16-.45.22-.76.22-1.05%200-1.04-.78-1.8-1.83-1.8q-1.5-.01-1.98%201.85l-3.05%2010.59h-.16L82.4%207.39q-.46-1.86-2.01-1.85c-1.1%200-1.9.78-1.9%201.82q-.02.42.19%201.04l4.57%2012.96c0%20.1-.15.75-.19.83-.32%201-1.05%201.64-1.93%201.64-.44%200-.7-.07-1.01-.07-.83%200-1.39.53-1.39%201.25Z'/%3e%3c/svg%3e",bh=""+new URL("home-mobile-dark@2x-Dc-J8-SM.png",import.meta.url).href,wh=""+new URL("home-mobile-light@2x-Bd3fod8m.png",import.meta.url).href,kh=""+new URL("home-tablet-dark@2x-BgcNI8le.png",import.meta.url).href,Sh=""+new URL("home-tablet-light@2x-BW2RV9T6.png",import.meta.url).href,Ch={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},{PHANPY_DEFAULT_INSTANCE:gn,PHANPY_WEBSITE:ri,PHANPY_PRIVACY_POLICY_URL:_h,PHANPY_DEFAULT_INSTANCE_REGISTRATION_URL:co}=Ch,ao=ri?ri.replace(/https?:\/\//g,"").replace(/\/$/,""):null,Ih=ri?ri.toLowerCase().includes(location.hostname):!1,ro=`${"2026-01-31T12:53:41.000Z".slice(0,10).replace(/-/g,".")}.8b98d5a`;function Tc(){const{_:n}=ne();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:cs,alt:"",width:"100",height:"100"}),e("img",{src:vh,alt:"Phanpy",width:"180",height:"52"})]}),e("p",{class:"desc",children:e(m,{id:"Ogtv0V"})}),e("p",{children:e(ye,{to:gn?`/login?instance=${gn}&submit=1`:"/login",class:"button plain6",children:n(gn?{id:"sQia9P"}:{id:"ZLoGls"})})}),gn&&co&&e("p",{children:e("a",{href:co,class:"button plain5",children:e(m,{id:"e+RpCP"})})}),!gn&&e("p",{class:"insignificant",children:e("small",{children:e(m,{id:"fvAsUK",components:{0:e("br",{})}})})})]})}),e("div",{id:"device-showcase",children:[e("div",{class:"device mobile",children:e("div",{class:"device-frame",children:e("picture",{children:[e("source",{srcSet:bh,media:"(prefers-color-scheme: dark)"}),e("img",{src:wh,alt:n({id:"LVd2Ia"}),width:"375",height:"812",loading:"lazy"})]})})}),e("div",{class:"device tablet",children:e("div",{class:"device-frame",children:e("picture",{children:[e("source",{srcSet:kh,media:"(prefers-color-scheme: dark)"}),e("img",{src:Sh,alt:n({id:"6XjvUL"}),width:"768",height:"1024",loading:"lazy"})]})})})]}),e("div",{id:"why-container",children:e("div",{class:"sections",children:[e("section",{children:[e("img",{src:ph,alt:n({id:"S5cYrQ"}),width:"400",height:"303",loading:"lazy"}),e("div",{children:[e("h4",{children:e(m,{id:"Tu+sCN"})}),e("p",{children:e(m,{id:"e2uVlo"})})]})]}),e("section",{children:[e("img",{src:lc,alt:n({id:"LUnwPh"}),width:"600",height:"450",loading:"lazy"}),e("div",{children:[e("h4",{children:e(m,{id:"xrl8fj"})}),e("p",{children:e(m,{id:"1lGm1k"})})]})]}),e("section",{children:[e("img",{src:yh,alt:n({id:"CGQ27z"}),width:"400",height:"474",loading:"lazy"}),e("div",{children:[e("h4",{children:e(m,{id:"cYE45+"})}),e("p",{children:e(m,{id:"Pc7QKh"})})]})]}),e("section",{children:[e("img",{src:mh,alt:n({id:"VLKtvP"}),width:"400",height:"209",loading:"lazy"}),e("div",{children:[e("h4",{children:e(m,{id:"pEkad9"})}),e("p",{children:e(m,{id:"t7Py5R"})})]})]}),e("section",{children:[e("img",{src:gh,alt:n({id:"wOax6E"}),width:"400",height:"196",loading:"lazy"}),e("div",{children:[e("h4",{children:e(m,{id:"Wi1Ov0"})}),e("p",{children:e(m,{id:"tS2i+h"})})]})]})]})}),e("footer",{children:[(ao||ro)&&e("p",{class:"app-site-version",children:e("small",{children:[Ih?ao:""," ",ro]})}),e("p",{children:e(m,{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(),E.showAccount="cheeaun@mastodon.social"}}),2:e("a",{href:_h,target:"_blank"})}})}),e("div",{children:e(as,{})})]})]})}const xh=window.alert;window.__nativeAlert||(window.__nativeAlert=xh);window.alert=function(n){n instanceof Error&&n?.message&&(n=n.message),typeof n!="string"&&(n=JSON.stringify(n));const i=xa({text:n,className:"alert",gravity:"top",position:"center",duration:1e4,offset:{y:48},onClick:()=>{i.hideToast()}});i.showToast()};Yc(!0);const Ah=vo(()=>di(()=>import("./mock-home-Qu-AgQUK.js"),__vite__mapDeps([4,1,2,3]),import.meta.url)),Th=vo(()=>di(()=>import("./year-in-posts-DZVzhOlC.js"),__vite__mapDeps([5,1,2,3]),import.meta.url));window.__STATES__=E;window.__STATES_STATS__=()=>{const n=["statuses","accounts","spoilers","unfurledLinks","statusQuotes"],i={};n.forEach(c=>{i[c]=Object.keys(E[c]).length});const{statuses:s}=E,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}=E;let o=0;const{instance:c}=oe();for(const a in n){if(!window.__IDLE__)break;try{const u=document.querySelector(`[data-state-post-id~="${a}"], [data-state-post-ids~="${a}"]`),d=s.some(l=>a===ht(l.status?.id,c));if(!u&&!d){delete E.statuses[a],delete E.statusQuotes[a];for(const l in i){const r=i[l];if(ht(r.id,r.instance)===a){delete E.unfurledLinks[l];break}}o++}}catch{}}},900*1e3);setTimeout(()=>{for(const n in en)setTimeout(()=>{Array.isArray(en[n])?en[n][0]?.():typeof en[n]=="object"?en[n].module?.():en[n]?.()},1)},5e3);(()=>{window.__IDLE__=!0;const n=["mousemove","mousedown","resize","keydown","touchstart","pointerdown","pointermove","wheel"],i=()=>{window.__IDLE__=!0},o=Ro(i,3e3),c=()=>{window.__IDLE__=!1,o()};n.forEach(a=>{window.addEventListener(a,c,{passive:!0,capture:!0})}),window.addEventListener("blur",i,{passive:!0}),document.documentElement.addEventListener("mouseleave",a=>{!a.relatedTarget&&!a.toElement&&i()},{passive:!0})})();const Eh=/iPad|iPhone|iPod/.test(navigator.userAgent);Eh&&document.addEventListener("visibilitychange",()=>{if(document.visibilityState==="visible"){if(document.getElementsByClassName("media-modal-container").length>0)return;const i=ke.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,a=s.dataset.contentTemp;s.content=a||"",setTimeout(()=>{s.content=c},10)}}}});{const n=ke.local.get("theme");if(n){document.documentElement.classList.add(`is-${n}`),document.querySelector('meta[name="color-scheme"]').setAttribute("content",n||"light dark");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=ke.local.get("textSize");i&&document.documentElement.style.setProperty("--text-size",`${i}px`)}po(E,n=>{for(const[i,s,o,c]of n){if(s.join(".")==="settings.shortcutsViewMode"){const a=document.getElementById("app");a&&(a.dataset.shortcutsViewMode=E.shortcuts?.length?o:"")}s.join(".")==="settings.cloakMode"&&document.body.classList.toggle("cloak",o)}});const Bn=new Map;window.__BENCH_RESULTS=new Map;window.__BENCHMARK={start(n){},end(n){}};document.body.classList.toggle("exp-tab-bar-v2",ke.local.get("experiments-tabBarV2")??!1);const lo=window.matchMedia("(display-mode: standalone)").matches||window.navigator.standalone===!0,Rh=3600*1e3;function Lh(){const[n,i]=R(()=>!!wn()),[s,o]=R("loading");__BENCHMARK.start("app-init"),__BENCHMARK.start("time-to-following"),__BENCHMARK.start("time-to-home"),__BENCHMARK.start("time-to-isLoggedIn"),ne(),G(()=>{const d=ke.local.get("instanceURL"),l=decodeURIComponent((window.location.search.match(/code=([^&]+)/)||[,""])[1]);if(l){if(window.opener&&!window.opener.closed){try{window.opener.postMessage({type:"oauth-callback",code:l},window.location.origin),setTimeout(()=>{window.close()},100)}catch{window.close()}return}window.history.replaceState({},document.title,window.location.pathname||"/");const{client_id:h,client_secret:f,vapid_key:p}=yo(d)||{},y=Qn(d)||p,g=ke.sessionCookie.get("codeVerifier");(async()=>{o("loading");const{access_token:w}=await nr({instanceURL:d,client_id:h,client_secret:f,code:l,code_verifier:g||void 0});if(w){const k=Wc({instance:d,accessToken:w});await Promise.allSettled([wi(k),ki(k,d),Gc(k,d,w,y)]),ys(),window.__IGNORE_GET_ACCOUNT_ERROR__=!0,i(!0),o("default");const b=ke.session.get("loginRedirect");b&&(ke.session.del("loginRedirect"),window.location.hash=b)}else o("error");__BENCHMARK.end("app-init")})()}else{window.__IGNORE_GET_ACCOUNT_ERROR__=!0;const r=decodeURIComponent((window.location.search.match(/account=([^&]+)/)||[,""])[1]);let h;if(r&&(h=Zc(r),h&&(Xn(h.info.id),window.history.replaceState({},document.title,window.location.pathname||"/"))),h||(h=wn()),h){Xn(h.info.id);const{client:f}=oe({account:h}),{instance:p}=f;ys(),o("loading"),(async()=>{try{Xc()&&Qc(p)?(wi(f),ki(f,p)):await Promise.allSettled([wi(f),ki(f,p)])}catch{}finally{i(!0),o("default"),__BENCHMARK.end("app-init")}})()}else o("default"),__BENCHMARK.end("app-init")}ke.sessionCookie.del("clientID"),ke.sessionCookie.del("clientSecret"),ke.sessionCookie.del("codeVerifier")},[]);let c=Qt();E.currentLocation=c.pathname,G(Mi,[c,n]);const a=K(!1),u="pwaLastPath";return G(()=>{a.current&&lo&&n&&(Ec(c.pathname)?ke.local.del(u):ke.local.setJSON(u,{path:c.pathname+c.search,lastAccessed:Date.now()}))},[c.pathname,c.search,n]),G(()=>{if(!(a.current||!(!c.pathname||c.pathname==="/"))&&lo&&n&&s==="default"){const l=ke.local.getJSON(u);l&&setTimeout(()=>{l?.path&&Date.now()-(l.lastAccessed||0)<Rh&&(window.location.hash=l.path),ke.local.del(u)},300),a.current=!0}},[s,n]),/\/https?:/.test(c.pathname)?e(Uu,{}):s==="loading"?e(Be,{id:"loader-root"}):e(Ta,{value:n,children:[e(Mh,{}),e(Ph,{}),e(Yi,{children:e(Ze,{path:"/:instance?/s/:id",element:e(fh,{})})}),n&&e($a,{}),n&&e(pd,{}),e(id,{}),n&&e(rd,{}),e(Ra,{}),n&&e(sd,{}),e(hd,{onClose:Mi}),e(Ma,{})]})}function $h(){const n=Qi();return n&&__BENCHMARK.end("time-to-isLoggedIn"),n?e(Bu,{}):e(Tc,{})}function Ec(n){return/^\/(login|welcome|_sandbox|_qr-scan|_mock)/i.test(n)}const Mh=lt(()=>{const n=Qt(),i=Ce(()=>{const{pathname:s}=n;return!Ec(s)},[n]);return e(Yi,{location:i||n,children:[e(Ze,{path:"/",element:e($h,{})}),e(Ze,{path:"/login",element:e(Zu,{})}),e(Ze,{path:"/welcome",element:e(Tc,{})}),e(Ze,{path:"/_mock/home",element:e(bo,{children:e(Ah,{})})}),void 0]})});function pt({children:n}){const i=Qi(),s=Qt();if(!i){const o=s.pathname+s.search;return ke.session.set("loginRedirect",o),e(Jc,{to:"/login",replace:!0})}return n}function uo(){return E.prevLocation||null}function Ph(){const n=Qt(),i=K(uo());return Ce(()=>bn("/:instance/s/:id",n.pathname)||bn("/s/:id",n.pathname),[n.pathname,bn])?i.current||(i.current=uo()):i.current=null,e(Yi,{location:i.current||n,children:[e(Ze,{path:"/notifications",element:e(pt,{children:e(Sc,{})})}),e(Ze,{path:"/mentions",element:e(pt,{children:e(yc,{})})}),e(Ze,{path:"/following",element:e(pt,{children:e(ps,{})})}),e(Ze,{path:"/b",element:e(pt,{children:e(rc,{})})}),e(Ze,{path:"/f",element:e(pt,{children:e(dc,{})})}),e(Ze,{path:"/l",children:[e(Ze,{index:!0,element:e(pt,{children:e(Ku,{})})}),e(Ze,{path:":id",element:e(pt,{children:e(fc,{})})})]}),e(Ze,{path:"/fh",element:e(pt,{children:e(nu,{})})}),e(Ze,{path:"/sp",element:e(pt,{children:e(Qu,{})})}),e(Ze,{path:"/ft",element:e(pt,{children:e(Qd,{})})}),e(Ze,{path:"/catchup",element:e(pt,{children:e(qd,{})})}),e(Ze,{path:"/yip",element:e(pt,{children:e(bo,{fallback:e("div",{id:"year-in-posts-page",class:"deck-container",tabIndex:"-1",children:e(Be,{})}),children:e(Th,{})})})}),e(Ze,{path:"/annual_report/:year",element:e(pt,{children:e(Md,{})})}),e(Ze,{path:"/:instance?/t/:hashtag",element:e(hc,{})}),e(Ze,{path:"/:instance?/a/:id",element:e(Ed,{})}),e(Ze,{path:"/:instance?/p",children:[e(Ze,{index:!0,element:e(Bi,{})}),e(Ze,{path:"l",element:e(Bi,{local:!0})})]}),e(Ze,{path:"/:instance?/trending",element:e(Ic,{})}),e(Ze,{path:"/:instance?/search",element:e(Cc,{})})]})}ea();ta();na(e(ia,{i18n:he,children:e(sa,{children:e(oa,{children:e(Lh,{})})})}),document.getElementById("app"));setTimeout(()=>{try{localStorage.removeItem("settings-groupedNotificationsAlpha")}catch{}},5e3);if("serviceWorker"in navigator&&typeof caches<"u"){const i=["icons"];let s=!1;const o=1e4,c=3600*1e3;async function a(){if(window.__IDLE__)try{const u=await caches.keys();for(const d of u){if(i.includes(d))continue;const l=await caches.open(d),r=await l.keys();if(r.length>50){const h=r.slice(50);for(const f of h)await l.delete(f)}}s=!0}catch{}setTimeout(a,s?c:o)}setTimeout(a,o)}window.__CLOAK__=()=>{document.body.classList.toggle("cloak")};export{ct as B,$a as C,Ft as N,pd as S,Uo as i,Wh as u};
//# sourceMappingURL=main-BIy8J6P1.js.map