Files
phanpy-cz/assets/ScheduledAtField-O5kh-u-d.js
2025-10-09 15:50:02 +02:00

195 lines
202 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

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.

import{as as se,Y as It,e as o,d as z,q as Et,A as O,_ as ze,y as W,K as cs,at as ja,m as ct,V as xe,h as Li,au as Ua,av as co,aw as qa,ax as ls,X as us,k as N,M as Ke,l as si,$ as Kt,I as lo,G as Pt,s as B,ay as Wa,az as pr,x as Va,aA as Za,g as Di,F as uo,u as Wt,a as Be,w as Ga,J as Ya,aB as Xa,aC as Qa,T as I,aD as ds,aE as Ja,aF as hs,p as bo,B as ho,aa as fs,aG as tc,aH as Bt,aI as ec,aJ as nc,aK as Un,c as sn,R as re,aL as oc,aM as ic,a2 as ps,aN as Pi,aO as rc,t as sc,b as Se,z as ac}from"./pwa-viewport-cDxGxYgG.js";import{ICONS as cc}from"./ICONS-BLqAe1AS.js";const ms=["shift","alt","meta","mod","ctrl","control"],lc={esc:"escape",return:"enter",left:"arrowleft",right:"arrowright",up:"arrowup",down:"arrowdown",ShiftLeft:"shift",ShiftRight:"shift",AltLeft:"alt",AltRight:"alt",MetaLeft:"meta",MetaRight:"meta",OSLeft:"meta",OSRight:"meta",ControlLeft:"ctrl",ControlRight:"ctrl"};function Ae(t){return(lc[t.trim()]||t.trim()).toLowerCase().replace(/key|digit|numpad/,"")}function gs(t){return ms.includes(t)}function Oo(t,e=","){return t.toLowerCase().split(e)}function Fo(t,e="+",n=">",i=!1,r){let a=[],s=!1;t.includes(n)?(s=!0,a=t.toLocaleLowerCase().split(n).map(d=>Ae(d))):a=t.toLocaleLowerCase().split(e).map(d=>Ae(d));const c={alt:a.includes("alt"),ctrl:a.includes("ctrl")||a.includes("control"),shift:a.includes("shift"),meta:a.includes("meta"),mod:a.includes("mod"),useKey:i},l=a.filter(d=>!ms.includes(d));return{...c,keys:l,description:r,isSequence:s}}typeof document<"u"&&(document.addEventListener("keydown",t=>{t.code!==void 0&&vs([Ae(t.code)])}),document.addEventListener("keyup",t=>{t.code!==void 0&&ys([Ae(t.code)])})),typeof window<"u"&&(window.addEventListener("blur",()=>{pe.clear()}),window.addEventListener("contextmenu",()=>{setTimeout(()=>{pe.clear()},0)}));const pe=new Set;function $i(t){return Array.isArray(t)}function uc(t,e=","){return($i(t)?t:t.split(e)).every(n=>pe.has(n.trim().toLowerCase()))}function vs(t){const e=Array.isArray(t)?t:[t];pe.has("meta")&&pe.forEach(n=>!gs(n)&&pe.delete(n.toLowerCase())),e.forEach(n=>pe.add(n.toLowerCase()))}function ys(t){const e=Array.isArray(t)?t:[t];t==="meta"?pe.clear():e.forEach(n=>pe.delete(n.toLowerCase()))}function dc(t,e,n){(typeof n=="function"&&n(t,e)||n===!0)&&t.preventDefault()}function hc(t,e,n){return typeof n=="function"?n(t,e):n===!0||n===void 0}function fc(t){return bs(t,["input","textarea","select"])}function bs(t,e=!1){const{target:n,composed:i}=t;let r;return pc(n)&&i?r=t.composedPath()[0]&&t.composedPath()[0].tagName:r=n&&n.tagName,$i(e)?!!(r&&e&&e.some(a=>a.toLowerCase()===r.toLowerCase())):!!(r&&e&&e)}function pc(t){return!!t.tagName&&!t.tagName.startsWith("-")&&t.tagName.includes("-")}function mc(t,e){return t.length===0&&e?(console.warn('A hotkey has the "scopes" option set, however no active scopes were found. If you want to use the global scopes feature, you need to wrap your app in a <HotkeysProvider>'),!0):e?t.some(n=>e.includes(n))||t.includes("*"):!0}const gc=(t,e,n=!1)=>{const{alt:i,meta:r,mod:a,shift:s,ctrl:c,keys:l,useKey:d}=e,{code:h,key:u,ctrlKey:f,metaKey:p,shiftKey:m,altKey:g}=t,v=Ae(h);if(d&&l?.length===1&&l.includes(u))return!0;if(!(l!=null&&l.includes(v))&&!["ctrl","control","unknown","meta","alt","shift","os"].includes(v))return!1;if(!n){if(i!==g&&v!=="alt"||s!==m&&v!=="shift")return!1;if(a){if(!p&&!f)return!1}else if(r!==p&&v!=="meta"&&v!=="os"||c!==f&&v!=="ctrl"&&v!=="control")return!1}return l&&l.length===1&&l.includes(v)?!0:l?uc(l):!l},vc=se(void 0),yc=()=>It(vc);function ws(t,e){return t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(t).length===Object.keys(e).length&&Object.keys(t).reduce((n,i)=>n&&ws(t[i],e[i]),!0):t===e}const bc=se({hotkeys:[],activeScopes:[],toggleScope:()=>{},enableScope:()=>{},disableScope:()=>{}}),wc=()=>It(bc);function _c(t){const e=O(void 0);return ws(e.current,t)||(e.current=t),e.current}const mr=t=>{t.stopPropagation(),t.preventDefault(),t.stopImmediatePropagation()},Tc=typeof window<"u"?ze:W;function $e(t,e,n,i){const r=O(null),a=O(!1),s=n instanceof Array?i instanceof Array?void 0:i:n,c=$i(t)?t.join(s?.delimiter):t,l=n instanceof Array?n:i instanceof Array?i:void 0,d=Et(e,l??[]),h=O(d);l?h.current=d:h.current=e;const u=_c(s),{activeScopes:f}=wc(),p=yc();return Tc(()=>{if(u?.enabled===!1||!mc(f,u?.scopes))return;let m=[],g;const v=(S,b=!1)=>{var A;if(!(fc(S)&&!bs(S,u?.enableOnFormTags))){if(r.current!==null){const C=r.current.getRootNode();if((C instanceof Document||C instanceof ShadowRoot)&&C.activeElement!==r.current&&!r.current.contains(C.activeElement)){mr(S);return}}(A=S.target)!=null&&A.isContentEditable&&!(u!=null&&u.enableOnContentEditable)||Oo(c,u?.delimiter).forEach(C=>{var w,L,F,M;if(C.includes(u?.splitKey??"+")&&C.includes(u?.sequenceSplitKey??">")){console.warn(`Hotkey ${C} contains both ${u?.splitKey??"+"} and ${u?.sequenceSplitKey??">"} which is not supported.`);return}const E=Fo(C,u?.splitKey,u?.sequenceSplitKey,u?.useKey,u?.description);if(E.isSequence){g=setTimeout(()=>{m=[]},u?.sequenceTimeoutMs??1e3);const D=E.useKey?S.key:Ae(S.code);if(gs(D.toLowerCase()))return;m.push(D);const P=(w=E.keys)==null?void 0:w[m.length-1];if(D!==P){m=[],g&&clearTimeout(g);return}m.length===((L=E.keys)==null?void 0:L.length)&&(h.current(S,E),g&&clearTimeout(g),m=[])}else if(gc(S,E,u?.ignoreModifiers)||(F=E.keys)!=null&&F.includes("*")){if((M=u?.ignoreEventWhen)!=null&&M.call(u,S)||b&&a.current)return;if(dc(S,E,u?.preventDefault),!hc(S,E,u?.enabled)){mr(S);return}h.current(S,E),b||(a.current=!0)}})}},T=S=>{S.code!==void 0&&(vs(Ae(S.code)),(u?.keydown===void 0&&u?.keyup!==!0||u!=null&&u.keydown)&&v(S))},_=S=>{S.code!==void 0&&(ys(Ae(S.code)),a.current=!1,u!=null&&u.keyup&&v(S,!0))},k=r.current||s?.document||document;return k.addEventListener("keyup",_,s?.eventListenerOptions),k.addEventListener("keydown",T,s?.eventListenerOptions),p&&Oo(c,u?.delimiter).forEach(S=>p.addHotkey(Fo(S,u?.splitKey,u?.sequenceSplitKey,u?.useKey,u?.description))),()=>{k.removeEventListener("keyup",_,s?.eventListenerOptions),k.removeEventListener("keydown",T,s?.eventListenerOptions),p&&Oo(c,u?.delimiter).forEach(S=>p.removeHotkey(Fo(S,u?.splitKey,u?.sequenceSplitKey,u?.useKey,u?.description))),m=[],g&&clearTimeout(g)}},[c,u,f]),r}var ro={exports:{}};/*!
* Toastify js 1.12.0
* https://github.com/apvarun/toastify-js
* @license MIT licensed
*
* Copyright (C) 2018 Varun A P
*/var kc=ro.exports,gr;function Sc(){return gr||(gr=1,function(t){(function(e,n){t.exports?t.exports=n():e.Toastify=n()})(kc,function(e){var n=function(s){return new n.lib.init(s)},i="1.12.0";n.defaults={oldestFirst:!0,text:"Toastify is awesome!",node:void 0,duration:3e3,selector:void 0,callback:function(){},destination:void 0,newWindow:!1,close:!1,gravity:"toastify-top",positionLeft:!1,position:"",backgroundColor:"",avatar:"",className:"",stopOnFocus:!0,onClick:function(){},offset:{x:0,y:0},escapeMarkup:!0,ariaLive:"polite",style:{background:""}},n.lib=n.prototype={toastify:i,constructor:n,init:function(s){return s||(s={}),this.options={},this.toastElement=null,this.options.text=s.text||n.defaults.text,this.options.node=s.node||n.defaults.node,this.options.duration=s.duration===0?0:s.duration||n.defaults.duration,this.options.selector=s.selector||n.defaults.selector,this.options.callback=s.callback||n.defaults.callback,this.options.destination=s.destination||n.defaults.destination,this.options.newWindow=s.newWindow||n.defaults.newWindow,this.options.close=s.close||n.defaults.close,this.options.gravity=s.gravity==="bottom"?"toastify-bottom":n.defaults.gravity,this.options.positionLeft=s.positionLeft||n.defaults.positionLeft,this.options.position=s.position||n.defaults.position,this.options.backgroundColor=s.backgroundColor||n.defaults.backgroundColor,this.options.avatar=s.avatar||n.defaults.avatar,this.options.className=s.className||n.defaults.className,this.options.stopOnFocus=s.stopOnFocus===void 0?n.defaults.stopOnFocus:s.stopOnFocus,this.options.onClick=s.onClick||n.defaults.onClick,this.options.offset=s.offset||n.defaults.offset,this.options.escapeMarkup=s.escapeMarkup!==void 0?s.escapeMarkup:n.defaults.escapeMarkup,this.options.ariaLive=s.ariaLive||n.defaults.ariaLive,this.options.style=s.style||n.defaults.style,s.backgroundColor&&(this.options.style.background=s.backgroundColor),this},buildToast:function(){if(!this.options)throw"Toastify is not initialized";var s=document.createElement("div");s.className="toastify on "+this.options.className,this.options.position?s.className+=" toastify-"+this.options.position:this.options.positionLeft===!0?(s.className+=" toastify-left",console.warn("Property `positionLeft` will be depreciated in further versions. Please use `position` instead.")):s.className+=" toastify-right",s.className+=" "+this.options.gravity,this.options.backgroundColor&&console.warn('DEPRECATION NOTICE: "backgroundColor" is being deprecated. Please use the "style.background" property.');for(var c in this.options.style)s.style[c]=this.options.style[c];if(this.options.ariaLive&&s.setAttribute("aria-live",this.options.ariaLive),this.options.node&&this.options.node.nodeType===Node.ELEMENT_NODE)s.appendChild(this.options.node);else if(this.options.escapeMarkup?s.innerText=this.options.text:s.innerHTML=this.options.text,this.options.avatar!==""){var l=document.createElement("img");l.src=this.options.avatar,l.className="toastify-avatar",this.options.position=="left"||this.options.positionLeft===!0?s.appendChild(l):s.insertAdjacentElement("afterbegin",l)}if(this.options.close===!0){var d=document.createElement("button");d.type="button",d.setAttribute("aria-label","Close"),d.className="toast-close",d.innerHTML="&#10006;",d.addEventListener("click",(function(v){v.stopPropagation(),this.removeElement(this.toastElement),window.clearTimeout(this.toastElement.timeOutValue)}).bind(this));var h=window.innerWidth>0?window.innerWidth:screen.width;(this.options.position=="left"||this.options.positionLeft===!0)&&h>360?s.insertAdjacentElement("afterbegin",d):s.appendChild(d)}if(this.options.stopOnFocus&&this.options.duration>0){var u=this;s.addEventListener("mouseover",function(v){window.clearTimeout(s.timeOutValue)}),s.addEventListener("mouseleave",function(){s.timeOutValue=window.setTimeout(function(){u.removeElement(s)},u.options.duration)})}if(typeof this.options.destination<"u"&&s.addEventListener("click",(function(v){v.stopPropagation(),this.options.newWindow===!0?window.open(this.options.destination,"_blank"):window.location=this.options.destination}).bind(this)),typeof this.options.onClick=="function"&&typeof this.options.destination>"u"&&s.addEventListener("click",(function(v){v.stopPropagation(),this.options.onClick()}).bind(this)),typeof this.options.offset=="object"){var f=r("x",this.options),p=r("y",this.options),m=this.options.position=="left"?f:"-"+f,g=this.options.gravity=="toastify-top"?p:"-"+p;s.style.transform="translate("+m+","+g+")"}return s},showToast:function(){this.toastElement=this.buildToast();var s;if(typeof this.options.selector=="string"?s=document.getElementById(this.options.selector):this.options.selector instanceof HTMLElement||typeof ShadowRoot<"u"&&this.options.selector instanceof ShadowRoot?s=this.options.selector:s=document.body,!s)throw"Root element is not defined";var c=n.defaults.oldestFirst?s.firstChild:s.lastChild;return s.insertBefore(this.toastElement,c),n.reposition(),this.options.duration>0&&(this.toastElement.timeOutValue=window.setTimeout((function(){this.removeElement(this.toastElement)}).bind(this),this.options.duration)),this},hideToast:function(){this.toastElement.timeOutValue&&clearTimeout(this.toastElement.timeOutValue),this.removeElement(this.toastElement)},removeElement:function(s){s.className=s.className.replace(" on",""),window.setTimeout((function(){this.options.node&&this.options.node.parentNode&&this.options.node.parentNode.removeChild(this.options.node),s.parentNode&&s.parentNode.removeChild(s),this.options.callback.call(s),n.reposition()}).bind(this),400)}},n.reposition=function(){for(var s={top:15,bottom:15},c={top:15,bottom:15},l={top:15,bottom:15},d=document.getElementsByClassName("toastify"),h,u=0;u<d.length;u++){a(d[u],"toastify-top")===!0?h="toastify-top":h="toastify-bottom";var f=d[u].offsetHeight;h=h.substr(9,h.length-1);var p=15,m=window.innerWidth>0?window.innerWidth:screen.width;m<=360?(d[u].style[h]=l[h]+"px",l[h]+=f+p):a(d[u],"toastify-left")===!0?(d[u].style[h]=s[h]+"px",s[h]+=f+p):(d[u].style[h]=c[h]+"px",c[h]+=f+p)}return this};function r(s,c){return c.offset[s]?isNaN(c.offset[s])?c.offset[s]:c.offset[s]+"px":"0px"}function a(s,c){return!s||typeof c!="string"?!1:!!(s.className&&s.className.trim().split(/\s+/gi).indexOf(c)>-1)}return n.lib.init.prototype=n.lib,n})}(ro)),ro.exports}var Ec=Sc();const Cc=cs(Ec);window._showToast=ht;function ht(t){typeof t=="string"&&(t={text:t});const{onClick:e,delay:n,...i}=t,r=Cc({className:`${e||t.destination?"shiny-pill":""}`,gravity:"bottom",position:"center",...i,onClick:()=>{e?.(r)}});return n?setTimeout(()=>{r.showToast()},n):r.showToast(),r}function Bv(t,e,n,i){const r=O(t);W(()=>{r.current=t},[t,n]),W(()=>{!i||e===null||e===!1||r.current()},[i]),W(()=>{if(e===null||e===!1)return;const s=setInterval(()=>r.current(),e);return()=>clearInterval(s)},[e])}const Ri=t=>!!t&&t[0]==="o",ai=ja,In=(t,e)=>t===!0||!!(t&&t[e]),qt=(t,e)=>typeof t=="function"?t(e):t,Ac="_szhsinMenu",xc=t=>t[Ac];const an=(t,e)=>(e&&Object.keys(e).forEach(n=>{const i=t[n],r=e[n];typeof r=="function"&&i?t[n]=(...a)=>{r(...a),i(...a)}:t[n]=r}),t),Mc=t=>{if(typeof t!="string")return{top:0,right:0,bottom:0,left:0};const e=t.trim().split(/\s+/,4).map(parseFloat),n=isNaN(e[0])?0:e[0],i=isNaN(e[1])?n:e[1];return{top:n,right:i,bottom:isNaN(e[2])?n:e[2],left:isNaN(e[3])?i:e[3]}},zo=t=>{for(;t;){if(t=t.parentNode,!t||t===document.body||!t.parentNode)return;const{overflow:e,overflowX:n,overflowY:i}=getComputedStyle(t);if(/auto|scroll|overlay|hidden/.test(e+i+n))return t}};function wo(t,e){return{"aria-disabled":t||void 0,tabIndex:e?0:-1}}function vr(t,e){for(let n=0;n<t.length;n++)if(t[n]===e)return n;return-1}const fe=({block:t,element:e,modifiers:n,className:i})=>ct(()=>{const r=e?`${t}__${e}`:t;let a=r;n&&Object.keys(n).forEach(c=>{const l=n[c];l&&(a+=` ${r}--${l===!0?c:`${c}-${l}`}`)});let s=typeof i=="function"?i(n):i;return typeof s=="string"&&(s=s.trim(),s&&(a+=` ${s}`)),a},[t,e,n,i]),Ic="szh-menu-container",he="szh-menu";const Lc="arrow",Ni="item",Dc="divider",Pc="header",$c="group",Rc="submenu";const _s=se(),Oi=se({}),fo=se({}),Fi=se({}),Nc=se({}),_o=se({}),Ht=Object.freeze({ENTER:"Enter",ESC:"Escape",SPACE:" ",HOME:"Home",END:"End",LEFT:"ArrowLeft",RIGHT:"ArrowRight",UP:"ArrowUp",DOWN:"ArrowDown"}),St=Object.freeze({RESET:0,SET:1,UNSET:2,INCREASE:3,DECREASE:4,FIRST:5,LAST:6,SET_INDEX:7}),Ln=Object.freeze({CLICK:"click",CANCEL:"cancel",BLUR:"blur",SCROLL:"scroll"}),Qe=Object.freeze({FIRST:"first",LAST:"last"}),Oc=Object.freeze({entering:"opening",entered:"open",exiting:"closing",exited:"closed"}),yr="absolute",zi="none",Bi="menuitem",ci={preventScroll:!0};const Fc=({className:t,containerRef:e,containerProps:n,children:i,isOpen:r,theming:a,transition:s,onClose:c})=>{const l=In(s,"item");return o("div",{...an({onKeyDown:({key:u})=>{switch(u){case Ht.ESC:qt(c,{key:u,reason:Ln.CANCEL});break}},onBlur:u=>{r&&!u.currentTarget.contains(u.relatedTarget)&&qt(c,{reason:Ln.BLUR})}},n),className:fe({block:Ic,modifiers:ct(()=>({theme:a,itemTransition:l}),[a,l]),className:t}),style:{position:"absolute",...n?.style},ref:e,children:i})},zc=()=>{let t,e=0;return{toggle:n=>{n?e++:e--,e=Math.max(e,0)},on:(n,i,r)=>{e?t||(t=setTimeout(()=>{t=0,i()},n)):r?.()},off:()=>{t&&(clearTimeout(t),t=0)}}},Bc=t=>{const[e,n]=z(),r=O({items:[],hoverIndex:-1,sorted:!1}).current,a=Et((c,l)=>{const{items:d}=r;if(!c)r.items=[];else if(l)d.push(c);else{const h=d.indexOf(c);h>-1&&(d.splice(h,1),c.contains(document.activeElement)&&(t.current.focus(ci),n()))}r.hoverIndex=-1,r.sorted=!1},[r,t]),s=Et((c,l,d)=>{const{items:h,hoverIndex:u}=r,f=()=>{if(r.sorted)return;const g=t.current.querySelectorAll(".szh-menu__item");h.sort((v,T)=>vr(g,v)-vr(g,T)),r.sorted=!0};let p=-1,m;switch(c){case St.RESET:break;case St.SET:m=l;break;case St.UNSET:m=g=>g===l?void 0:g;break;case St.FIRST:f(),p=0,m=h[p];break;case St.LAST:f(),p=h.length-1,m=h[p];break;case St.SET_INDEX:f(),p=d,m=h[p];break;case St.INCREASE:f(),p=u,p<0&&(p=h.indexOf(l)),p++,p>=h.length&&(p=0),m=h[p];break;case St.DECREASE:f(),p=u,p<0&&(p=h.indexOf(l)),p--,p<0&&(p=h.length-1),m=h[p];break;default:}m||(p=-1),n(m),r.hoverIndex=p},[t,r]);return{hoverItem:e,dispatch:s,updateItems:a}},br=(t,e)=>Math.round(t)===e?t:e,Ts=t=>{const e=t.getBoundingClientRect();return e.width=br(e.width,t.offsetWidth),e.height=br(e.height,t.offsetHeight),e},Hc=(t,e,n,i)=>{const r=Ts(e),a=t.getBoundingClientRect(),s=n===window?{left:0,top:0,right:document.documentElement.clientWidth,bottom:window.innerHeight}:n.getBoundingClientRect(),c=Mc(i),l=m=>m+a.left-s.left-c.left,d=m=>m+a.left+r.width-s.right+c.right,h=m=>m+a.top-s.top-c.top,u=m=>m+a.top+r.height-s.bottom+c.bottom;return{menuRect:r,containerRect:a,getLeftOverflow:l,getRightOverflow:d,getTopOverflow:h,getBottomOverflow:u,confineHorizontally:m=>{let g=l(m);if(g<0)m-=g;else{const v=d(m);v>0&&(m-=v,g=l(m),g<0&&(m-=g))}return m},confineVertically:m=>{let g=h(m);if(g<0)m-=g;else{const v=u(m);v>0&&(m-=v,g=h(m),g<0&&(m-=g))}return m}}},Kc=({arrowRef:t,menuY:e,anchorRect:n,containerRect:i,menuRect:r})=>{let a=n.top-i.top-e+n.height/2;const s=t.current.offsetHeight*1.25;return a=Math.max(s,a),a=Math.min(a,r.height-s),a},jc=({anchorRect:t,containerRect:e,menuRect:n,placeLeftorRightY:i,placeLeftX:r,placeRightX:a,getLeftOverflow:s,getRightOverflow:c,confineHorizontally:l,confineVertically:d,arrowRef:h,arrow:u,direction:f,position:p})=>{let m=f,g=i;p!=="initial"&&(g=d(g),p==="anchor"&&(g=Math.min(g,t.bottom-e.top),g=Math.max(g,t.top-e.top-n.height)));let v,T,_;return m==="left"?(v=r,p!=="initial"&&(T=s(v),T<0&&(_=c(a),(_<=0||-T>_)&&(v=a,m="right")))):(v=a,p!=="initial"&&(_=c(v),_>0&&(T=s(r),(T>=0||-T<_)&&(v=r,m="left")))),p==="auto"&&(v=l(v)),{arrowY:u?Kc({menuY:g,arrowRef:h,anchorRect:t,containerRect:e,menuRect:n}):void 0,x:v,y:g,computedDirection:m}},Uc=({arrowRef:t,menuX:e,anchorRect:n,containerRect:i,menuRect:r})=>{let a=n.left-i.left-e+n.width/2;const s=t.current.offsetWidth*1.25;return a=Math.max(s,a),a=Math.min(a,r.width-s),a},qc=({anchorRect:t,containerRect:e,menuRect:n,placeToporBottomX:i,placeTopY:r,placeBottomY:a,getTopOverflow:s,getBottomOverflow:c,confineHorizontally:l,confineVertically:d,arrowRef:h,arrow:u,direction:f,position:p})=>{let m=f==="top"?"top":"bottom",g=i;p!=="initial"&&(g=l(g),p==="anchor"&&(g=Math.min(g,t.right-e.left),g=Math.max(g,t.left-e.left-n.width)));let v,T,_;return m==="top"?(v=r,p!=="initial"&&(T=s(v),T<0&&(_=c(a),(_<=0||-T>_)&&(v=a,m="bottom")))):(v=a,p!=="initial"&&(_=c(v),_>0&&(T=s(r),(T>=0||-T<_)&&(v=r,m="top")))),p==="auto"&&(v=d(v)),{arrowX:u?Uc({menuX:g,arrowRef:h,anchorRect:t,containerRect:e,menuRect:n}):void 0,x:g,y:v,computedDirection:m}},Wc=({arrow:t,align:e,direction:n,gap:i,shift:r,position:a,anchorRect:s,arrowRef:c,positionHelpers:l})=>{const{menuRect:d,containerRect:h}=l,u=n==="left"||n==="right";let f=u?i:r,p=u?r:i;if(t){const b=c.current;u?f+=b.offsetWidth:p+=b.offsetHeight}const m=s.left-h.left-d.width-f,g=s.right-h.left+f,v=s.top-h.top-d.height-p,T=s.bottom-h.top+p;let _,k;e==="end"?(_=s.right-h.left-d.width,k=s.bottom-h.top-d.height):e==="center"?(_=s.left-h.left-(d.width-s.width)/2,k=s.top-h.top-(d.height-s.height)/2):(_=s.left-h.left,k=s.top-h.top),_+=f,k+=p;const S={...l,anchorRect:s,placeLeftX:m,placeRightX:g,placeLeftorRightY:k,placeTopY:v,placeBottomY:T,placeToporBottomX:_,arrowRef:c,arrow:t,direction:n,position:a};switch(n){case"left":case"right":return jc(S);case"top":case"bottom":default:return qc(S)}},Je=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u"?ze:W;function wr(t,e){typeof t=="function"?t(e):t.current=e}const cn=(t,e)=>ct(()=>t?e?n=>{wr(t,n),wr(e,n)}:t:e,[t,e]),_r=-9999,ks=({ariaLabel:t,menuClassName:e,menuStyle:n,arrow:i,arrowProps:r={},anchorPoint:a,anchorRef:s,containerRef:c,containerProps:l,externalRef:d,parentScrollingRef:h,align:u="start",direction:f="bottom",position:p="auto",overflow:m="visible",setDownOverflow:g,repositionFlag:v,captureFocus:T=!0,state:_,endTransition:k,isDisabled:S,menuItemFocus:b,gap:A=0,shift:C=0,children:w,onClose:L,focusProps:F,...M})=>{const[E,D]=z({x:_r,y:_r}),[P,q]=z({}),[R,Q]=z(),[et,dt]=z(f),[nt]=z(zc),[V,rt]=Li(Z=>Z+1,1),{transition:G,boundingBoxRef:Mt,boundingBoxPadding:Lt,rootMenuRef:$t,rootAnchorRef:gt,scrollNodesRef:ae,reposition:te,viewScroll:ee,submenuCloseDelay:H}=It(_o),{submenuCtx:bt,reposSubmenu:Dt=v}=It(fo),Ct=O(),Ft=O(),jt=O(!1),{hoverItem:J,dispatch:ot,updateItems:lt}=Bc(Ct),vt=Ri(_),Vt=In(G,"open"),_t=In(G,"close"),Y=ae.current,be=Z=>{switch(Z.key){case Ht.HOME:ot(St.FIRST);break;case Ht.END:ot(St.LAST);break;case Ht.UP:ot(St.DECREASE,J);break;case Ht.DOWN:ot(St.INCREASE,J);break;case Ht.SPACE:Z.target&&Z.target.className.indexOf(he)!==-1&&Z.preventDefault();return;default:return}Z.preventDefault(),Z.stopPropagation()},U=()=>{_==="closing"&&Q(),qt(k)},X=Z=>{Z.stopPropagation(),nt.on(H,()=>{ot(St.RESET),Ct.current.focus(ci)})},j=Z=>{Z.target===Z.currentTarget&&nt.off()},tt=Et(Z=>{const kt=Ct.current,Nt=c.current;if(!kt||!Nt)return;const Ot=s?s.current?.getBoundingClientRect():a?{left:a.x,right:a.x,top:a.y,bottom:a.y,width:0,height:0}:null;if(!Ot)return;Y.menu||(Y.menu=(Mt?Mt.current:zo($t.current))||window);const wt=Hc(Nt,kt,Y.menu,Lt);let{arrowX:Ie,arrowY:ln,x:So,y:pt,computedDirection:un}=Wc({arrow:i,align:u,direction:f,gap:A,shift:C,position:p,anchorRect:Ot,arrowRef:Ft,positionHelpers:wt});const{menuRect:Le}=wt,ne=Le.height;if(!Z&&m!=="visible"){const{getTopOverflow:Eo,getBottomOverflow:Qt}=wt;let oe,Zt;const Ue=Qt(pt);if(Ue>0)oe=ne-Ue,Zt=Ue;else{const we=Eo(pt);we<0&&(oe=ne+we,Zt=0-we,oe>=0&&(pt-=we))}oe>=0&&Q({height:oe,overflowAmt:Zt})}i&&q({x:Ie,y:ln}),D({x:So,y:pt}),dt(un)},[i,u,Lt,f,A,C,p,m,a,s,c,Mt,$t,Y]);Je(()=>{vt&&(tt(),jt.current&&rt()),jt.current=vt},[vt,tt,Dt]),Je(()=>{R&&!g&&(Ct.current.scrollTop=0)},[R,g]),Je(()=>lt,[lt]),W(()=>{let{menu:Z}=Y;if(!vt||!Z)return;if(Z=Z.addEventListener?Z:window,!Y.anchors){Y.anchors=[];let wt=zo(gt&&gt.current);for(;wt&&wt!==Z;)Y.anchors.push(wt),wt=zo(wt)}let kt=ee;if(Y.anchors.length&&kt==="initial"&&(kt="auto"),kt==="initial")return;const Nt=()=>{kt==="auto"?ai(()=>tt(!0)):qt(L,{reason:Ln.SCROLL})},Ot=Y.anchors.concat(ee!=="initial"?Z:[]);return Ot.forEach(wt=>wt.addEventListener("scroll",Nt)),()=>Ot.forEach(wt=>wt.removeEventListener("scroll",Nt))},[gt,Y,vt,L,ee,tt]);const At=!!R&&R.overflowAmt>0;W(()=>{if(At||!vt||!h)return;const Z=()=>ai(tt),kt=h.current;return kt.addEventListener("scroll",Z),()=>kt.removeEventListener("scroll",Z)},[vt,At,h,tt]),W(()=>{if(!vt||typeof ResizeObserver!="function"||te==="initial")return;const Z=[],kt=new ResizeObserver(wt=>wt.forEach(({target:Ie})=>{Z.indexOf(Ie)<0?Z.push(Ie):Ua(()=>{tt(),rt()})})),Nt={box:"border-box"};kt.observe(Ct.current,Nt);const Ot=s?.current;return Ot&&kt.observe(Ot,Nt),()=>kt.disconnect()},[vt,te,s,tt]),W(()=>{if(!vt){ot(St.RESET),_t||Q();return}const{position:Z,alwaysUpdate:kt}=b||{},Nt=()=>{Z===Qe.FIRST?ot(St.FIRST):Z===Qe.LAST?ot(St.LAST):Z>=-1&&ot(St.SET_INDEX,void 0,Z)};if(kt)Nt();else if(T){const Ot=setTimeout(()=>{const wt=Ct.current;wt&&!wt.contains(document.activeElement)&&(wt.focus(ci),Nt())},Vt?170:100);return()=>clearTimeout(Ot)}},[vt,Vt,_t,T,b,ot]);const ft=ct(()=>({isParentOpen:vt,submenuCtx:nt,dispatch:ot,updateItems:lt}),[vt,nt,ot,lt]);let yt,Xt;R&&(g?Xt=R.overflowAmt:yt=R.height);const ut=ct(()=>({reposSubmenu:V,submenuCtx:nt,overflow:m,overflowAmt:Xt,parentMenuRef:Ct,parentDir:et}),[V,nt,m,Xt,et]),ce=yt>=0?{maxHeight:yt,overflow:m}:void 0,xt=ct(()=>({state:_,align:u,dir:et}),[_,u,et]),zt=ct(()=>({dir:et}),[et]),Tt=fe({block:he,element:Lc,modifiers:zt,className:r.className}),Rt=o("ul",{role:"menu","aria-label":t,...wo(S),...an({onPointerEnter:bt?.off,onPointerMove:X,onPointerLeave:j,onKeyDown:be,onAnimationEnd:U},M),ref:cn(d,Ct),className:fe({block:he,modifiers:xt,className:e}),style:{...n,...ce,margin:0,display:_==="closed"?"none":void 0,position:yr,left:E.x,top:E.y},children:[i&&o("li",{"aria-hidden":!0,...r,className:Tt,style:{display:"block",position:yr,left:P.x,top:P.y,...r.style},ref:Ft}),o(fo.Provider,{value:ut,children:o(Oi.Provider,{value:ft,children:o(_s.Provider,{value:J,children:qt(w,xt)})})})]});return l?o(Fc,{...l,isOpen:vt,children:Rt}):Rt},Ss=xe(function({"aria-label":e,className:n,containerProps:i,initialMounted:r,unmountOnClose:a,transition:s,transitionTimeout:c,boundingBoxRef:l,boundingBoxPadding:d,reposition:h="auto",submenuOpenDelay:u=300,submenuCloseDelay:f=150,viewScroll:p="initial",portal:m,theming:g,onItemClick:v,...T},_){const k=O(null),S=O({}),{anchorRef:b,state:A,onClose:C}=T,w=ct(()=>({initialMounted:r,unmountOnClose:a,transition:s,transitionTimeout:c,boundingBoxRef:l,boundingBoxPadding:d,rootMenuRef:k,rootAnchorRef:b,scrollNodesRef:S,reposition:h,viewScroll:p,submenuOpenDelay:u,submenuCloseDelay:f}),[r,a,s,c,b,l,d,h,p,u,f]),L=ct(()=>({handleClick(M,E){M.stopPropagation||qt(v,M);let D=M.keepOpen;D===void 0&&(D=E&&M.key===Ht.SPACE),D||qt(C,{value:M.value,key:M.key,reason:Ln.CLICK})},handleClose(M){qt(C,{key:M,reason:Ln.CLICK})}}),[v,C]);if(!A)return null;const F=o(_o.Provider,{value:w,children:o(Fi.Provider,{value:L,children:o(ks,{...T,ariaLabel:e||"Menu",externalRef:_,containerRef:k,containerProps:{className:n,containerRef:k,containerProps:i,theming:g,transition:s,onClose:C}})})});return m===!0&&typeof document<"u"?co(F,document.body):m?m.target?co(F,m.target):m.stablePosition?null:F:F}),li=0,ui=1,po=2,mo=3,go=4,Vc=5,Es=6,Zc=["preEnter","entering","entered","preExit","exiting","exited","unmounted"],Cs=t=>({_s:t,status:Zc[t],isEnter:t<mo,isMounted:t!==Es,isResolved:t===po||t>go}),di=t=>t?Es:Vc,Gc=(t,e)=>{switch(t){case ui:case li:return po;case go:case mo:return di(e)}},Yc=t=>typeof t=="object"?[t.enter,t.exit]:[t,t],Xc=(t,e)=>setTimeout(()=>{isNaN(document.body.offsetTop)||t(e+1)},0),Tr=(t,e,n,i,r)=>{clearTimeout(i.current);const a=Cs(t);e(a),n.current=a,r&&r({current:a})},Qc=({enter:t=!0,exit:e=!0,preEnter:n,preExit:i,timeout:r,initialEntered:a,mountOnEnter:s,unmountOnExit:c,onStateChange:l}={})=>{const[d,h]=z(()=>Cs(a?po:di(s))),u=O(d),f=O(),[p,m]=Yc(r),g=Et(()=>{const T=Gc(u.current._s,c);T&&Tr(T,h,u,f,l)},[l,c]),v=Et(T=>{const _=S=>{switch(Tr(S,h,u,f,l),S){case ui:p>=0&&(f.current=setTimeout(g,p));break;case go:m>=0&&(f.current=setTimeout(g,m));break;case li:case mo:f.current=Xc(_,S);break}},k=u.current.isEnter;typeof T!="boolean"&&(T=!k),T?!k&&_(t?n?li:ui:po):k&&_(e?i?mo:go:di(c))},[g,l,t,e,n,i,p,m,c]);return[d,v,g]};const Jc=({initialOpen:t,initialMounted:e,unmountOnClose:n,transition:i,transitionTimeout:r=500,onMenuChange:a}={})=>{const s=In(i,"open"),c=In(i,"close"),[{status:l},d,h]=Qc({initialEntered:t,mountOnEnter:!e,unmountOnExit:n,timeout:r,enter:s,exit:c,onStateChange:Et(({current:{isEnter:u,isResolved:f}})=>{!a||u&&s&&f||!u&&c&&f||a({open:u})},[a,s,c])});return[{state:Oc[l],endTransition:h},d]},As=t=>{const[e,n]=Jc(t),[i,r]=z(),a=(s,c)=>{r({position:s,alwaysUpdate:c}),n(!0)};return[{menuItemFocus:i,...e},n,a]},tl=(t,e)=>{const[n]=z({});return{onMouseDown:()=>{n.v=t&&t!=="closed"},onClick:i=>n.v?n.v=!1:e(!0,i)}},el=parseInt(qa)<19,nl=xe(function({"aria-label":e,captureFocus:n,initialOpen:i,menuButton:r,instanceRef:a,onMenuChange:s,...c},l){const[d,h,u]=As({...c,onMenuChange:s}),{state:f}=d,p=Ri(f),m=O(null),g=tl(f,(b,A)=>u(A.detail?void 0:Qe.FIRST)),v=Et(b=>{h(!1),b.key&&m.current.focus()},[h]),T=b=>{switch(b.key){case Ht.UP:u(Qe.LAST);break;case Ht.DOWN:u(Qe.FIRST);break;default:return}b.preventDefault()},_=qt(r,{open:p});if(!_||!_.type)throw new Error("Menu requires a menuButton prop.");const k={...an({onKeyDown:T,...g},_.props),ref:cn(el?_.ref:_.props.ref,m)};xc(_.type)==="MenuButton"&&(k.isOpen=p);const S=ls(_,k);return us(a,()=>({openMenu:u,closeMenu:()=>h(!1)})),o(N,{children:[S,o(Ss,{...c,...d,"aria-label":e||(typeof _.props.children=="string"?_.props.children:"Menu"),anchorRef:m,ref:l,onClose:v})]})}),Hi=(t,e)=>{const n=Ke(e),i=xe((r,a)=>{const s=O(null);return o(n,{...r,itemRef:s,externalRef:a,isHovering:It(_s)===s.current})});return i.displayName=`WithHovering(${t})`,i},xs=t=>{const[e,n]=z(!1);return W(()=>{!t&&n(!1)},[t]),[e,()=>!e&&n(!0),()=>n(!1)]},Ms=(t,e,n)=>{Je(()=>{if(t)return;const i=e.current;return n(i,!0),()=>{n(i)}},[t,e,n])},ol=Hi("SubMenu",function({"aria-label":e,className:n,disabled:i,direction:r,label:a,openTrigger:s,onMenuChange:c,isHovering:l,instanceRef:d,itemRef:h,captureFocus:u,repositionFlag:f,itemProps:p={},portal:m=!1,...g}){const v=It(_o),{rootMenuRef:T,submenuOpenDelay:_,submenuCloseDelay:k}=v,{parentMenuRef:S,parentDir:b,overflow:A}=It(fo),{isParentOpen:C,submenuCtx:w,dispatch:L,updateItems:F}=It(Oi),M=m||A!=="visible",[E,D,P]=As({...v,onMenuChange:c}),[q,R,Q]=xs(l),{state:et}=E,dt=!!i,nt=Ri(et),V=O(null),[rt]=z({v:0}),G=()=>{w.off(),rt.v&&(clearTimeout(rt.v),rt.v=0)},Mt=(...J)=>{G(),Lt(),!dt&&P(...J)},Lt=()=>!l&&!dt&&L(St.SET,h.current),$t=J=>{Lt(),s||(rt.v=setTimeout(()=>ai(Mt),Math.max(J,0)))},gt=J=>{dt||(J.stopPropagation(),R(),!(rt.v||nt)&&w.on(k,()=>$t(_-k),()=>$t(_)))},ae=()=>{Q(),G(),nt||L(St.UNSET,h.current)},te=J=>{if(l)switch(J.key){case Ht.ENTER:J.preventDefault();case Ht.SPACE:case Ht.RIGHT:s!=="none"&&Mt(Qe.FIRST)}},ee=J=>{let ot=!1;switch(J.key){case Ht.LEFT:nt&&(h.current.focus(),D(!1),ot=!0);break;case Ht.RIGHT:nt||(ot=!0);break}ot&&(J.preventDefault(),J.stopPropagation())};Ms(dt,h,F),W(()=>w.toggle(nt),[w,nt]),W(()=>()=>{clearTimeout(rt.v),w.toggle(!1)},[rt,w]),W(()=>{l&&C?h.current.focus():D(!1)},[l,C,D,h]),us(d,()=>({openMenu:(...J)=>{C&&Mt(...J)},closeMenu:()=>{nt&&(h.current.focus(),D(!1))}}));const H=ct(()=>({open:nt,hover:q||l,disabled:dt,submenu:!0}),[nt,l,dt,q]),{ref:bt,className:Dt,...Ct}=p,Ft=an({onPointerEnter:w.off,onPointerMove:gt,onPointerLeave:ae,onKeyDown:te,onClick:()=>s!=="none"&&Mt()},Ct),jt=()=>{const J=o(ks,{...g,...E,ariaLabel:e||(typeof a=="string"?a:"Submenu"),anchorRef:h,containerRef:M?T:V,direction:r||(b==="right"||b==="left"?b:"right"),parentScrollingRef:M&&S,isDisabled:dt}),ot=T.current;return M&&ot?co(J,ot):J};return o("li",{className:fe({block:he,element:Rc,className:n}),style:{position:"relative"},role:zi,ref:V,onKeyDown:ee,children:[o("div",{role:Bi,"aria-haspopup":!0,"aria-expanded":nt,...wo(dt,l),...Ft,ref:cn(bt,h),className:fe({block:he,element:Ni,modifiers:H,className:Dt}),children:ct(()=>qt(a,H),[a,H])}),et&&jt()]})}),Is=(t,e,n,i)=>{const[r,a,s]=xs(n),{submenuCloseDelay:c}=It(_o),{isParentOpen:l,submenuCtx:d,dispatch:h,updateItems:u}=It(Oi),f=()=>{!n&&!i&&h(St.SET,t.current)},p=()=>{!i&&h(St.UNSET,t.current)},m=T=>{n&&!T.currentTarget.contains(T.relatedTarget)&&p()},g=T=>{i||(T.stopPropagation(),a(),d.on(c,f,f))},v=(T,_)=>{s(),d.off(),!_&&p()};return Ms(i,t,u),W(()=>{n&&l&&e.current&&e.current.focus()},[e,n,l]),{mouseOver:r,setHover:f,onBlur:m,onPointerMove:g,onPointerLeave:v}},mt=Hi("MenuItem",function({className:e,value:n,href:i,type:r,checked:a,disabled:s,children:c,onClick:l,isHovering:d,itemRef:h,externalRef:u,...f}){const p=!!s,{mouseOver:m,setHover:g,...v}=Is(h,h,d,p),T=It(Fi),_=It(Nc),k=r==="radio",S=r==="checkbox",b=!!i&&!p&&!k&&!S,A=k?_.value===n:S?!!a:!1,C=E=>{if(p){E.stopPropagation(),E.preventDefault();return}const D={value:n,syntheticEvent:E};E.key!==void 0&&(D.key=E.key),S&&(D.checked=!A),k&&(D.name=_.name),qt(l,D),k&&qt(_.onRadioChange,D),T.handleClick(D,S||k)},w=E=>{if(d)switch(E.key){case Ht.ENTER:E.preventDefault();case Ht.SPACE:b?h.current.click():C(E)}},L=ct(()=>({type:r,disabled:p,hover:m||d,checked:A,anchor:b}),[r,p,m,d,A,b]),F=an({...v,onPointerDown:g,onKeyDown:w,onClick:C},f),M={role:k?"menuitemradio":S?"menuitemcheckbox":Bi,"aria-checked":k||S?A:void 0,...wo(p,d),...F,ref:cn(u,h),className:fe({block:he,element:Ni,modifiers:L,className:e}),children:ct(()=>qt(c,L),[c,L])};return b?o("li",{role:zi,children:o("a",{href:i,...M})}):o("li",{...M})}),il=Hi("FocusableItem",function({className:e,disabled:n,children:i,isHovering:r,itemRef:a,externalRef:s,...c}){const l=!!n,d=O(null),{mouseOver:h,setHover:u,onPointerLeave:f,...p}=Is(a,d,r,l),{handleClose:m}=It(Fi),g=ct(()=>({disabled:l,hover:h||r,focusable:!0}),[l,r,h]),v=ct(()=>qt(i,{...g,ref:d,closeMenu:m}),[i,g,m]),T=an({...p,onPointerLeave:_=>f(_,!0),onFocus:u},c);return o("li",{role:Bi,...wo(l),...T,ref:cn(s,a),className:fe({block:he,element:Ni,modifiers:g,className:e}),children:v})}),vn=Ke(xe(function({className:e,...n},i){return o("li",{role:"separator",...n,ref:i,className:fe({block:he,element:Dc,className:e})})})),Hv=Ke(xe(function({className:e,...n},i){return o("li",{role:zi,...n,ref:i,className:fe({block:he,element:Pc,className:e})})})),Kv=xe(function({className:e,style:n,takeOverflow:i,...r},a){const s=O(null),[c,l]=z(),{overflow:d,overflowAmt:h}=It(fo);return Je(()=>{let u;i&&h>=0&&(u=Ts(s.current).height-h,u<0&&(u=0)),l(u>=0?{maxHeight:u,overflow:d}:void 0)},[i,d,h]),Je(()=>{c&&(s.current.scrollTop=0)},[c]),o("div",{...r,ref:cn(a,s),className:fe({block:he,element:$c,className:e}),style:{...n,...c}})});var kn=(t=>(t.Mouse="mouse",t.Touch="touch",t.Pointer="pointer",t))(kn||{}),Sn=(t=>(t.CancelledByMovement="cancelled-by-movement",t.CancelledByRelease="cancelled-by-release",t.CancelledOutsideElement="cancelled-outside-element",t))(Sn||{});const rl=["mousedown","mousemove","mouseup","mouseleave","mouseout"],sl=["touchstart","touchmove","touchend","touchcancel"],al=["pointerdown","pointermove","pointerup","pointerleave","pointerout"];function cl(t){return typeof t=="object"&&t!==null&&"pageX"in t&&typeof t.pageX=="number"&&"pageY"in t&&typeof t.pageY=="number"}function ll(t){var e;return rl.includes((e=t?.nativeEvent)==null?void 0:e.type)}function Ls(t){var e;return sl.includes((e=t?.nativeEvent)==null?void 0:e.type)||"touches"in t}function ul(t){const{nativeEvent:e}=t;return e?al.includes(e?.type)||"pointerId"in e:!1}function Bo(t){return ll(t)||Ls(t)||ul(t)}function kr(t){var e;const n=Ls(t)?(e=t?.touches)==null?void 0:e[0]:t;return cl(n)?{x:n.pageX,y:n.pageY}:null}function dl(t){return{target:t.target,currentTarget:t.currentTarget,nativeEvent:t,persist:()=>{}}}function Ds(t,{threshold:e=400,captureEvent:n=!1,detect:i=kn.Pointer,cancelOnMovement:r=!1,cancelOutsideElement:a=!0,filterEvents:s,onStart:c,onMove:l,onFinish:d,onCancel:h}={}){const u=O(!1),f=O(!1),p=O(),m=O(),g=O(t),v=O(null),T=Et(b=>A=>{f.current||Bo(A)&&(s!==void 0&&!s(A)||(n&&A.persist(),c?.(A,{context:b}),v.current=kr(A),f.current=!0,p.current=A.currentTarget,m.current=setTimeout(()=>{g.current&&(g.current(A,{context:b}),u.current=!0)},e)))},[n,s,c,e]),_=Et(b=>(A,C)=>{Bo(A)&&f.current&&(v.current=null,n&&A.persist(),u.current?d?.(A,{context:b}):f.current&&h?.(A,{context:b,reason:C??Sn.CancelledByRelease}),u.current=!1,f.current=!1,m.current!==void 0&&clearTimeout(m.current))},[n,d,h]),k=Et(b=>A=>{if(Bo(A)&&(l?.(A,{context:b}),r!==!1&&v.current)){const C=kr(A);if(C){const w=r===!0?25:r,L={x:Math.abs(C.x-v.current.x),y:Math.abs(C.y-v.current.y)};(L.x>w||L.y>w)&&_(b)(A,Sn.CancelledByMovement)}}},[_,r,l]),S=Et(b=>{if(t===null)return{};switch(i){case kn.Mouse:{const A={onMouseDown:T(b),onMouseMove:k(b),onMouseUp:_(b)};return a&&(A.onMouseLeave=C=>{_(b)(C,Sn.CancelledOutsideElement)}),A}case kn.Touch:return{onTouchStart:T(b),onTouchMove:k(b),onTouchEnd:_(b)};case kn.Pointer:{const A={onPointerDown:T(b),onPointerMove:k(b),onPointerUp:_(b)};return a&&(A.onPointerLeave=C=>_(b)(C,Sn.CancelledOutsideElement)),A}}},[t,_,a,i,k,T]);return W(()=>{function b(A){const C=dl(A);_()(C)}return window.addEventListener("mouseup",b),window.addEventListener("touchend",b),window.addEventListener("pointerup",b),()=>{window.removeEventListener("mouseup",b),window.removeEventListener("touchend",b),window.removeEventListener("pointerup",b)}},[_]),W(()=>()=>{m.current!==void 0&&clearTimeout(m.current)},[]),W(()=>{g.current=t},[t]),S}const Sr="dtflocale";function hl(){try{const t=si.session.get(Sr);if(t)return t;const e=new Intl.DateTimeFormat().resolvedOptions().locale;return si.session.set(Sr,e),e}catch{return null}}const Ps=Kt(hl);function fl(){const t=[...navigator.languages],e=Ps();return e&&!t.includes(e)&&t.unshift(e),t}let Er=fl();const Ho=Kt((t,e={})=>{try{return new Intl.Locale(t,e)}catch{if(!t)return null;const[i,...r]=t.split("-",4),a=r.pop()||null,s={language:i,region:a,...e,toString:()=>{const c=s.language,l=r.length>0?`-${r.join("-")}-`:"-",d=s.region;return d?`${c}${l}${d}`:c}};return s}}),pl=(t,e)=>{const n=e,i=Ho(t);let r=null;for(const c of Er){const l=Ho(c)?.region;if(l){r=l;break}}const a=r&&i&&i.region!==r?Ho(i.language,{...i,region:r})?.toString():null,s=lo([a,t,t?.replace(/-[a-z]+$/i,"")],Er,t);try{return new Intl.DateTimeFormat(s,n)}catch{return new Intl.DateTimeFormat(void 0,n)}},hi=Kt(pl);function Dn(t,e){t instanceof Date||(t=new Date(t));const{hideTime:n,formatOpts:i,forceOpts:r}=e||{},a=new Date().getFullYear(),s=r||{year:t.getFullYear()===a?void 0:"numeric",month:"short",day:"numeric",hour:n?void 0:"numeric",minute:n?void 0:"numeric",...i};return hi(Pt.locale,s).format(t)}function ml(t){const e=URL.parse("./compose/",window.location),{width:n,height:i}=window.screen,r=Math.max(0,(n-600)/2),a=Math.max(0,(i-450)/2),s=Math.min(n,600),c=Math.min(i,450),l=t?.uid||Math.random(),d=window.open(e,"compose"+l,`width=${s},height=${c},left=${r},top=${a}`);return d?d.__COMPOSE__=t:alert(Pt._({id:"4S86wI"})),d}const gl=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);function vl(){if(gl){const t=document.createElement("input");t.style.position="absolute",t.style.top="0",t.style.left="0",t.style.opacity="0",document.body.appendChild(t),t.focus(),setTimeout(()=>{document.body.removeChild(t)},500)}}const yl=document.documentElement,qn=getComputedStyle(yl),bl=8;let $s=[0,0,0,0];function Rs(){const t=qn.getPropertyValue("--sai-top"),e=qn.getPropertyValue("--sai-right"),n=qn.getPropertyValue("--sai-bottom"),i=qn.getPropertyValue("--sai-left");$s=[Math.max(0,parseInt(t,10)),Math.max(0,parseInt(e,10)),Math.max(0,parseInt(n,10)),Math.max(0,parseInt(i,10))]}requestAnimationFrame(Rs);function Ns(t=[]){return $s.map((n,i)=>(n||bl)+(t[i]||0)).join(" ")}CSS.supports("top: env(safe-area-inset-top)")&&window.addEventListener("resize",Rs,{passive:!0});const Cr=5e3;function Ee(t){if(t||(t=!0),B.showCompose){B.composerState.minimized?ht({duration:Cr,text:Pt._({id:"/4fHR1"})}):ht({duration:Cr,text:Pt._({id:"vvl08N"})});return}vl(),B.showCompose=t}const Ar=document.createElement("template"),wl=/<\/p>/g,_l=/<\/li>/g,Tl=/[\r\n]{3,}/g;function kl(t,e){if(!t)return"";const{preProcess:n,truncateLinks:i=!0}=e||{};Ar.innerHTML=t.replace(wl,`</p>
`).replace(_l,`</li>
`);const r=Ar.content,a=r.querySelectorAll("br");for(let c=0;c<a.length;c++)a[c].replaceWith(`
`);if(n?.(r),i){const c=r.querySelectorAll(".invisible");for(let d=0;d<c.length;d++)c[d].remove();const l=r.querySelectorAll(".ellipsis");for(let d=0;d<l.length;d++)l[d].append("…")}let s="";for(let c=0;c<r.childNodes.length;c++){const l=r.childNodes[c];s+=l.innerText||l.textContent||""}return s.replace(Tl,`
`).trim()}const To=Kt(kl);function Os(t){const{spoilerText:e,content:n,poll:i,mediaAttachments:r}=t;let a="";return e?.trim()?a+=e:a+=To(n),a=a.trim(),i?.options?.length&&(a+=`
📊:
${i.options.map(s=>`${i.multiple?"▪️":"•"} ${s.title}`).join(`
`)}`),r?.length&&(a+=" "+r.map(s=>({image:"🖼️",gifv:"🎞️",video:"📹",audio:"🎵",unknown:""})[s.type]||"").join("")),a}const Sl={xs:8,s:12,m:16,l:20,xl:24,xxl:32},El=/[^a-zA-Z0-9]/g;function Cl({icon:t,size:e="m",alt:n,title:i,class:r="",style:a={}}){i=i||n;const{loadIcon:s,isIconLoaded:c}=Wa();if(!t)return null;const l=Sl[e];let d=cc[t];if(!d)return null;let h,u,f=!1;Array.isArray(d)?[d,h,u]=d:typeof d=="object"&&({rotate:h,flip:u,rtl:f}=d,d=d.module);const p=i?.replace(El,"-"),m=`${pr}-title-${t}-${p}`;W(()=>{c(t)||s(t)},[t]);const g=c(t);return o("span",{class:`icon ${r} ${f?"rtl-flip":""}`,style:{width:`${l}px`,height:`${l}px`,...a},"data-icon":t,title:g?void 0:i||void 0,children:g&&o("svg",{width:l,height:l,role:i?"img":"presentation","aria-labelledby":m,style:{transform:`${h?`rotate(${h})`:""} ${u?"scaleX(-1)":""}`},children:[i?o("title",{id:m,children:i}):null,o("use",{href:`#${pr}-${t}`})]})})}const x=Ke(Cl,(t,e)=>t.icon===e.icon&&t.title===e.title&&t.alt===e.alt),He=xe((t,e)=>{let n;try{n=Va()}catch{}let i=(location.hash||"").replace(/^#/,"").trim();i===""&&(i="/");const{to:r,...a}=t;if(i&&i!=="/"&&i.includes("?")){const c=URL.parse(i,location.origin);if(c?.searchParams?.size){const l=Array.from(c.searchParams.entries()).map(([d,h])=>`${d}=${encodeURIComponent(h)}`).join("&");i=c.pathname+"?"+l}}const s=i===r||decodeURIComponent(i)===r;return o("a",{ref:e,href:`#${r}`,...a,class:`${t.class||""} ${s?"is-active":""}`,onClick:c=>{c.currentTarget?.parentNode?.closest("a")&&c.stopPropagation(),n&&(B.prevLocation=n),t.onClick?.(c)}})});function xr(t){const{className:e,disabled:n,...i}=t;return o(il,{className:e,disabled:n,children:({ref:r,closeMenu:a})=>o(He,{...i,ref:r,onClick:({detail:s})=>a(s===0?"Enter":void 0)})})}const Fs=Kt(t=>new Intl.RelativeTimeFormat(t||void 0));function Mr(t){if(t instanceof Date)return!isNaN(t.getTime());{const e=new Date(t);return!isNaN(e.getTime())}}const en=60,nn=60*en,Re=24*nn,Al=t=>{const e=Fs(Pt.locale),n=(t.getTime()-Date.now())/1e3,i=Math.abs(n);return i<en?e.format(Math.floor(n),"second"):i<nn?e.format(Math.floor(n/en),"minute"):i<Re?e.format(Math.floor(n/nn),"hour"):i<30*Re?e.format(Math.floor(n/Re),"day"):i<365*Re?e.format(Math.floor(n/Re/30),"month"):e.format(Math.floor(n/Re/365),"year")},xl=t=>{const e=(Date.now()-t.getTime())/1e3;return e<en?Pt._({id:"NnRCUm",values:{0:e<1?1:Math.floor(e)}}):e<nn?Pt._({id:"ZSWUwq",values:{0:Math.floor(e/en)}}):Pt._({id:"NSSJsj",values:{0:Math.floor(e/nn)}})};function me({datetime:t,format:e}){if(!t)return null;const[n,i]=Li(l=>l+1,0),r=ct(()=>new Date(t),[t]),[a,s,c]=ct(()=>{if(!Mr(r))return[""+(typeof t=="string"?t:""),"",""];let l;if(e==="micro"){const d=new Date;(d.getTime()-r.getTime())/1e3/Re<=1?l=xl(r):d.getFullYear()===r.getFullYear()?l=hi(Pt.locale,{year:void 0,month:"short",day:"numeric"}).format(r):l=hi(Pt.locale,{dateStyle:"short"}).format(r)}return l||(l=Al(r)),[l,r.toISOString(),r.toLocaleString()]},[r,e,n]);return W(()=>{if(!Mr(r))return;let l,d;function h(){d=requestAnimationFrame(()=>{i(),u()})}function u(){const f=(Date.now()-r.getTime())/1e3;f<en?l=setTimeout(h,1e4):f<nn&&(l=setTimeout(h,6e4))}return u(),()=>{clearTimeout(l),cancelAnimationFrame(d)}},[]),o("time",{datetime:s,title:c,children:a})}function Ml(t){const e=O();return o(ol,{...t,instanceRef:e,itemProps:{onPointerMove:n=>{n.pointerType==="touch"&&e.current?.openMenu?.()},onPointerLeave:n=>{n.pointerType==="touch"&&e.current?.openMenu?.()},...t.itemProps}})}function Il(t,e=[]){!t||typeof t!="function"||W(()=>{const n=new CloseWatcher;return n.addEventListener("close",t),()=>{n.destroy()}},e)}const Ll=window.CloseWatcher?Il:()=>{},Dl=document.getElementById("modal-container");function Ir(){return getComputedStyle(document.documentElement).getPropertyValue("--backdrop-theme-color")}function En({children:t,onClose:e,onClick:n,class:i,minimized:r}){if(!t)return null;const a=O();W(()=>{let u=setTimeout(()=>{const f=a.current?.querySelector('[tabindex="-1"]');f&&f.focus()},100);return()=>clearTimeout(u)},[]);const s=window.CloseWatcher,c=$e("esc",()=>{setTimeout(()=>{e?.()},0)},{enabled:!s&&!!e,keydown:!1,keyup:!0,useKey:!0,ignoreEventWhen:u=>u.metaKey||u.ctrlKey||u.altKey||u.shiftKey},[e]);Ll(e,[e]),W(()=>{const u=document.querySelectorAll(".deck-container");if(r){const f=u[u.length-1];f&&f.tabIndex===-1&&f.focus()}else t?u.forEach(f=>{f.setAttribute("inert","")}):u.forEach(f=>{f.removeAttribute("inert")});return()=>{u.forEach(f=>{f.removeAttribute("inert")})}},[t,r]);const l=O(),d=O();ze(()=>{if(t&&!r)if(si.local.get("theme")){const f=Ir();l.current=document.querySelector('meta[name="theme-color"][data-theme-setting="manual"]'),l.current&&(d.current=l.current.content,l.current.content=f)}else{const f=window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light",p=Ir();l.current=document.querySelector(`meta[name="theme-color"][media*="${f}"]`),l.current&&(d.current=l.current.content,l.current.content=p)}else l.current&&d.current&&(l.current.content=d.current);return()=>{l.current&&d.current&&(l.current.content=d.current)}},[t,r]);const h=o("div",{ref:u=>{a.current=u,c.current=u?.querySelector?.('[tabindex="-1"]')||u},className:i,onClick:u=>{n?.(u),u.target===u.currentTarget&&e?.(u)},tabIndex:r?0:"-1",inert:r,onFocus:u=>{try{if(u.target===u.currentTarget){const f=a.current?.querySelector('[tabindex="-1"]'),p=!!f&&getComputedStyle(f)?.pointerEvents!=="none";f&&p&&f.focus()}}catch{}},children:t});return co(h,Dl)}const Lr={s:16,m:20,l:24,xl:32,xxl:50,xxxl:64},yn={},Cn=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas"),so=Cn.getContext("2d",{willReadFrequently:!0});so.imageSmoothingEnabled=!1;const Pl=/missing\.png$/;function $l({url:t,staticUrl:e,size:n,alt:i="",squircle:r,...a}){n=Lr[n]||n||Lr.m;const s=O(),c=Pl.test(t);return o("picture",{ref:s,class:`avatar ${r?"squircle":""} ${yn[t]?"has-alpha":""}`,style:{width:n,height:n},title:i,...a,children:[!!e&&o("source",{srcset:e,media:"(prefers-reduced-motion: reduce)"}),!!t&&o("img",{src:t,width:n,height:n,alt:i,loading:"lazy",decoding:"async",fetchPriority:"low",crossOrigin:yn[t]===void 0&&!c?"anonymous":void 0,onError:l=>{l.target.crossOrigin&&(l.target.crossOrigin=null,l.target.src=t)},onLoad:l=>{s.current&&(s.current.dataset.loaded=!0),yn[t]===void 0&&(c||setTimeout(()=>{try{const{width:d,height:h}=l.target;Cn.width!==d&&(Cn.width=d),Cn.height!==h&&(Cn.height=h),so.drawImage(l.target,0,0);const u=so.getImageData(0,0,d,h),f=u.data.filter((p,m)=>m%4===3&&p<=128).length/(u.data.length/4)>.1;f&&s.current.classList.add("has-alpha"),yn[t]=f,so.clearRect(0,0,d,h)}catch{yn[t]=!1}},1))}})]})}const ge=Kt($l);let fi=!1;const Rl=new MutationObserver(t=>{t.forEach(e=>{if(e.type==="attributes"){const{dir:n}=e.target;n==="rtl"?fi=!0:fi=!1}})});Rl.observe(document.documentElement,{attributes:!0,attributeFilter:["dir"]});function pi(){return fi}function Nl(){const[t,e]=z({width:null,height:null});return ze(()=>{const n=()=>{e({width:window.innerWidth,height:window.innerHeight})};return n(),window.addEventListener("resize",n,{passive:!0}),()=>{window.removeEventListener("resize",n)}},[]),t}function zs(t){const{containerProps:e,instanceRef:n,align:i}=t,r=Nl(),a=n?.current?n:O(),s=pi()?i==="end"?"start":i==="start"?"end":i:i;return o(nl,{boundingBoxPadding:Ns(),repositionFlag:`${r.width}x${r.height}`,unmountOnClose:!0,...t,align:s,instanceRef:a,containerProps:{onClick:c=>{c.target===c.currentTarget&&a.current?.closeMenu?.(),e?.onClick?.(c)},...e}})}function Wn({subMenu:t=!1,confirm:e=!0,confirmLabel:n,menuItemClassName:i,menuFooter:r,menuExtras:a,...s}){const{children:c,onClick:l,...d}=s;return e?o(t?Ml:zs,{openTrigger:"clickOnly",direction:"bottom",overflow:"auto",gap:-8,shift:8,menuClassName:"menu-emphasized",...d,menuButton:t?void 0:c,label:t?c:void 0,children:[o(mt,{className:i,onClick:l,children:n}),a,r]}):t?o(mt,{...s}):l?Za(c,{onClick:l}):c}function mi({staticUrl:t,alt:e,url:n}){return o("picture",{children:[t&&o("source",{srcset:t,media:"(prefers-reduced-motion: reduce)"}),o("img",{src:n,alt:e,class:"shortcode-emoji emoji",width:"16",height:"16",loading:"lazy",decoding:"async",fetchPriority:"low",onLoad:i=>{try{i.target.dataset.isLarger=i.target.naturalWidth>i.target.width*2||i.target.naturalHeight>i.target.height*2}catch{}}},e||n)]})}const Ol=Kt(t=>new RegExp(`:(${t.join("|")}):`,"g"));function Fl({text:t,emojis:e,staticEmoji:n}){if(!t)return"";if(!e?.length||t.indexOf(":")===-1)return t;const i=Ol(e.map(a=>a.shortcode));return t.split(i).map((a,s)=>{const c=e.find(l=>l.shortcode===a);if(c){const{url:l,staticUrl:d}=c;return o(mi,{staticUrl:n?void 0:d,alt:a,url:n&&d||l},a+"-"+s)}return a})}const on=Kt(Fl);function gi({roles:t,accountId:e,accountUrl:n,hideSelf:i=!1}){if(!t?.length)return null;const r=e&&e===Di();if(i&&r)return null;const a=uo(n);return t?.map(s=>o(N,{children:[" ",o("span",{class:"tag collapsed tag-role",children:[s.name,!!a&&o(N,{children:[" ",o("span",{class:"more-insignificant",children:a})]})]})]}))}const zl=Kt(t=>{const e={sensitivity:"base"};try{return new Intl.Collator(t||void 0,e)}catch{return new Intl.Collator(void 0,e)}}),Bl=/([^@]+)(@.+)/i,Hl=/(\:(\w|\+|\-)+\:)(?=|[\!\.\?]|$)/g,Kl=/\s+/g,jl=/[^a-z0-9@\.]/gi;function Ul({account:t,instance:e,showAvatar:n,showAcct:i,short:r,external:a,onClick:s}){const{i18n:c}=Wt();if(!t)return null;const{acct:l,avatar:d,avatarStatic:h,id:u,url:f,displayName:p,emojis:m,bot:g,username:v,roles:T}=t,[_,k,S]=l.match(Bl)||[,l];e||(e=Be().instance);const b=uo(f),A=v.toLowerCase().trim(),C=(p||"").toLowerCase().trim(),w=C.replace(Hl,"").replace(Kl,""),L=w.replace(jl,""),F=!r&&(A===C||A===w||A===L||zl(c.locale).compare(A,w)===0)||L===l.toLowerCase();return o("a",{class:`name-text ${i?"show-acct":""} ${r?"short":""}`,href:f,target:a?"_blank":null,title:p?`${p} (${S?"":"@"}${l})`:`${S?"":"@"}${l}`,onClick:M=>{if(!a&&!M.shiftKey){if(M.preventDefault(),M.stopPropagation(),s)return s(M);if(M.metaKey||M.ctrlKey||M.shiftKey||M.which===2){const E=`#/${e}/a/${u}`;window.open(E,"_blank");return}B.showAccount={account:t,instance:e}}},children:[n&&o(N,{children:[o(ge,{url:h||d,squircle:g})," "]}),p&&!r?o(N,{children:[o("b",{dir:"auto",children:o(on,{text:p,emojis:m,staticEmoji:!0})}),!i&&!F&&o(N,{children:[" ",o("i",{class:"bidi-isolate",children:["@",v]}),o(gi,{roles:T,accountId:u,accountUrl:f,hideSelf:!0})]})]}):r?o("i",{children:v}):o("b",{children:v}),i&&o(N,{children:[o("br",{}),o("i",{class:"bidi-isolate",children:[S?"":"@",k,!!S&&o("span",{class:"ib",children:S})]}),o(gi,{roles:T,accountUrl:f})]})]})}const Ce=Kt(Ul),ql="Аҧсшәа",Wl="Acèh",Vl="Lëbacoli",Zl="Afár",Gl="Afrikaans",Yl="Shqip",Xl="Dhalur",Ql="አማርኛ",Jl="العربية",tu="Հայերեն",eu="অসমীয়া",nu="Авар мацӀ",ou="अवधी",iu="Aymar aru",ru="Azərbaycanca",su="Basa Bali",au="بلوچی",cu="Bamanankan",lu="Baoulé",uu="Башҡортса",du="Euskara",hu="Batak Karo",fu="Batak Simalungun",pu="Batak Toba",mu="Беларуская",gu="Ichibemba",vu="বাংলা",yu="Betawi",bu="भोजपुरी",wu="Bikol",_u="Bosanski",Tu="Brezhoneg",ku="Български",Su="Буряад",Eu="粵語",Cu="Català",Au="Cebuano",xu="Chamoru",Mu="Нохчийн мотт",Iu="Chichewa",Lu="Kapasen Chuuk",Du="Чӑвашла",Pu="Corsu",$u="Qırımtatarca (Кирилл)",Ru="Hrvatski",Nu="Čeština",Ou="Dansk",Fu="ދިވެހި",zu="Thuɔŋjäŋ",Bu="डोगरी",Hu="Dombe",Ku="Nederlands",ju="Jula",Uu="རྫོང་ཁ",qu="English",Wu="Esperanto",Vu="Eesti",Zu="Eʋegbe",Gu="Føroyskt",Yu="Vosa Vakaviti",Xu="Tagalog",Qu="Suomi",Ju="Fon",td="Français",ed="Frysk",nd="Furlan",od="Fulfulde",id="Gã",rd="Galego",sd="ქართული",ad="Deutsch",cd="Ελληνικά",ld="Avañe'ẽ",ud="ગુજરાતી",dd="Kreyòl ayisyen",hd="Hakha Chin",fd="Hausa",pd="ʻŌlelo Hawaiʻi",md="עברית",gd="Hiligaynon",vd="हिन्दी",yd="Hmoob",bd="Magyar",wd="Hunsrik",_d="Iban",Td="Íslenska",kd="Igbo",Sd="Iloko",Ed="Bahasa Indonesia",Cd="ᐃᓄᒃᑎᑐᑦ",Ad="Gaeilge",xd="Italiano",Md="Patwa",Id="日本語",Ld="Basa Jawa",Dd="Jinghpaw",Pd="Kalaallisut",$d="ಕನ್ನಡ",Rd="Kanuri",Nd="Kapampangan",Od="Қазақша",Fd="Khasi",zd="ភាសាខ្មែរ",Bd="Rukiga",Hd="Kikongo",Kd="Kinyarwanda",jd="Kituba",Ud="Kokborok",qd="Коми кыв",Wd="कोंकणी",Vd="한국어",Zd="Krio",Gd="Kurdî (Kurmancî)",Yd="کوردی (سۆرانی)",Xd="Кыргызча",Qd="ລາວ",Jd="Latgaļu",th="Latina",eh="Latviešu",nh="Ligure",oh="Limburgs",ih="Lingála",rh="Lietuvių",sh="Lombard",ah="Luganda",ch="Dholuo",lh="Lëtzebuergesch",uh="Македонски",dh="Madhurâ",hh="मैथिली",fh="Makassar",ph="Malagasy",mh="Bahasa Melayu",gh="മലയാളം",vh="Malti",yh="Mam",bh="Gaelg",wh="Te Reo Māori",_h="मराठी",Th="Kajin M̧ajeļ",kh="मारवाड़ी",Sh="Kreol Morisien",Eh="Олык марий",Ch="Baso Minang",Ah="Mizo ṭawng",xh="Монгол",Mh="မြန်မာစာ",Ih="Náhuatl",Lh="isiNdebele",Dh="नेपाली",Ph="Norsk",$h="Thok Nath",Rh="Occitan",Nh="ଓଡ଼ିଆ",Oh="Afaan Oromoo",Fh="Ирон æвзаг",zh="Pangasinan",Bh="Papiamentu",Hh="پښتو",Kh="فارسی",jh="Polski",Uh="Português (Brasil)",qh="ਪੰਜਾਬੀ",Wh="Runa Simi",Vh="Qʼeqchiʼ",Zh="Romani čhib",Gh="Română",Yh="Ikirundi",Xh="Русский",Qh="Davvisámegiella",Jh="Gagana Samoa",tf="Sängö",ef="संस्कृतम्",nf="ᱥᱟᱱᱛᱟᱲᱤ",of="Gàidhlig",rf="Sepedi",sf="Српски",af="Sesotho",cf="Kreol seselwa",lf="လိၵ်ႈတႆး",uf="chiShona",df="Sicilianu",hf="Ślōnskŏ",ff="سنڌي",pf="සිංහල",mf="Slovenčina",gf="Slovenščina",vf="Soomaali",yf="Español",bf="Basa Sunda",wf="Susu",_f="Kiswahili",Tf="siSwati",kf="Svenska",Sf="Reo Tahiti",Ef="Тоҷикӣ",Cf="ⵜⴰⵎⴰⵣⵉⵖⵜ",Af="தமிழ்",xf="Татарча",Mf="తెలుగు",If="Tetun",Lf="ไทย",Df="བོད་ཡིག",Pf="ትግርኛ",$f="Tiv",Rf="Tok Pisin",Nf="Lea fakatonga",Of="Tshiluba",Ff="Xitsonga",zf="Setswana",Bf="ತುಳು",Hf="chiTumbuka",Kf="Türkçe",jf="Türkmençe",Uf="Тыва дыл",qf="Akankasa",Wf="Удмурт кыл",Vf="Українська",Zf="اردو",Gf="ئۇيغۇرچە",Yf="Oʻzbekcha",Xf="Tshivenḓa",Qf="Vèneto",Jf="Tiếng Việt",tp="Winaray",ep="Cymraeg",np="Wolof",op="isiXhosa",ip="Саха тыла",rp="ייִדיש",sp="Yorùbá",ap="Màaya T'àan",cp="Didxazá",lp="isiZulu",up={ab:ql,ace:Wl,ach:Vl,aa:Zl,af:Gl,sq:Yl,alz:Xl,am:Ql,ar:Jl,hy:tu,as:eu,av:nu,awa:ou,ay:iu,az:ru,ban:su,bal:au,bm:cu,bci:lu,ba:uu,eu:du,btx:hu,bts:fu,bbc:pu,be:mu,bem:gu,bn:vu,bew:yu,bho:bu,bik:wu,bs:_u,br:Tu,bg:ku,bua:Su,yue:Eu,ca:Cu,ceb:Au,ch:xu,ce:Mu,ny:Iu,"zh-CN":"简体中文","zh-TW":"繁體中文",chk:Lu,cv:Du,co:Pu,crh:$u,"crh-Latn":"Qırımtatarca (Latin)",hr:Ru,cs:Nu,da:Ou,"fa-AF":"درى",dv:Fu,din:zu,doi:Bu,dov:Hu,nl:Ku,dyu:ju,dz:Uu,en:qu,eo:Wu,et:Vu,ee:Zu,fo:Gu,fj:Yu,tl:Xu,fi:Qu,fon:Ju,fr:td,"fr-CA":"Français (Canada)",fy:ed,fur:nd,ff:od,gaa:id,gl:rd,ka:sd,de:ad,el:cd,gn:ld,gu:ud,ht:dd,cnh:hd,ha:fd,haw:pd,iw:md,hil:gd,hi:vd,hmn:yd,hu:bd,hrx:wd,iba:_d,is:Td,ig:kd,ilo:Sd,id:Ed,"iu-Latn":"Inuktitut (Latin)",iu:Cd,ga:Ad,it:xd,jam:Md,ja:Id,jw:Ld,kac:Dd,kl:Pd,kn:$d,kr:Rd,pam:Nd,kk:Od,kha:Fd,km:zd,cgg:Bd,kg:Hd,rw:Kd,ktu:jd,trp:Ud,kv:qd,gom:Wd,ko:Vd,kri:Zd,ku:Gd,ckb:Yd,ky:Xd,lo:Qd,ltg:Jd,la:th,lv:eh,lij:nh,li:oh,ln:ih,lt:rh,lmo:sh,lg:ah,luo:ch,lb:lh,mk:uh,mad:dh,mai:hh,mak:fh,mg:ph,ms:mh,"ms-Arab":"بهاس ملايو",ml:gh,mt:vh,mam:yh,gv:bh,mi:wh,mr:_h,mh:Th,mwr:kh,mfe:Sh,chm:Eh,"mni-Mtei":"ꯃꯤꯇꯩꯂꯣꯟ",min:Ch,lus:Ah,mn:xh,my:Mh,nhe:Ih,"ndc-ZW":"Ndau",nr:Lh,new:"नेपाल भाषा",ne:Dh,"bm-Nkoo":"ߒߞߏ",no:Ph,nus:$h,oc:Rh,or:Nh,om:Oh,os:Fh,pag:zh,pap:Bh,ps:Hh,fa:Kh,pl:jh,pt:Uh,"pt-PT":"Português (Portugal)",pa:qh,"pa-Arab":"پنجابی",qu:Wh,kek:Vh,rom:Zh,ro:Gh,rn:Yh,ru:Xh,se:Qh,sm:Jh,sg:tf,sa:ef,"sat-Latn":"Santali (Latin)",sat:nf,gd:of,nso:rf,sr:sf,st:af,crs:cf,shn:lf,sn:uf,scn:df,szl:hf,sd:ff,si:pf,sk:mf,sl:gf,so:vf,es:yf,su:bf,sus:wf,sw:_f,ss:Tf,sv:kf,ty:Sf,tg:Ef,"ber-Latn":"Tamazight (Latin)",ber:Cf,ta:Af,tt:xf,te:Mf,tet:If,th:Lf,bo:Df,ti:Pf,tiv:$f,tpi:Rf,to:Nf,lua:Of,ts:Ff,tn:zf,tcy:Bf,tum:Hf,tr:Kf,tk:jf,tyv:Uf,ak:qf,udm:Wf,uk:Vf,ur:Zf,ug:Gf,uz:Yf,ve:Xf,vec:Qf,vi:Jf,war:tp,cy:ep,wo:np,xh:op,sah:ip,yi:rp,yo:sp,yua:ap,zap:cp,zu:lp},Vn={"zh-YUE":"YUE",zh_HANT:"zh-Hant"},Ko=Kt(t=>new Intl.DisplayNames(t||void 0,{type:"language"}));function dp(t){let e,n;typeof t=="object"&&({code:t,locale:e,fallback:n}=t);try{const i=Ko(e||Pt.locale).of(t);if(i!==t)return i;if(!n){const r=Ko(t).of(t);if(r!==t)return r;const a=up?.[e];if(a!==t)return a}return n||""}catch{if(Vn[t])try{const r=Ko(Vn[e]||e||Pt.locale).of(Vn[t]);return r!==Vn[t]?r:n||""}catch{}return n||""}}const bn=Kt(dp),hp={auto:"Detect language",ab:"Abkhaz",ace:"Acehnese",ach:"Acholi",aa:"Afar",af:"Afrikaans",sq:"Albanian",alz:"Alur",am:"Amharic",ar:"Arabic",hy:"Armenian",as:"Assamese",av:"Avar",awa:"Awadhi",ay:"Aymara",az:"Azerbaijani",ban:"Balinese",bal:"Baluchi",bm:"Bambara",bci:"Baoulé",ba:"Bashkir",eu:"Basque",btx:"Batak Karo",bts:"Batak Simalungun",bbc:"Batak Toba",be:"Belarusian",bem:"Bemba",bn:"Bengali",bew:"Betawi",bho:"Bhojpuri",bik:"Bikol",bs:"Bosnian",br:"Breton",bg:"Bulgarian",bua:"Buryat",yue:"Cantonese",ca:"Catalan",ceb:"Cebuano",ch:"Chamorro",ce:"Chechen",ny:"Chichewa","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)",chk:"Chuukese",cv:"Chuvash",co:"Corsican",crh:"Crimean Tatar (Cyrillic)","crh-Latn":"Crimean Tatar (Latin)",hr:"Croatian",cs:"Czech",da:"Danish","fa-AF":"Dari",dv:"Dhivehi",din:"Dinka",doi:"Dogri",dov:"Dombe",nl:"Dutch",dyu:"Dyula",dz:"Dzongkha",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",fo:"Faroese",fj:"Fijian",tl:"Filipino",fi:"Finnish",fon:"Fon",fr:"French","fr-CA":"French (Canada)",fy:"Frisian",fur:"Friulian",ff:"Fulani",gaa:"Ga",gl:"Galician",ka:"Georgian",de:"German",el:"Greek",gn:"Guarani",gu:"Gujarati",ht:"Haitian Creole",cnh:"Hakha Chin",ha:"Hausa",haw:"Hawaiian",iw:"Hebrew",hil:"Hiligaynon",hi:"Hindi",hmn:"Hmong",hu:"Hungarian",hrx:"Hunsrik",iba:"Iban",is:"Icelandic",ig:"Igbo",ilo:"Ilocano",id:"Indonesian","iu-Latn":"Inuktut (Latin)",iu:"Inuktut (Syllabics)",ga:"Irish",it:"Italian",jam:"Jamaican Patois",ja:"Japanese",jw:"Javanese",kac:"Jingpo",kl:"Kalaallisut",kn:"Kannada",kr:"Kanuri",pam:"Kapampangan",kk:"Kazakh",kha:"Khasi",km:"Khmer",cgg:"Kiga",kg:"Kikongo",rw:"Kinyarwanda",ktu:"Kituba",trp:"Kokborok",kv:"Komi",gom:"Konkani",ko:"Korean",kri:"Krio",ku:"Kurdish (Kurmanji)",ckb:"Kurdish (Sorani)",ky:"Kyrgyz",lo:"Lao",ltg:"Latgalian",la:"Latin",lv:"Latvian",lij:"Ligurian",li:"Limburgish",ln:"Lingala",lt:"Lithuanian",lmo:"Lombard",lg:"Luganda",luo:"Luo",lb:"Luxembourgish",mk:"Macedonian",mad:"Madurese",mai:"Maithili",mak:"Makassar",mg:"Malagasy",ms:"Malay","ms-Arab":"Malay (Jawi)",ml:"Malayalam",mt:"Maltese",mam:"Mam",gv:"Manx",mi:"Maori",mr:"Marathi",mh:"Marshallese",mwr:"Marwadi",mfe:"Mauritian Creole",chm:"Meadow Mari","mni-Mtei":"Meiteilon (Manipuri)",min:"Minang",lus:"Mizo",mn:"Mongolian",my:"Myanmar (Burmese)",nhe:"Nahuatl (Eastern Huasteca)","ndc-ZW":"Ndau",nr:"Ndebele (South)",new:"Nepalbhasa (Newari)",ne:"Nepali","bm-Nkoo":"NKo",no:"Norwegian",nus:"Nuer",oc:"Occitan",or:"Odia (Oriya)",om:"Oromo",os:"Ossetian",pag:"Pangasinan",pap:"Papiamento",ps:"Pashto",fa:"Persian",pl:"Polish",pt:"Portuguese (Brazil)","pt-PT":"Portuguese (Portugal)",pa:"Punjabi (Gurmukhi)","pa-Arab":"Punjabi (Shahmukhi)",qu:"Quechua",kek:"Qʼeqchiʼ",rom:"Romani",ro:"Romanian",rn:"Rundi",ru:"Russian",se:"Sami (North)",sm:"Samoan",sg:"Sango",sa:"Sanskrit","sat-Latn":"Santali (Latin)",sat:"Santali (Ol Chiki)",gd:"Scots Gaelic",nso:"Sepedi",sr:"Serbian",st:"Sesotho",crs:"Seychellois Creole",shn:"Shan",sn:"Shona",scn:"Sicilian",szl:"Silesian",sd:"Sindhi",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",su:"Sundanese",sus:"Susu",sw:"Swahili",ss:"Swati",sv:"Swedish",ty:"Tahitian",tg:"Tajik","ber-Latn":"Tamazight",ber:"Tamazight (Tifinagh)",ta:"Tamil",tt:"Tatar",te:"Telugu",tet:"Tetum",th:"Thai",bo:"Tibetan",ti:"Tigrinya",tiv:"Tiv",tpi:"Tok Pisin",to:"Tongan",lua:"Tshiluba",ts:"Tsonga",tn:"Tswana",tcy:"Tulu",tum:"Tumbuka",tr:"Turkish",tk:"Turkmen",tyv:"Tuvan",ak:"Twi",udm:"Udmurt",uk:"Ukrainian",ur:"Urdu",ug:"Uyghur",uz:"Uzbek",ve:"Venda",vec:"Venetian",vi:"Vietnamese",war:"Waray",cy:"Welsh",wo:"Wolof",xh:"Xhosa",sah:"Yakut",yi:"Yiddish",yo:"Yoruba",yua:"Yucatec Maya",zap:"Zapotec",zu:"Zulu"},fp={ab:"Abkhaz",ace:"Acehnese",ach:"Acholi",aa:"Afar",af:"Afrikaans",sq:"Albanian",alz:"Alur",am:"Amharic",ar:"Arabic",hy:"Armenian",as:"Assamese",av:"Avar",awa:"Awadhi",ay:"Aymara",az:"Azerbaijani",ban:"Balinese",bal:"Baluchi",bm:"Bambara",bci:"Baoulé",ba:"Bashkir",eu:"Basque",btx:"Batak Karo",bts:"Batak Simalungun",bbc:"Batak Toba",be:"Belarusian",bem:"Bemba",bn:"Bengali",bew:"Betawi",bho:"Bhojpuri",bik:"Bikol",bs:"Bosnian",br:"Breton",bg:"Bulgarian",bua:"Buryat",yue:"Cantonese",ca:"Catalan",ceb:"Cebuano",ch:"Chamorro",ce:"Chechen",ny:"Chichewa","zh-CN":"Chinese (Simplified)","zh-TW":"Chinese (Traditional)",chk:"Chuukese",cv:"Chuvash",co:"Corsican",crh:"Crimean Tatar (Cyrillic)","crh-Latn":"Crimean Tatar (Latin)",hr:"Croatian",cs:"Czech",da:"Danish","fa-AF":"Dari",dv:"Dhivehi",din:"Dinka",doi:"Dogri",dov:"Dombe",nl:"Dutch",dyu:"Dyula",dz:"Dzongkha",en:"English",eo:"Esperanto",et:"Estonian",ee:"Ewe",fo:"Faroese",fj:"Fijian",tl:"Filipino",fi:"Finnish",fon:"Fon",fr:"French","fr-CA":"French (Canada)",fy:"Frisian",fur:"Friulian",ff:"Fulani",gaa:"Ga",gl:"Galician",ka:"Georgian",de:"German",el:"Greek",gn:"Guarani",gu:"Gujarati",ht:"Haitian Creole",cnh:"Hakha Chin",ha:"Hausa",haw:"Hawaiian",iw:"Hebrew",hil:"Hiligaynon",hi:"Hindi",hmn:"Hmong",hu:"Hungarian",hrx:"Hunsrik",iba:"Iban",is:"Icelandic",ig:"Igbo",ilo:"Ilocano",id:"Indonesian","iu-Latn":"Inuktut (Latin)",iu:"Inuktut (Syllabics)",ga:"Irish",it:"Italian",jam:"Jamaican Patois",ja:"Japanese",jw:"Javanese",kac:"Jingpo",kl:"Kalaallisut",kn:"Kannada",kr:"Kanuri",pam:"Kapampangan",kk:"Kazakh",kha:"Khasi",km:"Khmer",cgg:"Kiga",kg:"Kikongo",rw:"Kinyarwanda",ktu:"Kituba",trp:"Kokborok",kv:"Komi",gom:"Konkani",ko:"Korean",kri:"Krio",ku:"Kurdish (Kurmanji)",ckb:"Kurdish (Sorani)",ky:"Kyrgyz",lo:"Lao",ltg:"Latgalian",la:"Latin",lv:"Latvian",lij:"Ligurian",li:"Limburgish",ln:"Lingala",lt:"Lithuanian",lmo:"Lombard",lg:"Luganda",luo:"Luo",lb:"Luxembourgish",mk:"Macedonian",mad:"Madurese",mai:"Maithili",mak:"Makassar",mg:"Malagasy",ms:"Malay","ms-Arab":"Malay (Jawi)",ml:"Malayalam",mt:"Maltese",mam:"Mam",gv:"Manx",mi:"Maori",mr:"Marathi",mh:"Marshallese",mwr:"Marwadi",mfe:"Mauritian Creole",chm:"Meadow Mari","mni-Mtei":"Meiteilon (Manipuri)",min:"Minang",lus:"Mizo",mn:"Mongolian",my:"Myanmar (Burmese)",nhe:"Nahuatl (Eastern Huasteca)","ndc-ZW":"Ndau",nr:"Ndebele (South)",new:"Nepalbhasa (Newari)",ne:"Nepali","bm-Nkoo":"NKo",no:"Norwegian",nus:"Nuer",oc:"Occitan",or:"Odia (Oriya)",om:"Oromo",os:"Ossetian",pag:"Pangasinan",pap:"Papiamento",ps:"Pashto",fa:"Persian",pl:"Polish",pt:"Portuguese (Brazil)","pt-PT":"Portuguese (Portugal)",pa:"Punjabi (Gurmukhi)","pa-Arab":"Punjabi (Shahmukhi)",qu:"Quechua",kek:"Qʼeqchiʼ",rom:"Romani",ro:"Romanian",rn:"Rundi",ru:"Russian",se:"Sami (North)",sm:"Samoan",sg:"Sango",sa:"Sanskrit","sat-Latn":"Santali (Latin)",sat:"Santali (Ol Chiki)",gd:"Scots Gaelic",nso:"Sepedi",sr:"Serbian",st:"Sesotho",crs:"Seychellois Creole",shn:"Shan",sn:"Shona",scn:"Sicilian",szl:"Silesian",sd:"Sindhi",si:"Sinhala",sk:"Slovak",sl:"Slovenian",so:"Somali",es:"Spanish",su:"Sundanese",sus:"Susu",sw:"Swahili",ss:"Swati",sv:"Swedish",ty:"Tahitian",tg:"Tajik","ber-Latn":"Tamazight",ber:"Tamazight (Tifinagh)",ta:"Tamil",tt:"Tatar",te:"Telugu",tet:"Tetum",th:"Thai",bo:"Tibetan",ti:"Tigrinya",tiv:"Tiv",tpi:"Tok Pisin",to:"Tongan",lua:"Tshiluba",ts:"Tsonga",tn:"Tswana",tcy:"Tulu",tum:"Tumbuka",tr:"Turkish",tk:"Turkmen",tyv:"Tuvan",ak:"Twi",udm:"Udmurt",uk:"Ukrainian",ur:"Urdu",ug:"Uyghur",uz:"Uzbek",ve:"Venda",vec:"Venetian",vi:"Vietnamese",war:"Waray",cy:"Welsh",wo:"Wolof",xh:"Xhosa",sah:"Yakut",yi:"Yiddish",yo:"Yoruba",yua:"Yucatec Maya",zap:"Zapotec",zu:"Zulu"},pp={},Bs={sl:hp,tl:fp,al:pp},mp=Object.entries(Bs.tl).map(([t,{name:e}])=>({code:t,name:e})),vi=[...navigator.languages],jo=Ps();jo&&!vi.includes(jo)&&vi.unshift(jo);const gp=()=>lo(vi,mp.map(t=>t.code.replace("_","-")),"en");function Hs(t=!1){if(t){const{contentTranslationTargetLanguage:e}=B.settings;if(e)return e}return gp()}const Dr=["byte","kilobyte","megabyte","gigabyte","terabyte","petabyte"];function jv(t){const e=Math.min(Math.floor(Math.log2(t)/10),Dr.length-1),n=t/1024**e;return Pt.number(n,{style:"unit",unit:Dr[e],unitDisplay:"narrow",maximumFractionDigits:0})}function Gt(){return Ga()?.mastodon>=7}function vp(t){return t?.[t?.currentUser]?.[0]||"nobody"}function yi(t,e=[]){return t?(!e.length||t.indexOf(":")===-1||e.forEach(n=>{const{shortcode:i,staticUrl:r,url:a}=n;t=t.replace(new RegExp(`:${i}:`,"g"),`<picture><source srcset="${r}" media="(prefers-reduced-motion: reduce)"></source><img class="shortcode-emoji emoji" src="${a}" alt=":${i}:" title="${i}" width="16" height="16" loading="lazy" decoding="async" fetchPriority="low" onload="try { this.dataset.isLarger = this.naturalWidth > (this.width * 2) || this.naturalHeight > (this.height * 2) } catch (e) {}" /></picture>`)}),t):""}const yp=/[&<>"']/g,bp={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&apos;"};function Uo(t){return t.replace(yp,e=>bp[e])}const Ge=document.createElement("div"),wp=["u-url","mention","hashtag"],_p=/<a/i,Tp=/^https?:\/\//i,kp=/^@[^@]+(@[^@]+)?$/,Sp=/^#[^#]+$/,Ep=/^```[^]+```$/,Cp=/^```/,Ap=/```$/,xp=/`[^`]+`/,Mp=/(twitter|x)\.com/i,Ip=/@[a-zA-Z0-9_]+@(twitter|x)\.com/,Lp=/(@([a-zA-Z0-9_]+)@(twitter|x)\.com)/g,Dp=/(`[^]+?`)/g;function Pp(t,e){if(e){const n=document.createElement("template");return n.innerHTML=t,n.content}else{const n=document.createElement("div");return n.innerHTML=t,n}}function $p(t,e={}){if(!t)return"";const{emojis:n,returnDOM:i,postEnhanceDOM:r=()=>{}}=e;let a=t;const s=Pp(a,i),c=_p.test(a),l=a.includes("```");if(c){const h=s.querySelectorAll('a:not([target="_blank"])');for(const f of h)f.setAttribute("target","_blank");const u=s.querySelectorAll("a[class]");for(const f of u)for(const p of f.classList)wp.includes(p)||f.classList.remove(p)}if(c){const h=s.querySelectorAll("a[href]");for(const u of h)Tp.test(u.textContent.trim())&&(u.classList.add("has-url-text"),Fp(u))}if(c){const h=s.querySelectorAll("a[href]"),u=[];for(const f of h){const p=f.innerText.trim(),m=f.querySelector("*");if(kp.test(p)){const[g,v,T]=p.split("@");m||(!u.some(([_])=>_===v)||u.some(([_,k])=>_===v&&k===T)?(f.innerHTML=`@<span>${v}</span>`,u.push([v,T])):f.innerHTML=`@<span>${v}@${T}</span>`),f.classList.add("mention")}Sp.test(p)&&(m||(f.innerHTML=`#<span>${p.slice(1)}</span>`),f.classList.add("mention","hashtag"))}}let d;if(a.includes(":")&&n?.length){d=Wo(s);for(const h of d){let u=Uo(h.nodeValue);u=yi(u,n),Ge.innerHTML=u,h.replaceWith(...Ge.childNodes)}}if(l){const h=[...s.querySelectorAll("p")].filter(u=>Ep.test(u.innerText.trim()));for(const u of h){const f=document.createElement("pre");for(const p of u.querySelectorAll("br"))p.replaceWith(`
`);f.innerHTML=`<code>${u.innerHTML.trim()}</code>`,u.replaceWith(f)}}if(l){const u=[...s.querySelectorAll("p")].filter(f=>Cp.test(f.innerText));for(const f of u){const p=[f];let m=!1,g=f;for(;g.nextElementSibling;){const v=g.nextElementSibling;if(v&&v.tagName==="P")if(Ap.test(v.innerText)){p.push(v),m=!0;break}else p.push(v);else break;g=v}if(m){const v=document.createElement("pre");for(const _ of p)for(const k of _.querySelectorAll("br"))k.replaceWith(`
`);const T=p.map(_=>_.innerHTML).join(`
`);v.innerHTML=`<code tabindex="0">${T}</code>`,f.replaceWith(v);for(const _ of p)_.remove()}}}if(a.includes("`")){d=Wo(s);for(const h of d){let u=Uo(h.nodeValue);xp.test(u)&&(u=u.replaceAll(Dp,"<code>$1</code>")),Ge.innerHTML=u,h.replaceWith(...Ge.childNodes)}}if(Mp.test(a)){d=Wo(s,{rejectFilter:["A"]});for(const h of d){let u=Uo(h.nodeValue);Ip.test(u)&&(u=u.replaceAll(Lp,'<a href="https://twitter.com/$2" rel="nofollow noopener" target="_blank">$1</a>')),Ge.innerHTML=u,h.replaceWith(...Ge.childNodes)}}if(a.includes("#")){let h=null;const u=[...s.querySelectorAll("p")].filter((f,p)=>{let m=0;for(let g=0;g<f.childNodes.length;g++){const v=f.childNodes[g];if(v.nodeType===Node.TEXT_NODE){if(v.textContent.trim()!=="")return!1}else if(v.tagName!=="BR")if(v.tagName==="A"){const T=v.textContent.trim();if(!T||!T.startsWith("#"))return!1;m++}else return!1}if(m>3||m>1&&h&&p===h+1)return h=p,!0});if(u?.length)for(const f of u)f.classList.add("hashtag-stuffing"),f.title=f.innerText}if(a.includes("<img")){const h=s.querySelectorAll("img");for(let u=0;u<h.length;u++){const f=h[u],p=f.getAttribute("width")||f.naturalWidth,m=f.getAttribute("height")||f.naturalHeight;p&&m&&f.style.setProperty("--original-aspect-ratio",`${p}/${m}`)}}for(const h of s.childNodes)if(h.nodeType===Node.TEXT_NODE&&h.textContent.trim?.()){const u=document.createElement("span");u.textContent=h.textContent,s.replaceChild(u,h)}return r&&queueMicrotask(()=>r(s)),i?s:s.innerHTML}const Ks=Kt($p),Rp=["STYLE","IMG","VIDEO","AUDIO","AREA","MAP","TRACK","EMBED","IFRAME","OBJECT","PICTURE","PORTAL","SOURCE","SVG","MATH","CANVAS","NOSCRIPT","SCRIPT","INPUT","OPTION","TEXTAREA","SLOT","TEMPLATE"],Np=Object.fromEntries(Rp.map(t=>[t,!0])),Op=/^(https?:\/\/(www\.)?|xmpp:)/,qo=30;function Fp(t){if(!(!t||t.querySelector?.("*")))try{const e=t.innerText.trim(),n=(e.match(Op)||[])[0]||"";if(!n)return;const i=e.slice(n.length,n.length+qo),r=e.slice(n.length+qo),a=e.slice(n.length).length>qo;t.innerHTML=`<span class="invisible">${n}</span><span class=${a?"ellipsis":""}>${i}</span><span class="invisible">${r}</span>`}catch{}}function Wo(t,e={}){const n=[],i=Object.assign({},Np,e.rejectFilter?.reduce((s,c)=>(s[c]=!0,s),{})),r=document.createTreeWalker(t,NodeFilter.SHOW_TEXT,{acceptNode(s){return i[s.parentNode.nodeName]?NodeFilter.FILTER_REJECT:NodeFilter.FILTER_ACCEPT}},!1);let a;for(;a=r.nextNode();)n.push(a);return n}const zp=window.matchMedia("(hover: hover)").matches;function Bp(t){const{mentions:e=[],instance:n,previewMode:i,statusURL:r}=t||{};return a=>{if(a.metaKey||a.ctrlKey||a.shiftKey||a.altKey||a.which===2)return;let{target:s}=a;if(s.closest(".shortcode-emoji")){const{naturalWidth:u,naturalHeight:f,width:p,height:m}=s,g=2;if(u>p*g||f>m*g){a.preventDefault(),a.stopPropagation(),B.showMediaModal={mediaAttachments:[{type:"image",url:s.src,description:s.title||s.alt}]};return}}if(s=s.closest("a"),!s||!a.currentTarget.contains(s))return;const{href:c}=s,l=s.previousSibling?.textContent,d=l?.endsWith("@"),h=s.innerText.startsWith("@");if((s.classList.contains("u-url")||s.classList.contains("mention"))&&h||d&&!h){const u=(s.querySelector("span")||s).innerText.trim(),f=u.replace(/^@/,""),p=e.find(m=>m.url===c)||e.find(m=>m.acct===f||m.username===f);if(p){a.preventDefault(),a.stopPropagation(),B.showAccount={account:p.acct,instance:n};return}else if(!/^http/i.test(u)){a.preventDefault(),a.stopPropagation(),B.showAccount={account:c,instance:n};return}}else if(!i){const u=l?.endsWith("#");if(s.classList.contains("hashtag")||u){a.preventDefault(),a.stopPropagation();const f=s.innerText.replace(/^#/,"").trim(),p=n?`#/${n}/t/${f}`:`#/t/${f}`;location.hash=p;return}else if(B.unfurledLinks[c]?.url&&r!==c){a.preventDefault(),a.stopPropagation(),B.prevLocation={pathname:location.hash.replace(/^#/,"")},location.hash=`#${B.unfurledLinks[c].url}`;return}}try{const f=URL.parse(c).hostname.replace(/^www\./i,"");if(!s.innerText.toLowerCase().includes(f.toLowerCase())&&!zp){a.preventDefault(),a.stopPropagation();const m=s.innerText.trim();B.showOpenLink={url:c,linkText:m}}}catch{}}}function ie(t){try{return Pt.number(t,{notation:"compact",roundingMode:"floor"})}catch{return t}}const Hp={"@mastodon/edit-media-attributes":">=4.1","@mastodon/list-exclusive":">=4.2","@gotosocial/list-exclusive":">=0.17","@mastodon/filtered-notifications":"~4.3 || >=4.3","@mastodon/fetch-multiple-statuses":"~4.3 || >=4.3","@mastodon/trending-link-posts":"~4.3 || >=4.3","@mastodon/annual-report":"~4.4 || >=4.4","@mastodon/endorsements":"~4.4 || >=4.4"},Vo=/pixelfed/i,ue=/^(?!.*pixelfed).*$/i,Kp=/pleroma/i,jp=/akkoma/i;const Pr={"@mastodon/lists":ue,"@mastodon/filters":ue,"@mastodon/mentions":ue,"@mastodon/trending-hashtags":ue,"@mastodon/trending-links":ue,"@mastodon/post-bookmark":ue,"@mastodon/post-edit":ue,"@mastodon/profile-edit":ue,"@mastodon/profile-private-note":ue,"@mastodon/pinned-posts":ue,"@pixelfed/trending":Vo,"@pixelfed/home-include-reblogs":Vo,"@pixelfed/global-feed":Vo,"@pleroma/local-visibility-post":Kp,"@akkoma/local-visibility-post":jp},Zn={};function Gn(t){try{let{version:e,domain:n}=Ya(),i=Xa()?.software?.name||"mastodon";i==="hometown"&&(i="mastodon");const r=`${n}-${t}`;if(Zn[r])return Zn[r];if(Pr[t])return Zn[r]=Pr[t].test(e);const a=Hp[t];if(!a)return!1;const c=t.match(/^@([a-z]+)\//)[1]===i.toLowerCase();return Zn[r]=c&&Qa(e,a,{includePrerelease:!0,loose:!0})}catch{return!1}}function Uv({skeleton:t,account:e,avatarSize:n="xl",useAvatarStatic:i=!1,instance:r,external:a,internal:s,onClick:c,showActivity:l=!1,showStats:d=!1,accountInstance:h,hideDisplayName:u=!1,relationship:f={},excludeRelationshipAttrs:p=[]}){const{_:m}=Wt();if(t)return o("div",{class:"account-block skeleton",children:[o(ge,{size:n}),o("span",{children:[o("b",{children:"████████"}),o("br",{}),o("span",{class:"account-block-acct",children:"██████"})]})]});if(!e)return null;const{id:g,acct:v,avatar:T,avatarStatic:_,displayName:k,username:S,emojis:b,url:A,statusesCount:C,lastStatusAt:w,bot:L,fields:F,note:M,group:E,followersCount:D,createdAt:P,locked:q,roles:R}=e;let[Q,et,dt]=v.match(/([^@]+)(@.+)/i)||[,v];h&&(dt=`@${h}`);const nt=F?.find(G=>!!G.verifiedAt&&!!G.value),V={};for(const G in f)p.includes(G)||(V[G]=f[G]);const rt=V.following||V.followedBy||V.requested;return o("a",{class:"account-block",href:A,target:a?"_blank":null,title:dt?v:`@${v}`,onClick:G=>{if(!a){if(G.preventDefault(),c)return c(G);s?location.hash=`/${r}/a/${g}`:B.showAccount={account:e,instance:r}}},children:[o("div",{class:"avatar-container",children:o(ge,{url:i?_:T||_,staticUrl:i?void 0:_,size:n,squircle:L})}),o("span",{class:"account-block-content",children:[!u&&o(N,{children:k?o("b",{children:o(on,{text:k,emojis:b})}):o("b",{children:S})})," ",o("span",{class:"account-block-acct bidi-isolate",children:[dt?"":"@",et,o("wbr",{}),dt,q&&o(N,{children:[" ",o(x,{icon:"lock",size:"s",alt:m({id:"G2fuEb"})})]})]}),o(gi,{roles:R,accountUrl:A}),l&&o("div",{class:"account-block-stats",children:[o(I,{id:"ajzDof",values:{0:ie(C)}}),!!w&&o(N,{children:[" ","·"," ",o(I,{id:"f8bJ3C",values:{0:Dn(w,{hideTime:!0})}})]})]}),d&&o("div",{class:"account-block-stats",children:[L&&o(N,{children:o("span",{class:"tag collapsed",children:[o(x,{icon:"bot"})," ",o(I,{id:"9Vdq+j"})]})}),!!E&&o(N,{children:o("span",{class:"tag collapsed",children:[o(x,{icon:"group"})," ",o(I,{id:"L8fEEm"})]})}),rt&&o("div",{class:"shazam-container-horizontal",children:o("div",{class:"shazam-container-inner",children:V.following&&V.followedBy?o("span",{class:"tag minimal",children:o(I,{id:"7oRLbi"})}):V.requested?o("span",{class:"tag minimal",children:o(I,{id:"Yx0Ud8"})}):V.following?o("span",{class:"tag minimal",children:o(I,{id:"y6sq5j"})}):V.followedBy?o("span",{class:"tag minimal",children:o(I,{id:"p3UO/y"})}):null})},f.id),!!D&&o("span",{class:"ib",children:o(I,{id:"Mn1E9C",values:{followersCount:D}})}),!!nt&&o("span",{class:"verified-field",children:[o(x,{icon:"check-circle",size:"s",alt:m({id:"QDEWii"})})," ",o("span",{dangerouslySetInnerHTML:{__html:Ks(nt.value,{emojis:b})}})]}),!L&&!E&&!rt&&!D&&!nt&&!!P&&o("span",{class:"created-at",children:o(I,{id:"PCcEFZ",values:{0:Dn(P,{hideTime:!0})},components:{0:o("time",{datetime:P})}})})]})]})]})}async function qv(t,e={}){if(!t?.length)return;const{masto:n}=Be(),i=Di(),r=t.reduce((a,s)=>(!a.includes(s.id)&&!e[s.id]&&s.id!==i&&a.push(s.id),a),[]);if(!r.length)return null;try{return(await n.v1.accounts.relationships.fetch({id:r})).reduce((c,l)=>(c[l.id]=l,c),{})}catch{return null}}function Wv(t,e){return()=>Pt.number(t,{style:"unit",unit:e,unitDisplay:"long"})}const Up=Object.prototype.toString,qp=t=>Up.call(t)==="[object Error]",Wp=new Set(["network error","Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Load failed","Network request failed","fetch failed","terminated"]);function Vp(t){return t&&qp(t)&&t.name==="TypeError"&&typeof t.message=="string"?t.message==="Load failed"?t.stack===void 0:Wp.has(t.message):!1}function Zp(t){if(typeof t=="number"){if(t<0)throw new TypeError("Expected `retries` to be a non-negative number.");if(Number.isNaN(t))throw new TypeError("Expected `retries` to be a valid number or Infinity, got NaN.")}else if(t!==void 0)throw new TypeError("Expected `retries` to be a number or Infinity.")}function Yn(t,e,{min:n=0,allowInfinity:i=!1}={}){if(e!==void 0){if(typeof e!="number"||Number.isNaN(e))throw new TypeError(`Expected \`${t}\` to be a number${i?" or Infinity":""}.`);if(!i&&!Number.isFinite(e))throw new TypeError(`Expected \`${t}\` to be a finite number.`);if(e<n)throw new TypeError(`Expected \`${t}\` to be ≥ ${n}.`)}}class Gp extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}}const Yp=(t,e,n)=>{const i=n.retries-(e-1);return Object.freeze({error:t,attemptNumber:e,retriesLeft:i})};function Xp(t,e){const n=e.randomize?Math.random()+1:1;let i=Math.round(n*Math.max(e.minTimeout,1)*e.factor**(t-1));return i=Math.min(i,e.maxTimeout),i}async function Qp(t,e,n,i,r){let a=t;if(a instanceof Error||(a=new TypeError(`Non-error was thrown: "${a}". You should only throw errors.`)),a instanceof Gp)throw a.originalError;if(a instanceof TypeError&&!Vp(a))throw a;const s=Yp(a,e,n);await n.onFailedAttempt(s);const c=Date.now();if(c-i>=r||e>=n.retries+1||!await n.shouldRetry(s))throw a;const l=Xp(e,n),d=r-(c-i);if(d<=0)throw a;const h=Math.min(l,d);h>0&&await new Promise((u,f)=>{const p=()=>{clearTimeout(m),n.signal?.removeEventListener("abort",p),f(n.signal.reason)},m=setTimeout(()=>{n.signal?.removeEventListener("abort",p),u()},h);n.unref&&m.unref?.(),n.signal?.addEventListener("abort",p,{once:!0})}),n.signal?.throwIfAborted()}async function Jp(t,e={}){if(e={...e},Zp(e.retries),Object.hasOwn(e,"forever"))throw new Error("The `forever` option is no longer supported. For many use-cases, you can set `retries: Infinity` instead.");e.retries??=10,e.factor??=2,e.minTimeout??=1e3,e.maxTimeout??=Number.POSITIVE_INFINITY,e.randomize??=!1,e.onFailedAttempt??=()=>{},e.shouldRetry??=()=>!0,Yn("factor",e.factor,{min:0,allowInfinity:!1}),Yn("minTimeout",e.minTimeout,{min:0,allowInfinity:!1}),Yn("maxTimeout",e.maxTimeout,{min:0,allowInfinity:!0});const n=e.maxRetryTime??Number.POSITIVE_INFINITY;Yn("maxRetryTime",n,{min:0,allowInfinity:!0}),e.factor>0||(e.factor=1),e.signal?.throwIfAborted();let i=0;const r=Date.now(),a=n;for(;i<e.retries+1;){i++;try{e.signal?.throwIfAborted();const s=await t(i);return e.signal?.throwIfAborted(),s}catch(s){await Qp(s,i,e,r,a)}}throw new Error("Retry attempts exhausted without throwing an error.")}const js="LanguageDetector"in self,tm=js&&"Translator"in self;let Fe;js&&(async()=>{try{const t=await LanguageDetector.availability();if(t==="unavailable")return;t==="available"?Fe=await LanguageDetector.create():(Fe=await LanguageDetector.create({monitor(e){e.addEventListener("downloadprogress",n=>{})}}),await Fe.ready)}catch{}})();const em=async(t,e,n)=>{let i;const r=e;if(e==="auto"){if(!Fe?.detect)return{error:"No language detector"};try{e=(await Fe.detect(t))[0].detectedLanguage,i=e}catch(s){return{error:s}}}const a=`💬 BROWSER TRANSLATE ${t}`;console.groupCollapsed(a);try{const s=await Translator.availability({sourceLanguage:e,targetLanguage:n});if(s==="unavailable")return console.groupEnd(a),{error:`Unsupported language pair: ${e} -> ${n}`};let c;s==="available"?c=await Translator.create({sourceLanguage:e,targetLanguage:n}):(c=await Translator.create({sourceLanguage:e,targetLanguage:n,monitor(d){d.addEventListener("downloadprogress",h=>{})}}),await c.ready);const l=await c.translate(t);return console.groupEnd(a),{content:l,detectedSourceLanguage:i,provider:"browser"}}catch(s){return console.groupEnd(a),{error:s}}};var nm=Object.defineProperty,om=(t,e,n)=>e in t?nm(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,Xn=(t,e,n)=>om(t,typeof e!="symbol"?e+"":e,n),bi=new Map,Qn=new WeakMap,$r=0,im=void 0;function rm(t){return t?(Qn.has(t)||($r+=1,Qn.set(t,$r.toString())),Qn.get(t)):"0"}function sm(t){return Object.keys(t).sort().filter(e=>t[e]!==void 0).map(e=>`${e}_${e==="root"?rm(t.root):t[e]}`).toString()}function am(t){const e=sm(t);let n=bi.get(e);if(!n){const i=new Map;let r;const a=new IntersectionObserver(s=>{s.forEach(c=>{var l;const d=c.isIntersecting&&r.some(h=>c.intersectionRatio>=h);t.trackVisibility&&typeof c.isVisible>"u"&&(c.isVisible=d),(l=i.get(c.target))==null||l.forEach(h=>{h(d,c)})})},t);r=a.thresholds||(Array.isArray(t.threshold)?t.threshold:[t.threshold||0]),n={id:e,observer:a,elements:i},bi.set(e,n)}return n}function Us(t,e,n={},i=im){if(typeof window.IntersectionObserver>"u"&&i!==void 0){const l=t.getBoundingClientRect();return e(i,{isIntersecting:i,target:t,intersectionRatio:typeof n.threshold=="number"?n.threshold:0,time:0,boundingClientRect:l,intersectionRect:l,rootBounds:l}),()=>{}}const{id:r,observer:a,elements:s}=am(n),c=s.get(t)||[];return s.has(t)||s.set(t,c),c.push(e),a.observe(t),function(){c.splice(c.indexOf(e),1),c.length===0&&(s.delete(t),a.unobserve(t)),s.size===0&&(a.disconnect(),bi.delete(r))}}function cm(t){return typeof t.children!="function"}var Vv=class extends ds{constructor(t){super(t),Xn(this,"node",null),Xn(this,"_unobserveCb",null),Xn(this,"handleNode",e=>{this.node&&(this.unobserve(),!e&&!this.props.triggerOnce&&!this.props.skip&&this.setState({inView:!!this.props.initialInView,entry:void 0})),this.node=e||null,this.observeNode()}),Xn(this,"handleChange",(e,n)=>{e&&this.props.triggerOnce&&this.unobserve(),cm(this.props)||this.setState({inView:e,entry:n}),this.props.onChange&&this.props.onChange(e,n)}),this.state={inView:!!t.initialInView,entry:void 0}}componentDidMount(){this.unobserve(),this.observeNode()}componentDidUpdate(t){(t.rootMargin!==this.props.rootMargin||t.root!==this.props.root||t.threshold!==this.props.threshold||t.skip!==this.props.skip||t.trackVisibility!==this.props.trackVisibility||t.delay!==this.props.delay)&&(this.unobserve(),this.observeNode())}componentWillUnmount(){this.unobserve()}observeNode(){if(!this.node||this.props.skip)return;const{threshold:t,root:e,rootMargin:n,trackVisibility:i,delay:r,fallbackInView:a}=this.props;this._unobserveCb=Us(this.node,this.handleChange,{threshold:t,root:e,rootMargin:n,trackVisibility:i,delay:r},a)}unobserve(){this._unobserveCb&&(this._unobserveCb(),this._unobserveCb=null)}render(){const{children:t}=this.props;if(typeof t=="function"){const{inView:p,entry:m}=this.state;return t({inView:p,entry:m,ref:this.handleNode})}const{as:e,triggerOnce:n,threshold:i,root:r,rootMargin:a,onChange:s,skip:c,trackVisibility:l,delay:d,initialInView:h,fallbackInView:u,...f}=this.props;return Ja(e||"div",{ref:this.handleNode,...f},t)}};function lm({threshold:t,delay:e,trackVisibility:n,rootMargin:i,root:r,triggerOnce:a,skip:s,initialInView:c,fallbackInView:l,onChange:d}={}){var h;const[u,f]=z(null),p=O(d),[m,g]=z({inView:!!c,entry:void 0});p.current=d,W(()=>{if(s||!u)return;let k;return k=Us(u,(S,b)=>{g({inView:S,entry:b}),p.current&&p.current(S,b),b.isIntersecting&&a&&k&&(k(),k=void 0)},{root:r,rootMargin:i,threshold:t,trackVisibility:n,delay:e},l),()=>{k&&k()}},[Array.isArray(t)?t.toString():t,u,r,i,a,s,n,l,e]);const v=(h=m.entry)==null?void 0:h.target,T=O(void 0);!u&&v&&!a&&!s&&T.current!==v&&(T.current=v,g({inView:!!c,entry:void 0}));const _=[f,m.inView,m.entry];return _.ref=_[0],_.inView=_[1],_.entry=_[2],_}const Rr=48,Zo={};function qs({id:t,children:e}){const n=O(),i=!!Zo[t],[r,a]=z(!1),[s,c]=z(i||!1),{ref:l}=lm({root:null,rootMargin:`-${Rr}px 0px 0px 0px`,trackVisibility:!0,delay:1e3,onChange:d=>{d&&(a(!0),t&&(Zo[t]=!0))},triggerOnce:!0,skip:s||r});return W(()=>{if(!n.current)return;const d=n.current.getBoundingClientRect();d.bottom>Rr&&(d.top<window.innerHeight?a(!0):c(!0),t&&(Zo[t]=!0))},[]),s?e:o("div",{ref:n,class:"shazam-container no-animation",hidden:!r,children:o("div",{ref:l,class:"shazam-container-inner",children:e})})}const um={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},dm=Object.entries(Bs.sl).map(([t,e])=>({code:t,name:e})),{PHANPY_TRANSLANG_INSTANCES:Nr}=um,wi=Nr?Nr.split(/\s+/):[],Ws=hs({limit:1,interval:2e3}),Vs=1e3*60*60;let Go=0;function hm(t,e,n){return Jp(()=>{let r=wi[Go];const a=t.length>2e3;let s;return a?s=fetch(`https://${r}/api/v1/translate`,{method:"POST",priority:"low",referrerPolicy:"no-referrer",headers:{"Content-Type":"application/json"},body:JSON.stringify({sl:e,tl:n,text:t})}):s=fetch(`https://${r}/api/v1/translate?sl=${encodeURIComponent(e)}&tl=${encodeURIComponent(n)}&text=${encodeURIComponent(t)}`,{priority:"low",referrerPolicy:"no-referrer"}),s.then(c=>{if(!c.ok)throw new Error(c.statusText);return c.json()}).then(c=>({provider:"translang",content:c.translated_text,detectedSourceLanguage:c.detected_language,pronunciation:c.pronunciation}))},{retries:3,onFailedAttempt:r=>{Go=(Go+1)%wi.length}})}const Zs=bo(hm,{maxAge:Vs}),fm=bo(Ws(Zs),{maxAge:Vs}),pm=Ws(em);function mm({forceTranslate:t,sourceLanguage:e,onTranslate:n,text:i="",mini:r,autoDetected:a}){const{_:s}=Wt(),c=Hs(!0),[l,d]=z("default"),[h,u]=z(null),[f,p]=z(null),[m,g]=z(null),v=O(),T=e?bn(e):null,_=bn(c),k=O("auto");n||(n=async(...b)=>{if(tm){const A=await pm(...b);if(A&&!A.error)return A}return r?await fm(...b):await Zs(...b)});const S=async()=>{d("loading");try{const{content:b,detectedSourceLanguage:A,provider:C,error:w,...L}=await n(i,k.current,c);if(b){if(A){const F=bn(A);g(F)}if(C==="translang"){const F=L?.pronunciation;F&&u(F)}p(b),d("default"),!r&&b.trim()!==i.trim()&&v.current&&(v.current.open=!0,v.current.scrollIntoView({behavior:"smooth",block:"nearest"}))}else d("error")}catch{d("error")}};return W(()=>{t&&S()},[t]),r?f&&f.trim()!==i.trim()&&m!==_?o(qs,{children:o("div",{class:"status-translation-block-mini",children:[o(x,{icon:"translate",alt:s({id:"zVJKbG",values:{sourceLangText:T}})}),o("output",{lang:c,dir:"auto",title:h||"",children:f})]})}):null:o("div",{class:"status-translation-block",onClick:b=>{b.preventDefault()},children:o("details",{ref:v,children:[o("summary",{children:o("button",{type:"button",onClick:async b=>{b.preventDefault(),b.stopPropagation(),v.current.open=!v.current.open,l!=="loading"&&(f||S())},children:[o(x,{icon:"translate"})," ",o("span",{children:s(l==="loading"?{id:"Zxkt/v"}:e&&T&&!m?a?{id:"R20Yf9",values:{sourceLangText:T}}:{id:"h8zDAI",values:{sourceLangText:T}}:{id:"pi8x/S"})})]})}),o("div",{class:"translated-block",children:[o("div",{class:"translation-info insignificant",children:[o("select",{class:"translated-source-select",disabled:l==="loading",onChange:b=>{k.current=b.target.value,S()},children:dm.map(b=>{const A=bn({code:b.code,fallback:b.name}),C=bn({code:b.code,locale:b.code}),w=C&&A!==C;return o("option",{value:b.code,children:b.code==="auto"?s({id:"Bze3gr",values:{0:m??"…"}}):w?`${C} - ${A}`:A})})})," ",o("span",{children:["→ ",_]}),o(ho,{abrupt:!0,hidden:l!=="loading"})]}),l==="error"?o("p",{class:"ui-state",children:o(I,{id:"m5LihO"})}):!!f&&o(N,{children:[o("output",{class:"translated-content",lang:c,dir:"auto",children:f}),!!h&&o("output",{class:"translated-pronunciation-content",tabIndex:-1,onClick:b=>{b.target.classList.toggle("expand")},children:h})]})]})]})})}const gm=wi?.length?mm:()=>null;function ye(t){return new Promise((e,n)=>{t.oncomplete=t.onsuccess=()=>e(t.result),t.onabort=t.onerror=()=>n(t.error)})}function Gs(t,e){let n;const i=()=>{if(n)return n;const r=indexedDB.open(t);return r.onupgradeneeded=()=>r.result.createObjectStore(e),n=ye(r),n.then(a=>{a.onclose=()=>n=void 0},()=>{}),n};return(r,a)=>i().then(s=>a(s.transaction(e,r).objectStore(e)))}let Yo;function je(){return Yo||(Yo=Gs("keyval-store","keyval")),Yo}function vm(t,e=je()){return e("readonly",n=>ye(n.get(t)))}function ym(t,e,n=je()){return n("readwrite",i=>(i.put(e,t),ye(i.transaction)))}function bm(t,e=je()){return e("readonly",n=>Promise.all(t.map(i=>ye(n.get(i)))))}function wm(t,e=je()){return e("readwrite",n=>(n.delete(t),ye(n.transaction)))}function _m(t,e=je()){return e("readwrite",n=>(t.forEach(i=>n.delete(i)),ye(n.transaction)))}function Tm(t=je()){return t("readwrite",e=>(e.clear(),ye(e.transaction)))}function km(t,e){return t.openCursor().onsuccess=function(){this.result&&(e(this.result),this.result.continue())},ye(t.transaction)}function Sm(t=je()){return t("readonly",e=>{if(e.getAllKeys)return ye(e.getAllKeys());const n=[];return km(e,i=>n.push(i.key)).then(()=>n)})}function Or(t,e){const n=Gs(t,e);return{set:(i,r)=>ym(i,r,n),get:i=>vm(i,n),getMany:i=>bm(i,n),del:i=>wm(i,n),delMany:i=>_m(i,n),clear:()=>Tm(n),keys:()=>Sm(n)}}const Zv={drafts:Or("drafts-db","drafts-store"),catchup:Or("catchup-db","catchup-store")},Ys=se({}),Em=!!document.startViewTransition;function Gv({children:t,statusID:e}){const n=O([]),[i,r]=z(!1),[a,s]=z(0);function c(p){p!==a&&(Em?document.startViewTransition(()=>{s(p)}):s(p))}async function l(){const{masto:p}=Be(),m=await p.v1.statuses.$select(e).history.list();m.sort((g,v)=>Date.parse(v.createdAt)-Date.parse(g.createdAt)),n.current=m}async function d(){try{await l(),r(!0),c(0)}catch{r(!1)}}function h(){n.current=[],r(!1),c(0)}function u(){c(p=>Math.min(p+1,n.current.length-1))}function f(){c(p=>Math.max(p-1,0))}return o(Ys.Provider,{value:{editHistoryRef:n,initEditHistory:d,exitEditHistory:h,editHistoryMode:i,editedAtIndex:a,prevEditedAt:u,nextEditedAt:f},children:t})}function Cm(){return It(Ys)}const Ki=se();function Am(t,e){if(!t?.length)return!1;const n=t.filter(s=>{const{filter:c}=s,l=c.context.includes(e);return l?c.expiresAt?Date.parse(c.expiresAt)>Date.now():l:!1});if(!n.length)return!1;if(n.some(s=>s.filter.filterAction==="hide"))return{action:"hide"};if(n.every(s=>s.filter.filterAction==="blur")){const s=n.map(c=>c.filter.title);return{action:"blur",titles:s,titlesStr:s.join(" • ")}}if(n.some(s=>!!s.filter.filterAction)){const s=n.map(c=>c.filter.title);return{action:"warn",titles:s,titlesStr:s.join(" • ")}}return!1}const ko=Kt(Am);function xm(t,e,n){const{filtered:i}=t;if(!i?.length||n&&t.account?.id===n)return!0;const a=ko(i,e);return a?a.action!=="hide":!0}function Yv(t,e){if(!t?.length)return[];if(!e)return t;const n=Di();return t.filter(i=>xm(i,e,n))}const Jn=document.createElement("template");function Mm(t){if(!t)return 0;Jn.innerHTML=t;const e=Jn.content.querySelectorAll(".invisible");for(let i=0;i<e.length;i++)e[i].remove();let n="";for(let i=0;i<Jn.content.childNodes.length;i++){const r=Jn.content.childNodes[i];n+=r.innerText||r.textContent||""}return n.length}const _i="speechSynthesis"in window;function Im(t,e){if(_i)try{speechSynthesis.speaking&&speechSynthesis.cancel();const n=new SpeechSynthesisUtterance(t);e&&(n.lang=e),speechSynthesis.speak(n)}catch(n){alert(n)}}function Lm(t,e,n,i){var r=this,a=O(null),s=O(0),c=O(0),l=O(null),d=O([]),h=O(),u=O(),f=O(t),p=O(!0);f.current=t;var m=typeof window<"u",g=!e&&e!==0&&m;if(typeof t!="function")throw new TypeError("Expected a function");e=+e||0;var v=!!(n=n||{}).leading,T=!("trailing"in n)||!!n.trailing,_="maxWait"in n,k="debounceOnServer"in n&&!!n.debounceOnServer,S=_?Math.max(+n.maxWait||0,e):null;W(function(){return p.current=!0,function(){p.current=!1}},[]);var b=ct(function(){var A=function(D){var P=d.current,q=h.current;return d.current=h.current=null,s.current=D,c.current=c.current||D,u.current=f.current.apply(q,P)},C=function(D,P){g&&cancelAnimationFrame(l.current),l.current=g?requestAnimationFrame(D):setTimeout(D,P)},w=function(D){if(!p.current)return!1;var P=D-a.current;return!a.current||P>=e||P<0||_&&D-s.current>=S},L=function(D){return l.current=null,T&&d.current?A(D):(d.current=h.current=null,u.current)},F=function D(){var P=Date.now();if(v&&c.current===s.current&&M(),w(P))return L(P);if(p.current){var q=e-(P-a.current),R=_?Math.min(q,S-(P-s.current)):q;C(D,R)}},M=function(){i&&i({})},E=function(){if(m||k){var D=Date.now(),P=w(D);if(d.current=[].slice.call(arguments),h.current=r,a.current=D,P){if(!l.current&&p.current)return s.current=a.current,C(F,e),v?A(a.current):u.current;if(_)return C(F,e),A(a.current)}return l.current||C(F,e),u.current}};return E.cancel=function(){var D=l.current;D&&(g?cancelAnimationFrame(l.current):clearTimeout(l.current)),s.current=0,d.current=a.current=h.current=l.current=null,D&&i&&i({})},E.isPending=function(){return!!l.current},E.flush=function(){return l.current?L(Date.now()):u.current},E},[v,_,e,S,T,g,m,k,i]);return b}function Dm(t,e,n){var i=n===void 0?{}:n,r=i.leading,a=i.trailing;return Lm(t,e,{maxWait:e,leading:r===void 0||r,trailing:a===void 0||a})}function Pm(t,e){var n=O(null),i=O(null);i.current=e;var r=O(null);W(function(){a()});var a=Et(function(){var s=r.current,c=i.current,l=s||(c?c instanceof Element?c:c.current:null);n.current&&n.current.element===l&&n.current.subscriber===t||(n.current&&n.current.cleanup&&n.current.cleanup(),n.current={element:l,subscriber:t,cleanup:l?t(l):void 0})},[t]);return W(function(){return function(){n.current&&n.current.cleanup&&(n.current.cleanup(),n.current=null)}},[]),Et(function(s){r.current=s,a()},[a])}function Fr(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}function $m(t){t===void 0&&(t={});var e=t.onResize,n=O(void 0);n.current=e;var i=t.round||Math.round,r=O(),a=z({width:void 0,height:void 0}),s=a[0],c=a[1],l=O(!1);W(function(){return l.current=!1,function(){l.current=!0}},[]);var d=O({width:void 0,height:void 0}),h=Pm(Et(function(u){return(!r.current||r.current.box!==t.box||r.current.round!==i)&&(r.current={box:t.box,round:i,instance:new ResizeObserver(function(f){var p=f[0],m=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",g=Fr(p,m,"inlineSize"),v=Fr(p,m,"blockSize"),T=g?i(g):void 0,_=v?i(v):void 0;if(d.current.width!==T||d.current.height!==_){var k={width:T,height:_};d.current.width=T,d.current.height=_,n.current?n.current(k):l.current||c(k)}})}),r.current.instance.observe(u,{box:t.box}),function(){r.current&&r.current.instance.unobserve(u)}},[t.box,i]),t.ref);return ct(function(){return{ref:h,width:s.width,height:s.height}},[h,s.width,s.height])}function Rm(t={}){const e=Dm(t.onResize,300);return $m({...t,onResize:e})}function An({className:t="truncated"}={}){const e=O();return Rm({ref:e,box:"border-box",onResize:({height:i})=>{if(e.current){const{scrollHeight:r}=e.current;let a=r>i;if(a){const{height:s,maxHeight:c}=getComputedStyle(e.current),l=parseInt(c||s,10);a=r>l}e.current.classList.toggle(t,a)}}}),e}const xn={public:"earth",unlisted:"group",private:"lock",direct:"message",local:"building"},Oe={public:{id:"7d1a0d"},local:{id:"d5zxa4"},unlisted:{id:"pPYeIN"},private:{id:"x5LEuB"},direct:{id:"IV4QaU"}},Nm=["\\\\\\[[\\s\\S]*?\\\\\\]","\\\\\\([\\s\\S]*?\\\\\\)"],zr=new RegExp(Nm.join("|"),"g");function Om(t){const e=["\\\\\\[","\\\\\\("],n=new RegExp(`(${e.join("|")})`),i=document.createTreeWalker(t,NodeFilter.SHOW_TEXT),r=[];let a;for(;a=i.nextNode();)r.push(a);for(const s of r){const c=s.textContent,l=c.match(n);if(!l)continue;const h=l[0]==="\\["?"\\]":"\\)",u=[s];let f=s,p=!1,m=c;if(c.includes(h))p=!0;else for(;f.nextSibling&&!p;){const g=f.nextSibling;if(g.nodeType===Node.TEXT_NODE)u.push(g),m+=g.textContent,g.textContent.includes(h)&&(p=!0);else if(g.nodeType===Node.ELEMENT_NODE&&g.tagName==="BR")u.push(g),m+=`
`;else break;f=g}if(p&&u.length>1){s.textContent=m;for(let g=1;g<u.length;g++)u[g].remove()}}}const Fm=({content:t,contentRef:e,onRevert:n})=>{if(zr.lastIndex=0,!zr.test(t))return null;const{_:r}=Wt(),[a,s]=z(!1),c=Et(async l=>{if(l.preventDefault(),l.stopPropagation(),a)s(!1),n();else try{const d=window.temml||(window.temml=(await fs(async()=>{const{default:p}=await import("./temml-KWa8qPDv.js");return{default:p}},[],import.meta.url))?.default);Om(e.current);const h=e.current.innerHTML;d.renderMathInElement(e.current,{fences:"(",annotate:!0,throwOnError:!0,errorCallback:p=>{}});const u=e.current.querySelector("math.tml-display"),f=e.current.innerHTML!==h;u&&f?s(!0):(ht(r({id:"HBIZeo"})),s(!1),n())}catch{}},[a]);return o("div",{class:"math-block",children:[o(x,{icon:"formula",size:"s"})," ",o("span",{children:r({id:"/nf2x7"})})," ",o("button",{type:"button",class:"light small",onClick:c,children:r(a?{id:"AJqQb+"}:{id:"dP6iYK"})})]})},Xs=new Uint8Array(128);for(let t=0;t<83;t++)Xs["0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz#$%*+,-.:;=?@[]^_{|}~".charCodeAt(t)]=t;const ao=(t,e,n)=>{let i=0;for(;e<n;)i*=83,i+=Xs[t.charCodeAt(e++)];return i},Qs=Math.pow,Pn=Math.PI,zm=Pn*2,Js=3294.6,ta=269.025,Bm=t=>t>10.31475?Qs(t/ta+.052132,2.4):t/Js,Xo=t=>~~(t>1227e-8?ta*Qs(t,.416666)-13.025:t*Js+1),Mn=t=>(t<0?-1:1)*t*t,Br=t=>{for(t+=Pn/2;t>Pn;)t-=zm;const e=1.27323954*t-.405284735*Mn(t);return .225*(Mn(e)-e)+e};function ji(t){const e=ao(t,2,6);return[e>>16,e>>8&255,e&255]}function Hm(t,e,n,i){const r=ao(t,0,1),a=r%9+1,s=~~(r/9)+1,c=a*s;let l=0,d=0,h=0,u=0,f=0,p=0,m=0,g=0,v=0,T=0,_=0,k=0;const S=(ao(t,1,2)+1)/13446*(i|1),b=new Float64Array(c*3),A=ji(t);for(l=0;l<3;l++)b[l]=Bm(A[l]);for(l=1;l<c;l++)k=ao(t,4+l*2,6+l*2),b[l*3]=Mn(~~(k/361)-9)*S,b[l*3+1]=Mn(~~(k/19)%19-9)*S,b[l*3+2]=Mn(k%19-9)*S;const C=new Float64Array(s*n),w=new Float64Array(a*e);for(d=0;d<s;d++)for(u=0;u<n;u++)C[d*n+u]=Br(Pn*u*d/n);for(l=0;l<a;l++)for(h=0;h<e;h++)w[l*e+h]=Br(Pn*h*l/e);const L=e*4,F=new Uint8ClampedArray(L*n);for(u=0;u<n;u++)for(h=0;h<e;h++){for(f=p=m=0,d=0;d<s;d++)for(v=C[d*n+u],l=0;l<a;l++)g=w[l*e+h]*v,T=(l+d*a)*3,f+=b[T]*g,p+=b[T+1]*g,m+=b[T+2]*g;_=4*h+u*L,F[_]=Xo(f),F[_+1]=Xo(p),F[_+2]=Xo(m),F[_+3]=255}return F}var ea="kvfysmfp",na="ufhsfnkm",Km=".".concat(ea,"{overflow:hidden;touch-action:none}.").concat(na,"{transform-origin: 0 0}"),jm=typeof window>"u",Um=function(){return!jm&&("ontouchstart"in window||navigator.maxTouchPoints>0)};var qm=function(t){var e=t.x,n=t.y,i=t.scale;return"scale3d(".concat(i,",").concat(i,", 1) translate3d(").concat(e,"px, ").concat(n,"px, 0)")};var Wm=Math.min,Vm=Math.max;function Hr(t){var e=t.containerDimension,n=t.childDimension,i=t.padding,r=t.centerContained,a=n-e;return a+2*i<=0&&r?[a/2,a/2]:[Wm(a+i,0)-i,Vm(0,a+i)]}var Kr=function(t,e){return e?"".concat(t," ").concat(e):t},to=Math.abs,Zm=Math.min,Gm=Math.sqrt,oa=typeof window>"u",Ym=oa?!1:/(Mac)/i.test(navigator.platform),Ye=function(t){return t==="drag"},wn=function(t){return t==="zoom"},Xm=function(t){return Ym&&t.ctrlKey},_n=function(t){t.stopPropagation(),t.preventDefault()},jr=function(t,e){var n=t.x-e.x,i=t.y-e.y;return Gm(n*n+i*i)},Qm=function(t,e){var n=jr(t[0],t[1]),i=jr(e[0],e[1]);return i/n},Jm=function(t,e){return t>e-.01&&t<e+.01},tg=function(t){return-Math.cos(t*Math.PI)/2+.5},eg=function(t){return{x:t.pageX,y:t.pageY}},eo=function(t){return Array.from(t).map(eg)},Ur=function(t,e){return t+e},ng=function(t){return{x:t.map(function(e){var n=e.x;return n}).reduce(Ur,0)/t.length,y:t.map(function(e){var n=e.y;return n}).reduce(Ur,0)/t.length}},Qo=function(t,e,n){return n<t?t:n>e?e:n},og=function(t){return!(t.ctrlKey||t.metaKey)},ig=function(t){if(t){var e=t.offsetWidth,n=t.offsetHeight;if(e&&n)return{width:e,height:n};var i=getComputedStyle(t),r=parseFloat(i.width),a=parseFloat(i.height);if(a&&r)return{width:r,height:a}}return{width:0,height:0}},rg=function(t,e){return{x:e.x-t.x,y:e.y-t.y}},sg=function(t,e){return t.x===e.x&&t.y===e.y},Pe=function(){},no={x:0,y:0},qr=function(t){tc(e,t);function e(){var n=t!==null&&t.apply(this,arguments)||this;return n._prevDragMovePoint=null,n._containerObserver=null,n._fingers=0,n._firstMove=!0,n._initialOffset=Bt({},no),n._interaction=null,n._isDoubleTap=!1,n._isOffsetsSet=!1,n._lastDragPosition=null,n._lastScale=1,n._lastTouchStart=0,n._lastZoomCenter=null,n._listenMouseMove=!1,n._nthZoom=0,n._offset=Bt({},no),n._startOffset=Bt({},no),n._startTouches=null,n._updatePlaned=!1,n._wheelTimeOut=null,n._zoomFactor=1,n._initialZoomFactor=1,n._draggingPoint=Bt({},no),n._ignoreNextClick=!1,n._containerRef=ec(),n._handleClick=function(i){n._ignoreNextClick&&(n._ignoreNextClick=!1,i.stopPropagation())},n._onResize=function(){var i;!((i=n._containerRef)===null||i===void 0)&&i.current&&(n._updateInitialZoomFactor(),n._setupOffsets(),n._update())},n._handlerOnTouchEnd=n._handlerIfEnable(function(i){n._fingers=i.touches.length,n.props.shouldCancelHandledTouchEndEvents&&(wn(n._interaction)||Ye(n._interaction)&&(n._startOffset.x!==n._offset.x||n._startOffset.y!==n._offset.y))&&_n(i),Ye(n._interaction)&&!n._enoughToDrag()&&n._handleClick(i),n._updateInteraction(i)}),n._handlerOnTouchStart=n._handlerIfEnable(function(i){n._firstMove=!0,n._fingers=i.touches.length,n._detectDoubleTap(i)}),n._handlerOnTouchMove=n._handlerIfEnable(function(i){n._isDoubleTap||(n._collectInertia(i),n._firstMove?(n._updateInteraction(i),n._interaction&&_n(i),n._startOffset=Bt({},n._offset),n._startTouches=eo(i.touches)):(wn(n._interaction)?n._startTouches&&n._startTouches.length===2&&i.touches.length===2&&n._handleZoom(i,Qm(n._startTouches,eo(i.touches))):Ye(n._interaction)&&n._handleDrag(i),n._interaction&&(_n(i),n._update())),n._firstMove=!1)}),n._handlerWheel=function(i){if(!n.props.shouldInterceptWheel(i)){_n(i);var r=i.pageX,a=i.pageY,s=i.deltaY,c=i.deltaMode,l=1;(Xm(i)||c===1)&&(l=15);var d={touches:[{pageX:r,pageY:a}]},h=n._getOffsetByFirstTouch(d),u=s*l;n._stopAnimation(),n._scaleTo(n._zoomFactor-u/n.props.wheelScaleFactor,h),n._update(),clearTimeout(n._wheelTimeOut),n._wheelTimeOut=setTimeout(function(){return n._sanitize()},100)}},n._handlers=n.props.isTouch()?[["touchstart",n._handlerOnTouchStart],["touchend",n._handlerOnTouchEnd],["touchmove",n._handlerOnTouchMove]]:[["mousemove",n.simulate(n._handlerOnTouchMove),n.props._document],["mouseup",n.simulate(n._handlerOnTouchEnd),n.props._document],["mousedown",n.simulate(n._handlerOnTouchStart)],["click",n._handleClick],["wheel",n._handlerWheel]],n}return e.prototype._handleDragStart=function(n){this._ignoreNextClick=!0,this.props.onDragStart(),this._stopAnimation(),this._resetInertia(),this._lastDragPosition=null,this._hasInteraction=!0,this._draggingPoint=this._offset,this._handleDrag(n)},e.prototype._handleDrag=function(n){var i=this._getOffsetByFirstTouch(n);this._enoughToDrag()?this._drag(i,this._lastDragPosition):this._virtualDrag(i,this._lastDragPosition),this._offset=this._sanitizeOffset(this._offset),this._lastDragPosition=i},e.prototype._resetInertia=function(){this._velocity=null,this._prevDragMovePoint=null},e.prototype._realizeInertia=function(){var n=this,i=this.props,r=i.inertiaFriction,a=i.inertia;if(!(!a||!this._velocity)){var s=this._velocity,c=s.x,l=s.y;if(c||l){this._stopAnimation(),this._resetInertia();var d=function(){if(c*=r,l*=r,!c&&!l)return n._stopAnimation();var h=Bt({},n._offset);if(n._addOffset({x:c,y:l}),n._offset=n._sanitizeOffset(n._offset),sg(h,n._offset))return n._stopAnimation();n._update({isAnimation:!0})};this._animate(d,{duration:9999})}}},e.prototype._collectInertia=function(n){var i=n.touches;if(this.props.inertia){var r=eo(i)[0],a=this._prevDragMovePoint;a&&(this._velocity=rg(r,a)),this._prevDragMovePoint=r}},e.prototype._handleDragEnd=function(){this.props.onDragEnd(),this._end(),this._realizeInertia()},e.prototype._handleZoomStart=function(){this.props.onZoomStart(),this._stopAnimation(),this._lastScale=1,this._nthZoom=0,this._lastZoomCenter=null,this._hasInteraction=!0},e.prototype._handleZoom=function(n,i){var r=ng(this._getOffsetTouches(n)),a=i/this._lastScale;this._lastScale=i,this._nthZoom+=1,this._nthZoom>3&&(this._scale(a,r),this._drag(r,this._lastZoomCenter),this.props.enforceBoundsDuringZoom&&(this._offset=this._sanitizeOffset(this._offset))),this._lastZoomCenter=r},e.prototype._handleZoomEnd=function(){this.props.onZoomEnd(),this._end()},e.prototype._handleDoubleTap=function(n){var i=this;if(!(this._hasInteraction||this.props.tapZoomFactor===0)){var r=this.props.doubleTapZoomOutOnMaxScale&&this._zoomFactor===this.props.maxZoom||this.props.doubleTapToggleZoom&&this._zoomFactor>1;this.props.onDoubleTap(),this._ignoreNextClick=!0;var a=this._zoomFactor+this.props.tapZoomFactor,s=this._zoomFactor,c=function(d){i._scaleTo(s+d*(a-s),l)},l=this._getOffsetByFirstTouch(n);this._isDoubleTap=!0,s>a&&(l=this._getCurrentZoomCenter()),r?this._zoomOutAnimation():this._animate(c)}},e.prototype._computeInitialOffset=function(){var n=this._getContainerRect(),i=this._getChildSize(),r=i.width,a=i.height,s=-to(r*this._getInitialZoomFactor()-n.width)/2,c=-to(a*this._getInitialZoomFactor()-n.height)/2;this._initialOffset={x:s,y:c}},e.prototype._resetOffset=function(){this._offset=Bt({},this._initialOffset)},e.prototype._setupOffsets=function(){this.props.setOffsetsOnce&&this._isOffsetsSet||(this._isOffsetsSet=!0,this._computeInitialOffset(),this._resetOffset())},e.prototype._sanitizeOffset=function(n){var i=this._getContainerRect(),r=this._getChildSize(),a=r.width,s=r.height,c=a*this._getInitialZoomFactor()*this._zoomFactor,l=s*this._getInitialZoomFactor()*this._zoomFactor,d=Hr({containerDimension:i.width,childDimension:c,padding:this.props.horizontalPadding,centerContained:this.props.centerContained}),h=d[0],u=d[1],f=Hr({containerDimension:i.height,childDimension:l,padding:this.props.verticalPadding,centerContained:this.props.centerContained}),p=f[0],m=f[1];return{x:Qo(h,u,n.x),y:Qo(p,m,n.y)}},e.prototype.alignCenter=function(n){var i=this,r=Bt({duration:250,animated:!0},n),a=r.x,s=r.y,c=r.scale,l=r.animated,d=r.duration,h=a*this._initialZoomFactor,u=s*this._initialZoomFactor,f=this._zoomFactor,p=Bt({},this._offset),m=this._getContainerRect(),g={x:m.width/2,y:m.height/2};if(this._zoomFactor=1,this._offset={x:-(g.x-h),y:-(g.y-u)},this._scaleTo(c,g),this._stopAnimation(),!l)return this._update();var v=this._zoomFactor-f,T={x:this._offset.x-p.x,y:this._offset.y-p.y};this._zoomFactor=f,this._offset=Bt({},p);var _=function(k){var S=p.x+T.x*k,b=p.y+T.y*k;i._zoomFactor=f+v*k,i._offset=i._sanitizeOffset({x:S,y:b}),i._update()};this._animate(_,{callback:function(){return i._sanitize()},duration:d})},e.prototype.scaleTo=function(n){var i=this,r=Bt({duration:250,animated:!0},n),a=r.x,s=r.y,c=r.scale,l=r.animated,d=r.duration,h=this._zoomFactor,u=Bt({},this._offset);if(this._zoomFactor=1,this._offset={x:0,y:0},this._scaleTo(c,{x:a,y:s}),this._stopAnimation(),!l)return this._update();var f=this._zoomFactor-h,p={x:this._offset.x-u.x,y:this._offset.y-u.y};this._zoomFactor=h,this._offset=Bt({},u);var m=function(g){var v=u.x+p.x*g,T=u.y+p.y*g;i._zoomFactor=h+f*g,i._offset={x:v,y:T},i._update()};this._animate(m,{callback:function(){return i._sanitize()},duration:d})},e.prototype._scaleTo=function(n,i){this._scale(n/this._zoomFactor,i),this._offset=this._sanitizeOffset(this._offset)},e.prototype._scale=function(n,i){n=this._scaleZoomFactor(n),this._addOffset({x:(n-1)*(i.x+this._offset.x),y:(n-1)*(i.y+this._offset.y)}),this.props.onZoomUpdate()},e.prototype._scaleZoomFactor=function(n){var i=this._zoomFactor;return this._zoomFactor*=n,this._zoomFactor=Qo(this.props.minZoom,this.props.maxZoom,this._zoomFactor),this._zoomFactor/i},e.prototype._canDrag=function(){return this.props.draggableUnZoomed||!Jm(this._zoomFactor,1)},e.prototype._drag=function(n,i){if(i){var r=-(n.y-i.y),a=-(n.x-i.x);this.props.lockDragAxis?to(a)>to(r)?this._addOffset({x:a,y:0}):this._addOffset({y:r,x:0}):this._addOffset({x:a,y:r}),this.props.onDragUpdate()}},e.prototype._virtualDrag=function(n,i){if(i){var r=-(n.y-i.y),a=-(n.x-i.x);this._draggingPoint={x:a+this._draggingPoint.x,y:r+this._draggingPoint.y}}},e.prototype._addOffset=function(n){var i=this._offset,r=i.x,a=i.y;this._offset={x:r+n.x,y:a+n.y}},e.prototype._sanitize=function(){this._zoomFactor<this.props.zoomOutFactor?(this._resetInertia(),this._zoomOutAnimation()):this._isInsaneOffset()&&this._sanitizeOffsetAnimation()},e.prototype._isInsaneOffset=function(){var n=this._offset,i=this._sanitizeOffset(n);return i.x!==n.x||i.y!==n.y},e.prototype._sanitizeOffsetAnimation=function(){var n=this,i=this._sanitizeOffset(this._offset),r=Bt({},this._offset),a=function(s){var c=r.x+s*(i.x-r.x),l=r.y+s*(i.y-r.y);n._offset={x:c,y:l},n._update()};this._animate(a)},e.prototype._zoomOutAnimation=function(){var n=this;if(this._zoomFactor!==1){var i=this._zoomFactor,r=1,a=this._getCurrentZoomCenter(),s=function(c){var l=i+c*(r-i);n._scaleTo(l,a)};this._animate(s)}},e.prototype._getInitialZoomFactor=function(){return this._initialZoomFactor},e.prototype._getCurrentZoomCenter=function(){var n=this._offset,i=n.x,r=n.y,a=i-this._initialOffset.x,s=r-this._initialOffset.y;return{x:-1*i-a/(1/this._zoomFactor-1),y:-1*r-s/(1/this._zoomFactor-1)}},e.prototype._getOffsetByFirstTouch=function(n){return this._getOffsetTouches(n)[0]},e.prototype._getOffsetTouches=function(n){var i=this.props._document,r=i.documentElement,a=i.body,s=this._getContainerRect(),c=s.top,l=s.left,d=r.scrollTop||a.scrollTop,h=r.scrollLeft||a.scrollLeft,u=c+d,f=l+h;return eo(n.touches).map(function(p){var m=p.x,g=p.y;return{x:m-f,y:g-u}})},e.prototype._animate=function(n,i){var r=this,a=new Date().getTime(),s=Bt({timeFn:tg,callback:function(){},duration:this.props.animationDuration},i),c=s.timeFn,l=s.callback,d=s.duration,h=function(){if(r._inAnimation){var u=new Date().getTime()-a,f=u/d;u>=d?(n(1),r._stopAnimation(),l(),r._update()):(f=c(f),n(f),r._update({isAnimation:!0}),requestAnimationFrame(h))}};this._inAnimation=!0,requestAnimationFrame(h)},e.prototype._stopAnimation=function(){this._inAnimation=!1},e.prototype._end=function(){this._hasInteraction=!1,this._sanitize(),this._update()},e.prototype._getContainerRect=function(){var n=this._containerRef.current;return n.getBoundingClientRect()},e.prototype._getChildSize=function(){var n=this._containerRef.current;return ig(n?.firstElementChild)},e.prototype._updateInitialZoomFactor=function(){var n=this._getContainerRect(),i=this._getChildSize(),r=n.width/i.width,a=n.height/i.height;this._initialZoomFactor=Zm(r,a)},e.prototype._bindEvents=function(){var n=this,i=this._containerRef.current;window.ResizeObserver?(this._containerObserver=new ResizeObserver(this._onResize),this._containerObserver.observe(i)):window.addEventListener("resize",this._onResize),this._handlers.forEach(function(r){var a=r[0],s=r[1],c=r[2];(c||i).addEventListener(a,s,!0)}),Array.from(i.querySelectorAll("img")).forEach(function(r){return r.addEventListener("load",n._onResize)})},e.prototype._unSubscribe=function(){var n=this,i=this._containerRef.current;this._containerObserver&&(this._containerObserver.disconnect(),this._containerObserver=null),window.removeEventListener("resize",this._onResize),this._handlers.forEach(function(r){var a=r[0],s=r[1],c=r[2];(c||i).removeEventListener(a,s,!0)}),Array.from(i.querySelectorAll("img")).forEach(function(r){return r.removeEventListener("load",n._onResize)})},e.prototype._update=function(n){var i=this;if(!this._updatePlaned){var r=function(){var a=i._getInitialZoomFactor()*i._zoomFactor,s=-i._offset.x/a,c=-i._offset.y/a;i.props.onUpdate({scale:a,x:s,y:c})};if(n?.isAnimation)return r();this._updatePlaned=!0,requestAnimationFrame(function(){i._updatePlaned=!1,r()})}},e.prototype._handlerIfEnable=function(n){var i=this;return function(){for(var r=[],a=0;a<arguments.length;a++)r[a]=arguments[a];i.props.enabled&&n.apply(void 0,r)}},e.prototype._setInteraction=function(n,i){var r=this._interaction;r!==n&&(r&&!n&&(wn(r)?this._handleZoomEnd():Ye(r)&&this._handleDragEnd()),wn(n)?this._handleZoomStart():Ye(n)&&this._handleDragStart(i)),this._interaction=n},e.prototype._distanceBetweenNumbers=function(n,i){return n>i?n-i:i-n},e.prototype._enoughToDrag=function(){return this._distanceBetweenNumbers(this._startOffset.x,this._draggingPoint.x)>5||this._distanceBetweenNumbers(this._startOffset.y,this._draggingPoint.y)>5},e.prototype._updateInteraction=function(n){var i=this._fingers;if(i===2)return this._setInteraction("zoom",n);if(i===1&&this._canDrag())return this._setInteraction("drag",n);this._setInteraction(null,n)},e.prototype._detectDoubleTap=function(n){var i=new Date().getTime();this._fingers>1&&(this._lastTouchStart=0),i-this._lastTouchStart<300?(_n(n),this._handleDoubleTap(n),wn(this._interaction)?this._handleZoomEnd():Ye(this._interaction)&&this._handleDragEnd()):this._isDoubleTap=!1,this._fingers===1&&(this._lastTouchStart=i)},e.prototype.simulate=function(n){var i=this;return function(r){var a=r.pageX,s=r.pageY,c=r.type,l=c==="mouseup",d=c==="mousedown";d&&(r.preventDefault(),i._listenMouseMove=!0),i._listenMouseMove&&(r.touches=l?[]:[{pageX:a,pageY:s}],n(r)),l&&(i._listenMouseMove=!1)}},e.prototype.componentDidMount=function(){this._bindEvents(),this._update()},e.prototype.componentWillUnmount=function(){this._stopAnimation(),this._unSubscribe()},e.prototype.render=function(){var n=this.props,i=n.children,r=n.containerProps,a=nc.only(i),s=r||{};return Un.createElement(Un.Fragment,null,Un.createElement("style",null,Km),Un.createElement("div",Bt({},s,{ref:this._containerRef,className:Kr(ea,s.className)}),ls(a,{className:Kr(na,a.props.className)})))},e.defaultProps={animationDuration:250,draggableUnZoomed:!0,enforceBoundsDuringZoom:!1,centerContained:!1,enabled:!0,inertia:!0,inertiaFriction:.96,horizontalPadding:0,isTouch:Um,lockDragAxis:!1,maxZoom:5,minZoom:.5,onDoubleTap:Pe,onDragEnd:Pe,onDragStart:Pe,onDragUpdate:Pe,onZoomEnd:Pe,onZoomStart:Pe,onZoomUpdate:Pe,setOffsetsOnce:!1,shouldInterceptWheel:og,shouldCancelHandledTouchEndEvents:!1,tapZoomFactor:1,verticalPadding:0,wheelScaleFactor:1500,zoomOutFactor:1.3,doubleTapZoomOutOnMaxScale:!1,doubleTapToggleZoom:!1,_document:oa?null:window.document},e}(ds);if(0)var Xv,Qv,Jv,ty,ey,ny,oy;function Jo(t){if(!t)return;let e=Math.floor(t/3600),n=Math.floor(t%3600/60),i=Math.round(t%60);return e===0?`${n}:${i.toString().padStart(2,"0")}`:`${e}:${n.toString().padStart(2,"0")}:${i.toString().padStart(2,"0")}`}const ag=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),cg="ALT",ti=t=>{const{_:e}=Wt(),{alt:n,lang:i,index:r,...a}=t;return!n||!n.trim()?null:o("button",{type:"button",class:"alt-badge clickable",...a,onClick:s=>{s.stopPropagation(),s.preventDefault(),B.showMediaAlt={alt:n,lang:i}},title:e({id:"5gfDMm"}),children:[cg,!!r&&o("sup",{children:r})]})},lg=140,ug=280,ia=Kt(t=>t?.length?t.length>lg||/[\n\r].*[\n\r]/.test(t.trim()):!1);function dg({class:t="",media:e,to:n,lang:i,showOriginal:r,autoAnimate:a,showCaption:s,allowLongerCaption:c,altIndex:l,checkAspectRatio:d=!0,onClick:h}){let{id:u,blurhash:f,description:p,meta:m,previewRemoteUrl:g,previewUrl:v,remoteUrl:T,url:_,type:k}=e;/no\-preview\./i.test(v)&&(v=null);const S=hg(u||f||_),{original:b={},small:A,focus:C}=m||{},w=r?b?.width:A?.width||b?.width,L=r?b?.height:A?.height||b?.height,F=r?_:v||_,M=r?T:g||T,E=A?.width&&A?.height,P=w&&L?w>L?"landscape":"portrait":null,q=f?ji(f):null,R=O();let Q;if(C){const U=(C.x+1)/2*100,X=(1-C.y)/2*100;Q=`${U.toFixed(0)}% ${X.toFixed(0)}%`}const et=O(),dt=Et(({x:U,y:X,scale:j})=>{const{current:tt}=et;if(tt){const At=qm({x:U,y:X,scale:j});j===1?tt.style.removeProperty("transform"):tt.style.setProperty("transform",At),tt.closest(".media-zoom").style.touchAction=j<=1.01?"pan-x":""}},[]),[nt,V]=z(!1),rt={enabled:nt,draggableUnZoomed:!1,inertiaFriction:.9,tapZoomFactor:2,doubleTapToggleZoom:!0,containerProps:{className:"media-zoom",style:{overflow:"visible"}},onUpdate:dt},[G,Mt]=z(!1),Lt=ct(()=>n&&!G?U=>o(He,{to:n,...U}):"div",[n,G]),$t=M?Wr(M):null,gt=k==="unknown"&&$t&&/\.(mp4|m4r|m4v|mov|webm)$/i.test($t.pathname),ae=k==="unknown"&&$t&&/\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test($t.pathname),te=k==="image"||k==="unknown"&&v&&!gt&&!ae,ee=v&&/\.(mp4|m4r|m4v|mov|webm)$/i.test(Wr(v).pathname),H=O(),[bt,Dt]=z(!1);ze(()=>{if(!te||!r||!H.current)return;const{offsetWidth:U,offsetHeight:X}=H.current,j=w<U&&L<X;j&&Dt(j)},[w,L]);const Ct=window.innerHeight*(P==="portrait"?.45:.33),Ft=P==="portrait"?0:160,jt={"--average-color":q&&`rgb(${q.join(",")})`},J=w&&L?{"--width":`${w}px`,"--height":`${L}px`,"--aspectWidth":`${w/L*Math.max(Ft,Ct)}px`,aspectRatio:`${w} / ${L}`,...jt}:{...jt},ot=ia(p);let lt=!!s&&!r&&!!p&&!ot;c&&!lt&&p?.length<=ug&&(lt=!0);const vt=lt?U=>{const{children:X,...j}=U;return o("figure",{...j,children:[X,o("figcaption",{class:"media-caption",lang:i,dir:"auto",onClick:tt=>{tt.preventDefault(),tt.stopPropagation(),B.showMediaAlt={alt:p,lang:i}},children:p})]})}:N,[Vt,_t]=z(void 0),Y=()=>window.matchMedia("(min-width: calc(40em + 350px))").matches?"large":"small",be=Et(U=>{const X=U.target.closest(".status-deck");if(r||Y()==="large"&&X||!document.startViewTransition){h?.(U);return}const j=U.target.closest("[data-view-transition-name]")||U.target.querySelector("[data-view-transition-name]");if(j)if(h)h(U);else if(U.preventDefault(),j.dataset.viewTransitioned){j.style.viewTransitionName=S;try{document.startViewTransition(()=>{j.style.viewTransitionName="",location.hash=`#${n}`})}catch{j.style.viewTransitionName="",location.hash=`#${n}`}}else location.hash=`#${n}`;else h?.(U)},[S,r,h]);if(te)return rt.containerProps.style.display="inherit",ze(()=>{ag&&r&&(async()=>{try{await fetch(F,{mode:"no-cors"}),et.current.src=F}catch{}})()},[F]),o(vt,{children:[o(Lt,{ref:H,class:`media media-image ${t}`,onClick:be,"data-orientation":P,"data-has-alt":!lt||void 0,"data-has-natural-aspect-ratio":Vt||void 0,style:r?{backgroundImage:`url(${v})`,"--bg-image":`url(${v})`,backgroundSize:bt?`${w}px ${L}px`:void 0,...jt}:J,children:r?o(qr,{...rt,children:o("img",{ref:et,src:F,alt:p,width:w,height:L,"data-orientation":P,loading:"eager",decoding:"sync",style:{"view-transition-name":S},onLoad:U=>{const X=U.target,j=X.closest(".media-image");j&&(j.style.backgroundImage=`url(${X.src})`,j.style.removeProperty("--bg-image")),X.closest(".media-zoom").style.display="",V(!0)},onError:U=>{const{src:X}=U.target;X===F&&M&&F!==M&&(U.target.src=M)}})}):o(N,{children:[o("img",{src:F,alt:lt?"":p,width:w,height:L,"data-orientation":P,loading:"lazy","data-view-transition-name":S,style:{objectPosition:Q||"center","--anim-duration":`${Math.min(Math.max(Math.max(w,L)/100,5),120)}s`},onLoad:U=>{U.target.dataset.loaded=!0;const X=U.target.closest(".media");if(!E&&X){const{naturalWidth:j,naturalHeight:tt}=U.target;X.dataset.orientation=j>tt?"landscape":"portrait",X.style.setProperty("--width",`${j}px`),X.style.setProperty("--height",`${tt}px`),X.style.aspectRatio=`${j}/${tt}`}if(d&&X){const{clientWidth:j,clientHeight:tt,naturalWidth:At,naturalHeight:ft}=U.target;if(j&&tt&&At&&ft)if(At<88||ft<88)X.dataset.hasSmallDimension=!0;else{const Xt=ft*j/At;Math.abs(Xt-tt)<5&&_t(!0)}}},onError:U=>{const{src:X}=U.target;X===F&&F!==M?U.target.src=M:Mt(!0)}}),!lt&&o(ti,{alt:p,lang:i,index:l})]})}),G&&o("div",{children:o("a",{href:T,class:"button plain6 small",target:"_blank",children:[o(x,{icon:"external"})," ",o("span",{children:o(I,{id:"9npOH9"})})]})})]});if(k==="gifv"||k==="video"||gt){const U=b.duration>0,X=b.duration<31,j=k==="gifv"&&X,tt=b.duration<61,At=Jo(b.duration),ft=!r&&!a&&j,yt=!r&&a&&j,Xt=b.duration>5,ut=`
<video
src="${_}"
poster="${v}"
width="${w}"
height="${L}"
data-orientation="${P}"
style="view-transition-name: ${S}"
preload="auto"
autoplay
muted
playsinline
${tt?"loop":""}
ondblclick="this.paused ? this.play() : this.pause()"
${Xt?"ontimeupdate=\"this.closest('.media-gif') && this.closest('.media-gif').style.setProperty('--progress', `${~~((this.currentTime / this.duration) * 100)}%`)\"":""}
></video>
`,ce=`
<video
src="${_}"
poster="${v}"
width="${w}"
height="${L}"
data-orientation="${P}"
style="view-transition-name: ${S}"
preload="auto"
autoplay
playsinline
${tt?"loop":""}
controls
></video>
`;return o(vt,{children:o(Lt,{ref:H,class:`media ${t} media-${j?"gif":"video"} ${yt?"media-contain":""} ${ft?"media-hover-animate":""}`,"data-orientation":P,"data-formatted-duration":r?void 0:At,"data-label":j&&!r&&!yt?"GIF":void 0,"data-has-alt":!lt||void 0,style:!r&&J,onClick:xt=>{if(ft)try{R.current.pause()}catch{}be(xt)},onMouseEnter:()=>{if(ft)try{R.current.play()}catch{}},onMouseLeave:()=>{if(ft)try{R.current.pause()}catch{}},onFocus:()=>{if(ft)try{R.current.play()}catch{}},onBlur:()=>{if(ft)try{R.current.pause()}catch{}},children:[r||yt?j&&r?o(qr,{...rt,enabled:!0,children:o("div",{ref:et,dangerouslySetInnerHTML:{__html:ut}})}):j?o("div",{class:"video-container",dangerouslySetInnerHTML:{__html:ut}}):o("div",{class:"video-container",dangerouslySetInnerHTML:{__html:ce}}):j?o("video",{ref:R,src:_,poster:v,width:w,height:L,"data-orientation":P,"data-view-transition-name":S,preload:"auto",playsinline:!0,loop:!0,muted:!0,onTimeUpdate:Xt?xt=>{const{target:zt}=xt,Tt=zt?.closest(".media-gif");if(Tt){const Rt=zt.currentTime/zt.duration*100;Tt.style.setProperty("--progress",`${Rt}%`)}}:void 0}):o(N,{children:[v&&!ee?o("img",{src:v,alt:lt?"":p,width:w,height:L,"data-orientation":P,loading:"lazy",decoding:"async","data-view-transition-name":S,onLoad:xt=>{if(!E){const zt=xt.target.closest(".media");if(zt){const{naturalHeight:Tt,naturalWidth:Rt}=xt.target;zt.dataset.orientation=Rt>Tt?"landscape":"portrait",zt.style.setProperty("--width",`${Rt}px`),zt.style.setProperty("--height",`${Tt}px`),zt.style.aspectRatio=`${Rt}/${Tt}`}}}}):o("video",{src:_+"#t=0.1",width:w,height:L,"data-orientation":P,"data-view-transition-name":S,preload:"metadata",muted:!0,disablePictureInPicture:!0,onLoadedMetadata:xt=>{if(!U){const{duration:zt}=xt.target;if(zt){const Tt=Jo(zt),Rt=xt.target.closest(".media-video");Rt&&(Rt.dataset.formattedDuration=Tt)}}}}),o("div",{class:"media-play",children:o(x,{icon:"play",size:"xl",alt:"▶"})})]}),!r&&!lt&&o(ti,{alt:p,lang:i,index:l})]})})}else if(k==="audio"||ae){const U=Jo(b.duration);return o(vt,{children:o(Lt,{class:`media media-audio ${t}`,"data-formatted-duration":r?void 0:U,"data-has-alt":!lt||void 0,onClick:h,style:!r&&J,children:[r?o("audio",{src:T||_,preload:"none",controls:!0,autoPlay:!0}):v?o("img",{src:v,alt:lt?"":p,width:w,height:L,"data-orientation":P,loading:"lazy",onError:X=>{try{X.target?.remove?.()}catch{}}}):null,!r&&o(N,{children:[o("div",{class:"media-play",children:o(x,{icon:"play",size:"xl",alt:"▶"})}),!lt&&o(ti,{alt:p,lang:i,index:l})]})]})})}}function Wr(t){return URL.parse(t,location.origin)}function hg(t){let e=t.replace(/[^a-zA-Z0-9_-]/g,"-");return e.match(/^[0-9-]/)&&(e="vt-"+e),e}const Ti=Ke(dg,(t,e)=>{const n=t.media||{},i=e.media||{};return n?.id===i?.id&&n.url===i.url&&t.to===e.to&&t.class===e.class});function fg(t){const{mediaAttachments:e,language:n,postID:i,instance:r}=t,a=e.length>1,s=O(),[c,l]=z(0);return W(()=>{let d=()=>{const{clientWidth:h,scrollLeft:u}=s.current,f=Math.round(Math.abs(u)/h);l(f)};return s.current&&s.current.addEventListener("scroll",d,{passive:!0}),()=>{s.current&&s.current.removeEventListener("scroll",d)}},[]),o(N,{children:[o("div",{class:"media-first-container",children:[o("div",{class:"media-first-carousel",ref:s,children:e.map((d,h)=>o("div",{class:"media-first-item",children:o(Ti,{media:d,lang:n,to:`/${r}/s/${i}?media=${h+1}`})},d.id))}),a&&o("div",{class:"media-carousel-controls",children:[o("div",{class:"carousel-indexer",children:[c+1,"/",e.length]}),o("label",{class:"media-carousel-button",children:o("button",{type:"button",class:"carousel-button",hidden:c===0,onClick:d=>{d.preventDefault(),d.stopPropagation(),s.current.focus(),s.current.scrollTo({left:s.current.clientWidth*(c-1)*(pi()?-1:1),behavior:"smooth"})},children:o(x,{icon:"arrow-left"})})}),o("label",{class:"media-carousel-button",children:o("button",{type:"button",class:"carousel-button",hidden:c===e.length-1,onClick:d=>{d.preventDefault(),d.stopPropagation(),s.current.focus(),s.current.scrollTo({left:s.current.clientWidth*(c+1)*(pi()?-1:1),behavior:"smooth"})},children:o(x,{icon:"arrow-right"})})})]})]}),a&&o("div",{class:"media-carousel-dots",style:{"--dots-count":e.length},children:e.map((d,h)=>o("span",{class:`carousel-dot ${h===c?"active":""}`},d.id))})]})}function pg(t){const{enabled:e,children:n,lang:i,captionChildren:r}=t;return!e||!r?n:o("figure",{class:"media-figure-multiple",children:[n,o("figcaption",{lang:i,dir:"auto",children:r})]})}function mg({poll:t,lang:e,readOnly:n,refresh:i=()=>{},votePoll:r=()=>{}}){const{_:a}=Wt(),[s,c]=z("default"),{expired:l,expiresAt:d,id:h,multiple:u,options:f,ownVotes:p,voted:m,votersCount:g,votesCount:v=0,emojis:T}=t,_=!!d&&new Date(d),k=u&&g||v;let S=0;k<=1e3?S=0:k<=1e4?S=1:k<=1e5&&(S=2);const[b,A]=z(!1),C=f.every(w=>w.votesCount!==null);return o("div",{lang:e,dir:"auto",class:`poll ${n?"read-only":""} ${s==="loading"?"loading":""}`,children:[b&&C||m||l?o(N,{children:[o("div",{class:"poll-options",children:f.map((w,L)=>{const{title:F,votesCount:M}=w,E=k?M/k:0,D=E?E.toLocaleString(Pt.locale||void 0,{style:"percent",maximumFractionDigits:S}):"0%",P=M>0&&M===Math.max(...f.map(q=>q.votesCount));return o("div",{class:`poll-option poll-result ${P?"poll-option-leading":""}`,style:{"--percentage":`${E*100}%`},children:[o("div",{class:"poll-option-title",children:[o("span",{children:o(on,{text:F,emojis:T})}),m&&p.includes(L)&&o(N,{children:[" ",o(x,{icon:"check-circle",alt:a({id:"IeO7us"})})]})]}),o("div",{class:"poll-option-votes",title:Pt._({id:"+syLpm",values:{optionVotesCount:M}}),children:D})]},`${L}-${F}-${M}`)})}),!l&&!m&&o("button",{class:"poll-vote-button plain2",disabled:s==="loading",onClick:w=>{w.preventDefault(),A(!1)},children:[o(x,{icon:"arrow-left",size:"s"})," ",o(I,{id:"L96xSt"})]})]}):o("form",{onSubmit:async w=>{w.preventDefault();const L=w.target,F=new FormData(L),M=[];F.forEach((E,D)=>{D==="poll"&&M.push(E)}),M.length&&(c("loading"),await r(M),c("default"))},children:[o("div",{class:"poll-options",children:f.map((w,L)=>{const{title:F}=w;return o("div",{class:"poll-option",children:o("label",{class:"poll-label",children:[o("input",{type:u?"checkbox":"radio",name:"poll",value:L,disabled:s==="loading",readOnly:n}),o("span",{class:"poll-option-title",children:o(on,{text:F,emojis:T})})]})})})}),!n&&o("button",{class:"poll-vote-button",type:"submit",disabled:s==="loading",children:o(I,{id:"lQXQKs"})})]}),o("p",{class:"poll-meta",children:[!l&&!n&&o("button",{type:"button",class:"plain small",disabled:s==="loading",onClick:w=>{w.preventDefault(),c("loading"),(async()=>(await i(),c("default")))()},title:a({id:"lCF0wC"}),children:o(x,{icon:"refresh",alt:a({id:"lCF0wC"})})}),!m&&!l&&!n&&C&&o("button",{type:"button",class:"plain small",disabled:s==="loading",onClick:w=>{w.preventDefault(),A(!b)},title:a(b?{id:"L96xSt"}:{id:"zCjei3"}),children:[o(x,{icon:b?"eye-open":"eye-close",alt:a(b?{id:"L96xSt"}:{id:"zCjei3"})})," "]}),!l&&!n&&" ",o(I,{id:"k7v0Rh",values:{0:ie(v),1:ie(v),votesCount:v},components:{0:o("span",{title:v}),1:o("span",{title:v})}}),!!g&&g!==v&&o(N,{children:[" ","•"," ",o(I,{id:"jf1i1L",values:{0:ie(g),1:ie(g),votersCount:g},components:{0:o("span",{title:g}),1:o("span",{title:g})}})]})," ","•"," ",l?_?o(I,{id:"5LwCCI",components:{0:o(me,{datetime:_})}}):a({id:"237hSL"}):_?o(I,{id:"ooHDPY",components:{0:o(me,{datetime:_})}}):a({id:"O2tNG0"})]})]})}const gg=/^http/i,Vr=({post:t,instance:e,previewMode:n})=>{const{content:i,emojis:r,language:a,mentions:s,url:c}=t,l=sn(B),d=re(t.id,e),h=l.statusQuotes[d],u=O();return ze(()=>{if(!u.current)return;const f=Ks(i,{emojis:r,returnDOM:!0});for(const p of f.querySelectorAll('a.u-url[target="_blank"]'))gg.test(p.innerText.trim())||p.removeAttribute("target");u.current.replaceChildren(f.cloneNode(!0))},[i,r?.length]),W(()=>{if(h?.length)for(const f of u.current.querySelectorAll("a"))h.some(p=>p?.originalURL===f.href)&&f.classList.add("is-quote")},[h?.length]),o("div",{ref:u,lang:a,dir:"auto",class:"inner-content",onClick:Bp({mentions:s,instance:e,previewMode:n,statusURL:c})})};var ei,Zr;function vg(){return Zr||(Zr=1,ei=(e,n={})=>{const i=n.char||" ",r=n.count||2;let a=0;const s=[];return e.reverse().reduce((c,l)=>{s.length&&a&&s[a]&&s[a]===l.substring(1,s[a].length+1)&&(s.splice(a,1),a--);const h=[`${i.repeat(a?a*r:0)}${l}`,...c];return l.substring(0,2)==="</"&&(a++,s[a]=l.substring(2,l.length-1)),h},[]).join(`
`)}),ei}var ni,Gr;function yg(){if(Gr)return ni;Gr=1;const t=n=>n.trim().replace(/(^(\s|\t)+|(( |\t)+)$)/gm,"");return ni={mergeAttributesWithElements:n=>{const i=t(n).split(`
`),r=[];let a="";for(let s=0;s<i.length;s+=1){const c=i[s];if(c.endsWith("/>")){r.push(`${a}${c.slice(0,-2)} />`),a="";continue}if(c.endsWith(">")){r.push(`${a}${c.startsWith(">")||c.startsWith("<")?"":" "}${c}`),a="";continue}a+=a.length?` ${c}`:c}return r},removeEmptyLines:t},ni}var oi,Yr;function bg(){if(Yr)return oi;Yr=1;const t=vg(),{mergeAttributesWithElements:e}=yg();return oi=(i,r={})=>{const a=e(i);return t(a,r)},oi}var wg=bg();const _g=cs(wg);function ra(t,e,n=0){const{account:{url:i,displayName:r,acct:a,username:s,emojis:c,bot:l,group:d},id:h,poll:u,spoilerText:f,language:p,editedAt:m,createdAt:g,content:v,mediaAttachments:T,url:_,emojis:k}=t,S=re(h,e),A=(B.statusQuotes[S]||[]).filter((M,E,D)=>D.findIndex(P=>P.url===M.url)===E),C=A.length&&n<=2?A.map(M=>{const{id:E,instance:D}=M,P=re(E,D),q=B.statuses[P];if(q)return ra(q,D,++n)}).join(""):"",w=new Date(g),L=yi(v,k)+`
`+C+`
`+(u?.options?.length?`
<p>📊:</p>
<ul>
${u.options.map(M=>`
<li>
${M.title}
${M.votesCount>=0?` (${M.votesCount})`:""}
</li>
`).join("")}
</ul>`:"")+(T.length>0?`
`+T.map(M=>{const{description:E,meta:D,previewRemoteUrl:P,previewUrl:q,remoteUrl:R,url:Q,type:et}=M,{original:dt={},small:nt}=D||{},V=nt?.width||dt?.width,rt=nt?.height||dt?.height,G=R||Q,Mt=P||q,Lt=Mt||G,$t=G?URL.parse(G):null,gt=et==="unknown"&&$t&&/\.(mp4|m4r|m4v|mov|webm)$/i.test($t.pathname),ae=et==="unknown"&&$t&&/\.(mp3|ogg|wav|m4a|m4p|m4b)$/i.test($t.pathname),te=et==="image"||et==="unknown"&&Mt&&!gt&&!ae,ee=et==="gifv"||et==="video"||gt,H=et==="audio"||ae;let bt="";return te?bt=`<img src="${Lt}" width="${V}" height="${rt}" alt="${E}" loading="lazy" />`:ee?bt=`
<video src="${G}" width="${V}" height="${rt}" controls preload="auto" poster="${Mt}" loading="lazy"></video>
${E?`<figcaption>${E}</figcaption>`:""}
`:H?bt=`
<audio src="${G}" controls preload="auto"></audio>
${E?`<figcaption>${E}</figcaption>`:""}
`:bt=`
<a href="${G}">📄 ${E||G}</a>
`,`<figure>${bt}</figure>`}).join(`
`):""),F=`
<blockquote lang="${p}" cite="${_}" data-source="fediverse">
${f?`
<details>
<summary>${f}</summary>
${L}
</details>
`:L}
<footer>
${yi(r,c)} (@${a}) ${g?`<a href="${_}"><time datetime="${w.toISOString()}">${w.toLocaleString()}</time></a>`:""}
</footer>
</blockquote>
`;return _g(F)}function Tg({post:t,instance:e,onClose:n}){const{_:i}=Wt(),{account:{url:r,displayName:a,username:s,emojis:c,bot:l,group:d},id:h,poll:u,spoilerText:f,language:p,editedAt:m,createdAt:g,content:v,mediaAttachments:T,url:_,emojis:k}=t,S=ra(t,e);return o("div",{id:"embed-post",class:"sheet",children:[!!n&&o("button",{type:"button",class:"sheet-close",onClick:n,children:o(x,{icon:"x",alt:i({id:"yz7wBu"})})}),o("header",{children:o("h2",{children:o(I,{id:"jdVwsS"})})}),o("main",{tabIndex:"-1",children:[o("h3",{children:o(I,{id:"GkS6YG"})}),o("textarea",{class:"embed-code",readonly:!0,onClick:b=>{b.target.select()},dir:"auto",children:S}),o("button",{type:"button",onClick:()=>{try{navigator.clipboard.writeText(S),ht(i({id:"bl7nrg"}))}catch{ht(i({id:"/KEBaP"}))}},children:[o(x,{icon:"clipboard"})," ",o("span",{children:o(I,{id:"he3ygx"})})]}),!!T?.length&&o("section",{children:[o("p",{children:o(I,{id:"/2mUza"})}),o("ol",{class:"links-list",children:T.map(b=>o("li",{children:o("a",{href:b.remoteUrl||b.url,target:"_blank",download:!0,children:b.remoteUrl||b.url})},b.id))})]}),!!c?.length&&o("section",{children:[o("p",{children:o(I,{id:"AeM/di"})}),o("ul",{children:c.map(b=>o("li",{children:[o("picture",{children:[o("source",{srcset:b.staticUrl,media:"(prefers-reduced-motion: reduce)"}),o("img",{class:"shortcode-emoji emoji",src:b.url,alt:`:${b.shortcode}:`,width:"16",height:"16",loading:"lazy",decoding:"async"})]})," ",o("code",{children:[":",b.shortcode,":"]})," (",o("a",{href:b.url,target:"_blank",download:!0,children:"URL"}),")",b.staticUrl?o(N,{children:[" ","(",o("a",{href:b.staticUrl,target:"_blank",download:!0,children:o(I,{id:"xiropL"})}),")"]}):null]},b.shortcode))})]}),!!k?.length&&o("section",{children:[o("p",{children:o(I,{id:"jzjjJh"})}),o("ul",{children:k.map(b=>o("li",{children:[o("picture",{children:[o("source",{srcset:b.staticUrl,media:"(prefers-reduced-motion: reduce)"}),o("img",{class:"shortcode-emoji emoji",src:b.url,alt:`:${b.shortcode}:`,width:"16",height:"16",loading:"lazy",decoding:"async"})]})," ",o("code",{children:[":",b.shortcode,":"]})," (",o("a",{href:b.url,target:"_blank",download:!0,children:"URL"}),")",b.staticUrl?o(N,{children:[" ","(",o("a",{href:b.staticUrl,target:"_blank",download:!0,children:o(I,{id:"xiropL"})}),")"]}):null]},b.shortcode))})]}),o("section",{children:o("small",{children:[o("p",{children:o(I,{id:"TnJgwX"})}),o("ul",{children:[o("li",{children:o(I,{id:"0OHPem"})}),o("li",{children:o(I,{id:"AzZ5zv"})}),o("li",{children:o(I,{id:"NU7wa/"})}),o("li",{children:o(I,{id:"R4PmPA"})})]})]})}),o("h3",{children:o(I,{id:"rdUucN"})}),o("output",{class:"embed-preview",dangerouslySetInnerHTML:{__html:S},dir:"auto"}),o("p",{children:o("small",{children:o(I,{id:"j0kZfi"})})})]})]})}function kg({onClose:t,post:e,currentPolicy:n}){const{_:i}=Wt(),{masto:r}=Be(),[a,s]=z("default"),[c,l]=z(n||"public"),d=async h=>{h.preventDefault();const f=new FormData(h.target).get("quoteApprovalPolicy");l(f),s("loading");try{await r.v1.statuses.$select(e.id).interactionPolicy.update({quote_approval_policy:f}),t(!0),ht(i({id:"3P1r1z"})),s("default")}catch{ht(i({id:"hEe3YR"})),s("error")}};return o("div",{class:"sheet",id:"quote-settings-container",children:[!!t&&o("button",{type:"button",class:"sheet-close",onClick:t,disabled:a==="loading",children:o(x,{icon:"x",alt:i({id:"yz7wBu"})})}),o("header",{children:o("h2",{children:o(I,{id:"UWSCwN"})})}),o("main",{children:[!!e&&o("div",{class:"post-preview",children:o(aa,{status:e,size:"s",readOnly:!0})}),o("form",{onSubmit:d,children:[o("select",{value:c,name:"quoteApprovalPolicy",disabled:a==="loading",children:[o("option",{value:"public",children:o(I,{id:"hDWXuG"})}),o("option",{value:"followers",children:o(I,{id:"9Ko+Xp"})}),o("option",{value:"nobody",children:o(I,{id:"+bAQ3S"})})]})," ",o("button",{disabled:a==="loading",children:o(I,{id:"tfDRzk"})})]})]})]})}const Xr=20;function Sg({statusId:t,instance:e,onClose:n=()=>{}}){const{_:i}=Wt(),{masto:r}=Be(),[a,s]=z([]),[c,l]=z("default"),[d,h]=z(!1),u=O(),f=O(!0),p=(m=!1)=>{(m||!u.current)&&(u.current=r.v1.statuses.$select(t).quotes.list({limit:Xr}).values()),l("loading"),(async()=>{try{let{done:g,value:v}=await u.current.next();Array.isArray(v)?(s(m?v:T=>[...T,...v]),v.length<Xr&&(g=!0),h(!g)):h(!1),l("default")}catch{l("error")}})()};return W(()=>{p(!0),f.current=!1},[t]),o("div",{id:"quotes-modal",class:"sheet",tabindex:"-1",children:[n&&o("button",{type:"button",class:"sheet-close",onClick:n,children:o(x,{icon:"x",alt:i({id:"yz7wBu"})})}),o("header",{children:o("h2",{children:o(I,{id:"eWLklq"})})}),o("main",{children:a.length>0?o(N,{children:[o("ul",{class:"quoted-posts-list",children:a.map(m=>o("li",{class:"quoted-post-item",children:o(He,{to:e?`/${e}/s/${m.id}`:`/s/${m.id}`,class:"status-link",onContextMenu:g=>{const v=g.target.querySelector(".status");if(v){if(g.metaKey)return;g.preventDefault(),v.dispatchEvent(new MouseEvent("contextmenu",{clientX:g.clientX,clientY:g.clientY}))}},children:o(aa,{status:m,instance:e,size:"s",readOnly:!0,showCommentCount:!0})})},m.id))}),c==="default"?d?o("button",{type:"button",class:"plain block",onClick:()=>p(),children:o(I,{id:"uXRAkV"})}):o("p",{class:"ui-state insignificant",children:o(I,{id:"2EYeAZ"})}):c==="loading"&&o("p",{class:"ui-state",children:o(ho,{abrupt:!0})})]}):c==="loading"?o("p",{class:"ui-state",children:o(ho,{abrupt:!0})}):c==="error"?o("p",{class:"ui-state",children:o(I,{id:"3Uoj83"})}):o("p",{class:"ui-state insignificant",children:o(I,{id:"/Xg6f6"})})})]})}const Xe=xe((t,e)=>{let{checked:n,count:i,extraCount:r,class:a,title:s,alt:c,size:l,icon:d,iconSize:h="l",onClick:u,...f}=t;typeof s=="string"&&(s=[s,s]),typeof c=="string"&&(c=[c,c]);const[p,m]=z(s[0]||""),[g,v]=z(c[0]||"");return W(()=>{n?(m(s[1]||""),v(c[1]||"")):(m(s[0]||""),v(c[0]||""))},[n,s,c]),o("button",{ref:e,type:"button",title:p,class:`plain ${l?"small":""} ${a} ${n?"checked":""}`,onClick:T=>{u&&(T.preventDefault(),T.stopPropagation(),u(T))},...f,children:[o(x,{icon:d,size:h,alt:g}),(!!i||!!r)&&o(N,{children:[" ",!!i&&o("small",{title:i,children:ie(i)}),!!i&&!!r&&o("small",{children:"+"}),!!r&&o("small",{title:r,children:ie(r)})]})]})});class Ut extends HTMLElement{constructor(){super(),this.isIframeLoaded=!1,this.setupDom()}static get observedAttributes(){return["videoid","playlistid","videoplay","videotitle"]}connectedCallback(){this.addEventListener("pointerover",()=>Ut.warmConnections(this),{once:!0}),this.addEventListener("click",()=>this.addIframe())}get videoId(){return encodeURIComponent(this.getAttribute("videoid")||"")}set videoId(e){this.setAttribute("videoid",e)}get playlistId(){return encodeURIComponent(this.getAttribute("playlistid")||"")}set playlistId(e){this.setAttribute("playlistid",e)}get videoTitle(){return this.getAttribute("videotitle")||"Video"}set videoTitle(e){this.setAttribute("videotitle",e)}get videoPlay(){return this.getAttribute("videoplay")||"Play"}set videoPlay(e){this.setAttribute("videoplay",e)}get videoStartAt(){return this.getAttribute("videoStartAt")||"0"}get autoLoad(){return this.hasAttribute("autoload")}get autoPause(){return this.hasAttribute("autopause")}get noCookie(){return this.hasAttribute("nocookie")}get posterQuality(){return this.getAttribute("posterquality")||"hqdefault"}get posterLoading(){return this.getAttribute("posterloading")||"lazy"}get params(){return`start=${this.videoStartAt}&${this.getAttribute("params")}`}set params(e){this.setAttribute("params",e)}set posterQuality(e){this.setAttribute("posterquality",e)}get disableNoscript(){return this.hasAttribute("disablenoscript")}setupDom(){const e=this.attachShadow({mode:"open"});let n="";window.liteYouTubeNonce&&(n=`nonce="${window.liteYouTubeNonce}"`),e.innerHTML=`
<style ${n}>
:host {
--aspect-ratio: var(--lite-youtube-aspect-ratio, 16 / 9);
--aspect-ratio-short: var(--lite-youtube-aspect-ratio-short, 9 / 16);
--frame-shadow-visible: var(--lite-youtube-frame-shadow-visible, yes);
contain: content;
display: block;
position: relative;
width: 100%;
aspect-ratio: var(--aspect-ratio);
}
@media (max-width: 40em) {
:host([short]) {
aspect-ratio: var(--aspect-ratio-short);
}
}
#frame, #fallbackPlaceholder, iframe {
position: absolute;
width: 100%;
height: 100%;
left: 0;
top: 0;
}
#frame {
cursor: pointer;
}
#fallbackPlaceholder, slot[name=image]::slotted(*) {
object-fit: cover;
width: 100%;
}
@container style(--frame-shadow-visible: yes) {
#frame::before {
content: '';
display: block;
position: absolute;
top: 0;
background-image: linear-gradient(180deg, #111 -20%, transparent 90%);
height: 60px;
width: 100%;
z-index: 1;
}
}
#playButton {
width: 68px;
height: 48px;
background-color: transparent;
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 68 48"><path d="M66.52 7.74c-.78-2.93-2.49-5.41-5.42-6.19C55.79.13 34 0 34 0S12.21.13 6.9 1.55c-2.93.78-4.63 3.26-5.42 6.19C.06 13.05 0 24 0 24s.06 10.95 1.48 16.26c.78 2.93 2.49 5.41 5.42 6.19C12.21 47.87 34 48 34 48s21.79-.13 27.1-1.55c2.93-.78 4.64-3.26 5.42-6.19C67.94 34.95 68 24 68 24s-.06-10.95-1.48-16.26z" fill="red"/><path d="M45 24 27 14v20" fill="white"/></svg>');
z-index: 1;
border: 0;
border-radius: inherit;
}
#playButton:before {
content: '';
border-style: solid;
border-width: 11px 0 11px 19px;
border-color: transparent transparent transparent #fff;
}
#playButton,
#playButton:before {
position: absolute;
top: 50%;
left: 50%;
transform: translate3d(-50%, -50%, 0);
cursor: inherit;
}
/* Post-click styles */
.activated {
cursor: unset;
}
#frame.activated::before,
#frame.activated > #playButton {
display: none;
}
</style>
<div id="frame">
<picture>
<slot name="image">
<source id="webpPlaceholder" type="image/webp">
<source id="jpegPlaceholder" type="image/jpeg">
<img id="fallbackPlaceholder" referrerpolicy="origin" loading="lazy">
</slot>
</picture>
<button id="playButton" part="playButton"></button>
</div>
`,this.domRefFrame=e.querySelector("#frame"),this.domRefImg={fallback:e.querySelector("#fallbackPlaceholder"),webp:e.querySelector("#webpPlaceholder"),jpeg:e.querySelector("#jpegPlaceholder")},this.domRefPlayButton=e.querySelector("#playButton")}setupComponent(){this.shadowRoot.querySelector("slot[name=image]").assignedNodes().length===0&&this.initImagePlaceholder(),this.domRefPlayButton.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),this.setAttribute("title",`${this.videoPlay}: ${this.videoTitle}`),(this.autoLoad||this.isYouTubeShort()||this.autoPause)&&this.initIntersectionObserver(),this.disableNoscript||this.injectSearchNoScript()}attributeChangedCallback(e,n,i){n!==i&&(this.setupComponent(),this.domRefFrame.classList.contains("activated")&&(this.domRefFrame.classList.remove("activated"),this.shadowRoot.querySelector("iframe").remove(),this.isIframeLoaded=!1))}injectSearchNoScript(){const e=document.createElement("noscript");this.prepend(e),e.innerHTML=this.generateIframe()}generateIframe(e=!1){let n=e?0:1,i=this.autoPause?"&enablejsapi=1":"";const r=this.noCookie?"-nocookie":"";let a;return this.playlistId?a=`?listType=playlist&list=${this.playlistId}&`:a=`${this.videoId}?`,this.isYouTubeShort()&&(this.params=`loop=1&mute=1&modestbranding=1&playsinline=1&rel=0&enablejsapi=1&playlist=${this.videoId}`,n=1),`
<iframe credentialless frameborder="0" title="${this.videoTitle}"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen
src="https://www.youtube${r}.com/embed/${a}autoplay=${n}${i}&${this.params}"
></iframe>`}addIframe(e=!1){if(!this.isIframeLoaded){const n=this.generateIframe(e);this.domRefFrame.insertAdjacentHTML("beforeend",n),this.domRefFrame.classList.add("activated"),this.isIframeLoaded=!0,this.attemptShortAutoPlay(),this.dispatchEvent(new CustomEvent("liteYoutubeIframeLoaded",{detail:{videoId:this.videoId},bubbles:!0,cancelable:!0}))}}initImagePlaceholder(){this.testPosterImage(),this.domRefImg.fallback.setAttribute("aria-label",`${this.videoPlay}: ${this.videoTitle}`),this.domRefImg?.fallback?.setAttribute("alt",`${this.videoPlay}: ${this.videoTitle}`)}async testPosterImage(){setTimeout(()=>{const e=`https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`,n=new Image;n.fetchPriority="low",n.referrerPolicy="origin",n.src=e,n.onload=async i=>{const r=i.target;r?.naturalHeight==90&&r?.naturalWidth==120&&(this.posterQuality="hqdefault");const s=`https://i.ytimg.com/vi_webp/${this.videoId}/${this.posterQuality}.webp`;this.domRefImg.webp.srcset=s;const c=`https://i.ytimg.com/vi/${this.videoId}/${this.posterQuality}.jpg`;this.domRefImg.fallback.loading=this.posterLoading,this.domRefImg.jpeg.srcset=c,this.domRefImg.fallback.src=c,this.domRefImg.fallback.loading=this.posterLoading}},100)}initIntersectionObserver(){const e={root:null,rootMargin:"0px",threshold:0};new IntersectionObserver((i,r)=>{i.forEach(a=>{a.isIntersecting&&!this.isIframeLoaded&&(Ut.warmConnections(this),this.addIframe(!0),r.unobserve(this))})},e).observe(this),this.autoPause&&new IntersectionObserver((r,a)=>{r.forEach(s=>{s.intersectionRatio!==1&&this.shadowRoot.querySelector("iframe")?.contentWindow?.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")})},{threshold:1}).observe(this)}attemptShortAutoPlay(){this.isYouTubeShort()&&setTimeout(()=>{this.shadowRoot.querySelector("iframe")?.contentWindow?.postMessage('{"event":"command","func":"playVideo","args":""}',"*")},2e3)}isYouTubeShort(){return this.getAttribute("short")===""&&window.matchMedia("(max-width: 40em)").matches}static addPrefetch(e,n){const i=document.createElement("link");i.rel=e,i.href=n,i.crossOrigin="true",document.head.append(i)}static warmConnections(e){Ut.isPreconnected||window.liteYouTubeIsPreconnected||(Ut.addPrefetch("preconnect","https://i.ytimg.com/"),Ut.addPrefetch("preconnect","https://s.ytimg.com"),e.noCookie?Ut.addPrefetch("preconnect","https://www.youtube-nocookie.com"):(Ut.addPrefetch("preconnect","https://www.youtube.com"),Ut.addPrefetch("preconnect","https://www.google.com"),Ut.addPrefetch("preconnect","https://googleads.g.doubleclick.net"),Ut.addPrefetch("preconnect","https://static.doubleclick.net")),Ut.isPreconnected=!0,window.liteYouTubeIsPreconnected=!0)}}Ut.isPreconnected=!1;customElements.define("lite-youtube",Ut);function Eg({authors:t,hidden:e,children:n}){if(e||!t?.[0]?.account?.id)return n;const i=t[0].account;return o("div",{class:"card-byline",children:[n,o("div",{class:"card-byline-author",children:[o(x,{icon:"link",size:"s"})," ",o("small",{children:o(I,{id:"4LHHK6",components:{0:o(Ce,{account:i,showAvatar:!0})}})})]})]})}function Qr(t){return["x.com","twitter.com","threads.net","bsky.app","bsky.brid.gy","fed.brid.gy"].includes(t)}function Cg({card:t,selfReferential:e,selfAuthor:n,instance:i}){const r=sn(B),{blurhash:a,title:s,description:c,html:l,providerName:d,providerUrl:h,authorName:u,authorUrl:f,width:p,height:m,image:g,imageDescription:v,url:T,type:_,embedUrl:k,language:S,publishedAt:b,authors:A}=t,C=s||d||u,L=p/m>=1.2?"large":"",[F,M]=z(null);if(W(()=>{C&&g&&!e&&oc(T)&&ic(i,T).then(R=>{if(!R)return;const{id:Q,url:et}=R;M("#"+et)})},[C,g,e]),r.unfurledLinks[T])return null;const E=/<iframe/i.test(l),D=Et(R=>{E&&(R.preventDefault(),B.showEmbedModal={html:l,url:T||k,width:p,height:m})},[E]),[P,q]=z(null);if(C&&(g||_==="photo"&&a)){const R=uo(T),Q=g&&a?ji(a):null;if(!g){const V=Hm(a,44,44),rt=window.OffscreenCanvas?new OffscreenCanvas(1,1):document.createElement("canvas");rt.width=44,rt.height=44;const G=rt.getContext("2d");G.imageSmoothingEnabled=!1;const Mt=G.createImageData(44,44);Mt.data.set(V),G.putImageData(Mt,0,0);try{window.OffscreenCanvas?rt.convertToBlob().then(Lt=>{q(URL.createObjectURL(Lt))}):q(rt.toDataURL())}catch{}}const et=Qr(R);return o(Eg,{hidden:!!n,authors:A,children:o("a",{href:F||T,target:F?null:"_blank",rel:"nofollow noopener",class:`card link ${et?"card-post":""} ${P?"":L}`,style:{"--average-color":Q&&`rgb(${Q.join(",")})`},onClick:D,children:[o("div",{class:"card-image",children:o("img",{src:g||P,width:p,height:m,loading:"lazy",decoding:"async",fetchPriority:"low",alt:v||"",onError:dt=>{try{dt.target.style.display="none"}catch{}},style:{"--anim-duration":p&&m&&`${Math.min(Math.max(Math.max(p,m)/100,5),120)}s`}})}),o("div",{class:"meta-container",lang:S,children:[o("p",{class:"meta domain",children:[o("span",{class:"domain",children:R})," ",!!b&&o(N,{children:"· "}),!!b&&o(N,{children:o(me,{datetime:b,format:"micro"})})]}),o("p",{class:"title",dir:"auto",title:s,children:s}),o("p",{class:"meta",dir:"auto",title:c,children:c||!!b&&o(me,{datetime:b,format:"micro"})})]})]})})}else{if(_==="photo")return o("a",{href:T,target:"_blank",rel:"nofollow noopener",class:"card photo",onClick:D,children:o("img",{src:k,width:p,height:m,alt:s||c,loading:"lazy",style:{height:"auto",aspectRatio:`${p}/${m}`}})});if(_==="video"&&/youtube/i.test(d)){const R=T.match(/watch\?v=([^&]+)/)?.[1];if(R)return o("a",{class:"card video",onClick:D,children:o("lite-youtube",{videoid:R,nocookie:!0,autoPause:!0})})}if(C&&!g){const R=uo(T),Q=Qr(R);return o("a",{href:F||T,target:F?null:"_blank",rel:"nofollow noopener",class:`card link ${Q?"card-post":""} no-image`,lang:S,dir:"auto",onClick:D,children:o("div",{class:"meta-container",children:[o("p",{class:"meta domain",children:[o("span",{class:"domain",children:[o(x,{icon:"link",size:"s"})," ",o("span",{children:R})]})," ",!!b&&o(N,{children:"· "}),!!b&&o(N,{children:o(me,{datetime:b,format:"micro"})})]}),o("p",{class:"title",title:s,children:s}),o("p",{class:"meta",title:c||d||u,children:c||d||u})]})})}}}function Ag({sKey:t}){const n=sn(B).statusReply[t];if(!n)return null;const{id:i,instance:r}=n,a=ps(i,r);if(!a)return null;const{account:{id:s},sensitive:c,spoilerText:l,account:{avatar:d,avatarStatic:h,bot:u}={},visibility:f,content:p,language:m,filtered:g}=a;if(c||l||!p)return null;const v=re(i,r),T=Os(a),_=Pi(),k=_&&_===s,S=It(Ki);let b=!k&&ko(g,S);if(b?.action==="blur"&&(b=null),b?.action==="hide")return null;const A=b?.titlesStr||"";return o("article",{class:`status compact-reply shazam ${f==="direct"?"visibility-direct":""}`,tabindex:"-1","data-state-post-id":v,children:[o(ge,{url:h||d,squircle:u}),o("div",{class:"content-compact",title:T,lang:m,dir:"auto",children:b?o("b",{class:"status-filtered-badge badge-meta",title:A,children:[o("span",{children:o(I,{id:"03Qqf9"})}),o("span",{children:A})]}):o("span",{children:T})})]})}const xg=se(0);function Jr({alt:t}){return o(x,{icon:"thread",size:"s",alt:t})}function ts({index:t,showIcon:e,showText:n}){const{_:i}=Wt(),r=It(xg),a=t>0,s=r>0;return o("div",{class:"status-thread-badge",children:[e&&o(N,{children:[o(Jr,{alt:n?"":i({id:"e66y2Z"})})," "]}),n?a?s?o(I,{id:"A05Pj6",values:{index:t,total:r}}):o(I,{id:"fYeATS",values:{index:t}}):i({id:"e66y2Z"}):a?i(s?{id:"98E0aM",values:{index:t,total:r}}:{id:"NNrlf5",values:{index:t}}):!e&&o(Jr,{alt:i({id:"e66y2Z"})})]})}const Mg={BASE_URL:"./",DEV:!1,MODE:"production",PHANPY_CLIENT_NAME:"Phanpy",PHANPY_LINGVA_INSTANCES:"lingva.phanpy.social lingva.lunar.icu lingva.garudalinux.org translate.plausibility.cloud",PHANPY_PRIVACY_POLICY_URL:"https://github.com/cheeaun/phanpy/blob/main/PRIVACY.MD",PHANPY_TRANSLANG_INSTANCES:"translang.phanpy.social",PHANPY_WEBSITE:"https://phanpy.social",PROD:!0,SSR:!1,VITE_APP_ENV:"production"},Ig=280,Lg=140,Dg=hs({limit:1,interval:1e3});function Pg(t,e){return e.v1.accounts.$select(t).fetch()}const $g=bo(Dg(Pg)),Rg=window.ontouchstart!==void 0&&/iPad|iPhone|iPod/.test(navigator.userAgent),es=80;function Ng(t){return t?.options?.length?`📊:
${t.options.map(e=>`- ${e.title}${e.votesCount>=0?` (${e.votesCount})`:""}`).join(`
`)}`:""}function ii(t,e){const{maskCustomEmojis:n,maskURLs:i,hideInlineQuote:r,htmlTextOpts:a={}}=e||{},{spoilerText:s,poll:c,emojis:l}=t;let{content:d}=t;if(n&&l?.length){const h=new RegExp(`:(${l.map(u=>u.shortcode).join("|")}):`,"g");d=d.replace(h,"⬚")}return(s?`${s}
`:"")+To(d,{...a,preProcess:(i||r)&&(h=>{if(i)for(const u of h.querySelectorAll("a")){const f=u.innerText.trim();/^https?:\/\//i.test(f)&&u.replaceWith("«🔗»")}if(r){const u=h.querySelector(".quote-inline");u&&u.remove()}})})+Ng(c)}function sa(t=[],e=document){for(const n of t)try{return e.querySelectorAll(n)}catch{}return[]}function Og(t,e){if(!t)return!1;if(e?.length){const i=new RegExp(`:(${e.map(r=>r.shortcode).join("|")}):`,"g");t=t.replace(i,"")}return t=t.trim(),t?!!To(t,{preProcess:i=>{for(const r of sa([".mention, pre, code, a:has(.invisible)",".mention, pre, code"],i))r.remove()}}):!1}function Fg(t,e){if(e?.length){const n=new RegExp(`:(${e.map(i=>i.shortcode).join("|")}):`,"g");t=t.replace(n,"")}return To(t,{preProcess:n=>{for(const i of sa([".mention, .hashtag, pre, code, a:has(.invisible)",".mention, .hashtag, pre, code"],n))i.remove();for(const i of n.querySelectorAll("a")){const r=i.innerText.trim();(r.startsWith("https://")||r.startsWith("http://"))&&i.remove()}}})}const zg={s:"small",m:"medium",l:"large"},Bg=bo(async t=>{if(t=t?.trim(),t?.length>500)return null;if(Fe){const r=await Fe.detect(t);console.groupCollapsed("💬 DETECTLANG BROWSER",r.slice(0,3).map(s=>s.detectedLanguage)),console.groupEnd();const a=r[0];if(a?.detectedLanguage&&a?.confidence>.5)return a.detectedLanguage}const{detectAll:e}=await fs(async()=>{const{detectAll:r}=await import("./tinyld.light.node-D9KYf3Y3.js");return{detectAll:r}},[],import.meta.url),n=e(t);console.groupCollapsed("💬 DETECTLANG TINYLD",n.slice(0,3).map(r=>r.lang)),console.groupEnd();const i=n[0];return i?.lang&&i?.accuracy>.5?i.lang:null}),tn={id:"8fZueG"},ki={},Si=(t,e)=>`${t}:${e.join("|")}`,Hg=(t,e=[])=>{if(!t)return!1;const n=Si(t,e),i=Hs(!0),r=t!==i&&!lo([t],[i])&&!e.find(a=>t===a||lo([t],[a]));return r&&(ki[n]=!0),r},Tn={quotePrivate:{id:"0NXzv9"},requestQuote:{id:"awRXyV"},quoteManualReview:{id:"re2mMZ"},quoteFollowersOnly:{id:"NPXprJ"},quoteCannot:{id:"dmiEVR"}},Kg={public:{id:"hDWXuG"},followers:{id:"9Ko+Xp"},nobody:{id:"+bAQ3S"}},{DEV:oo}=Mg;function rn({statusID:t,status:e,instance:n,size:i="m",contentTextWeight:r,readOnly:a,enableCommentHint:s,withinContext:c,skeleton:l,enableTranslate:d,forceTranslate:h,previewMode:u,allowFilters:f,onMediaClick:p,quoted:m,quoteDomain:g,onStatusLinkClick:v=()=>{},showFollowedTags:T,allowContextMenu:_,showActionsBar:k,showReplyParent:S,mediaFirst:b,showCommentCount:A}){const{_:C,_:w,i18n:L}=Wt(),F=Fs(L.locale);if(l)return o("div",{class:`status skeleton ${b?"status-media-first small":""}`,children:[!b&&o(ge,{size:"xxl"}),o("div",{class:"container",children:[o("div",{class:"meta",children:[(i==="s"||b)&&o(ge,{size:"m"})," ███ ████████"]}),o("div",{class:"content-container",children:[b&&o("div",{class:"media-first-container"}),o("div",{class:`content ${b?"media-first-content":""}`,children:o("p",{children:"████ ████████"})})]})]})]});const{masto:M,instance:E,authenticated:D}=Be({instance:n}),{instance:P}=Be(),q=E===P;let R=re(t||e?.id,E);const Q=sn(B);if(e||(e=Q.statuses[R]||Q.statuses[t],R=re(e?.id,E)),!e)return null;const{editHistoryRef:et,editHistoryMode:dt,editedAtIndex:nt}=Cm();if(dt&&e?.editedAt&&et.current.length){const y=et.current[nt];y&&(e={...e,...y})}const{account:{acct:V,avatar:rt,avatarStatic:G,id:Mt,url:Lt,displayName:$t,username:gt,emojis:ae,bot:te,group:ee}={},id:H,repliesCount:bt,reblogged:Dt,reblogsCount:Ct,favourited:Ft,favouritesCount:jt,quotesCount:J,bookmarked:ot,poll:lt,muted:vt,sensitive:Vt,spoilerText:_t,visibility:Y,language:be,editedAt:U,filtered:X,card:j,createdAt:tt,inReplyToId:At,inReplyToAccountId:ft,content:yt,mentions:Xt,mediaAttachments:ut=[],reblog:ce,quote:xt,uri:zt,url:Tt,emojis:Rt,tags:Z,pinned:kt,quoteApproval:Nt,_deleted:Ot,_pinned:wt,emojiReactions:Ie}=e,[ln,So]=z(null);W(()=>{if(!yt||be||ln)return;let y;return y=setTimeout(async()=>{let $=await Bg(Fg(yt,Rt));So($)},1e3),()=>clearTimeout(y)},[yt,be]);const pt=be||ln,un=!!ut?.length;b&&un&&(i="s");const Le=Pi(),ne=Le&&Le===Mt,Eo=It(Ki),Qt=!ne&&(!a&&!u||f)&&ko(X,Eo);if(Qt?.action==="hide")return null;const oe=y=>{y.shiftKey};if((f||i!=="l")&&Qt&&Qt.action!=="blur")return o(Zg,{status:e,filterInfo:Qt,instance:E,containerProps:{onMouseEnter:oe},showFollowedTags:!0,quoted:m});const Zt=new Date(tt),Ue=new Date(U);let we=Xt?.find(y=>y.id===ft);!we&&ft===H&&(we={url:Lt,username:gt,displayName:$t});const[Rn,qi]=z(we);if(!c&&!Rn&&ft){const y=B.accounts[ft];y?qi(y):$g(ft,M).then($=>{qi($),B.accounts[$.id]=$}).catch($=>{})}const Wi=ft&&ft===Le||Xt?.find(y=>y.id===Le),Vi=sc(),_e=!!Vi["reading:expand:spoilers"],Zi=Vi["reading:expand:media"]?.toLowerCase()||"default",le=u||_e||!!Q.spoilers[H],dn=u||Zi==="show_all"&&Qt?.action!=="blur"||!!Q.spoilersMedia[H];if(ce)return ee?o("div",{"data-state-post-id":R,class:"status-group",onMouseEnter:oe,children:[o("div",{class:"status-pre-meta",children:[o(x,{icon:"group",size:"l",alt:w({id:"L8fEEm"})})," ",o(Ce,{account:e.account,instance:E,showAvatar:!0})]}),o(rn,{status:t?null:ce,statusID:t?ce.id:null,instance:E,size:i,contentTextWeight:r,readOnly:a,mediaFirst:b})]}):o("div",{"data-state-post-id":R,class:"status-reblog",onMouseEnter:oe,children:[o("div",{class:"status-pre-meta",children:[o(x,{icon:"rocket",size:"l"})," ",o(I,{id:"DlhB4J",components:{0:o(Ce,{account:e.account,instance:E,showAvatar:!0}),1:o("span",{})}})]}),o(rn,{status:t?null:ce,statusID:t?ce.id:null,instance:E,size:i,contentTextWeight:r,readOnly:a,enableCommentHint:!0,mediaFirst:b})]});const ya=Et(({children:y})=>o("div",{"data-state-post-id":R,class:"status-followed-tags",onMouseEnter:oe,children:[o("div",{class:"status-pre-meta",children:[o(x,{icon:"hashtag",size:"l"})," ",Q.statusFollowedTags[R].slice(0,3).map($=>o(He,{to:E?`/${E}/t/${$}`:`/t/${$}`,class:"status-followed-tag-item",children:$},$))]}),y]}),[R,E,Q.statusFollowedTags[R]]),ba=T&&Q.statusFollowedTags[R]?.length?ya:N,it=i==="l",Te=ct(()=>Mm(yt),[yt]),[Co,wa]=z(h),{contentTranslation:Ao,contentTranslationAutoInline:Gi}=Q.settings;Ao||(d=!1);const Yi=ct(()=>!Ao||!Gi||a||c&&!it||u||_t||Vt||lt||j?!1:Te>0&&Te<=Lg,[Ao,Gi,a,c,it,u,_t,Vt,lt,j,ut,Te]),[xo,Nn]=z(!1),[_a,Mo]=z(!1),[Ta,Io]=z(!1),[ka,Lo]=z(!1),Xi=An(),Do=An(),Sa=An(),qe=O(null),[Ea,Ca]=Li(y=>y+1,0),hn=w({id:"7jyUKe"}),Qi=Et(()=>Math.max(Math.round(((_t?.length||0)+Te)/140)||1,1),[_t,Te]),Ji=tt&&Dn(Zt),tr=U&&Dn(Ue),We=["public","unlisted"].includes(Y);let fn=D&&We;Y==="private"&&ne&&(fn=!0);let Ve=!1,pn=w({id:"ZhhOwV"}),ke;if(Gt()){const y=ne,$=y&&Y==="private",st=Nt?.currentUser==="automatic"&&(We||$),at=Nt?.currentUser==="manual"&&(We||$),Jt=Nt?.automatic?.[0]==="followers"||Nt?.manual?.[0]==="followers";!We&&!y?(Ve=!0,ke=C(Tn.quotePrivate)):st||(at?(pn=C(Tn.requestQuote),ke=C(Tn.quoteManualReview)):(Ve=!0,ke=C(Jt?Tn.quoteFollowersOnly:Tn.quoteCannot)))}const On=Gt()&&!Ve,er=vp(Nt),Fn=y=>{if(!q||!D)return alert(hn);(y?.shiftKey||y?.syntheticEvent?.shiftKey)&&ml({replyToStatus:e})||Ee({replyToStatus:e})},Aa=ct(()=>ut.some(y=>!y.description?.trim?.()),[ut]),nr=ct(()=>Math.floor((new Date-Zt)/(1e3*60*60*24*30)),[Zt]),Po=async()=>{if(!q||!D)return alert(hn),!1;try{if(B.statuses[R]={...e,reblogged:!Dt,reblogsCount:Ct+(Dt?-1:1)},Dt){const y=await M.v1.statuses.$select(H).unreblog();Se(y,E)}else{const y=await M.v1.statuses.$select(H).reblog();Se(y,E)}return!0}catch{return B.statuses[R]=e,!1}},or=async()=>{if(!q||!D)return alert(hn),!1;try{if(B.statuses[R]={...e,favourited:!Ft,favouritesCount:jt+(Ft?-1:1)},Ft){const y=await M.v1.statuses.$select(H).unfavourite();Se(y,E)}else{const y=await M.v1.statuses.$select(H).favourite();Se(y,E)}return!0}catch{return B.statuses[R]=e,!1}},$o=async()=>{try{const y=await or();!it&&y&&ht(w(Ft?{id:"sZvpIt",values:{0:gt||V}}:{id:"yUngDO",values:{0:gt||V}}))}catch{}},ir=async()=>{if(Gn("@mastodon/post-bookmark")){if(!q||!D)return alert(hn),!1;try{if(B.statuses[R]={...e,bookmarked:!ot},ot){const y=await M.v1.statuses.$select(H).unbookmark();Se(y,E)}else{const y=await M.v1.statuses.$select(H).bookmark();Se(y,E)}return!0}catch{return B.statuses[R]=e,!1}}},rr=async()=>{try{const y=await ir();!it&&y&&ht(w(ot?{id:"lWQguj",values:{0:gt||V}}:{id:"Fb2K8h",values:{0:gt||V}}))}catch{}},Ro=Q.settings.contentTranslationHideLanguages||[],[De,sr]=z(ki[Si(pt,Ro)]);W(()=>{if(!pt||De)return;if(!De&&ki[Si(pt,Ro)]){sr(!0);return}let y=setTimeout(()=>{const $=Hg(pt,Ro);$&&sr($)},100);return()=>clearTimeout(y)},[pt,De]);const ar=O(),cr=O();async function xa(y){y&&(ar.current=M.v1.statuses.$select(t).rebloggedBy.list({limit:es}).values(),cr.current=M.v1.statuses.$select(t).favouritedBy.list({limit:es}).values());const[{value:$},{value:st}]=await Promise.allSettled([ar.current.next(),cr.current.next()]);if($.value?.length||st.value?.length){const at=[];return $.value?.length&&at.push(...$.value.map(Jt=>(Jt._types=["reblog"],Jt))),st.value?.length&&at.push(...st.value.map(Jt=>(Jt._types=["favourite"],Jt))),{value:at,done:$.done&&st.done}}return{value:[],done:!0}}const Ma=xt?.state==="accepted"&&xt?.quotedStatus?.account?.id===Le,Ia=O(),La=["public","unlisted","private"].includes(Y),lr=Aa&&!Dt?o("div",{class:"footer",children:[o(x,{icon:"alert"}),o(I,{id:"MB+wJL"})]}):nr>=3&&o("div",{class:"footer",children:[o(x,{icon:"info"}),o("span",{children:o(I,{id:"dBme/4",values:{0:F.format(-nr,"month")},components:{0:o("strong",{})}})})]}),ur=o(N,{children:[!it&&q&&o(N,{children:o("div",{class:"menu-control-group-horizontal status-menu",children:[o(mt,{onClick:Fn,children:[o(x,{icon:"comment"}),o("span",{children:bt>0?ie(bt):w({id:"ImOQa9"})})]}),o(Wn,{subMenu:!0,confirmLabel:o(N,{children:[o(x,{icon:"rocket"}),o("span",{children:w(Dt?{id:"QzzGsY"}:{id:"kulphB"})})]}),className:`menu-reblog ${Dt?"checked":""}`,menuExtras:o(N,{children:[Gt()&&o(mt,{disabled:Ve,onClick:()=>{Ee({quoteStatus:e})},children:[o(x,{icon:"quote"}),ke?o("small",{children:[pn,o("br",{}),ke]}):o("span",{children:pn})]}),(oo||!Gt())&&o(mt,{onClick:()=>{Ee({draftStatus:{status:`
${Tt}`}})},children:[o(x,{icon:"quote"}),o("span",{children:o(I,{id:"ygxzZR"})}),Gt()&&oo&&o("small",{class:"tag collapsed",children:"DEV"})]})]}),menuFooter:lr,disabled:!fn,onClick:async()=>{try{const y=await Po();!it&&y&&ht(w(Dt?{id:"bpDheH",values:{0:gt||V}}:{id:"dbNZdP",values:{0:gt||V}}))}catch{}},children:[On?o("span",{class:"icon",children:[o(x,{icon:"rocket"}),o(x,{icon:"quote"})]}):o(x,{icon:"rocket"}),o("span",{children:Ct>0||J>0?`${Ct>0?ie(Ct):""}${Ct>0&&J>0?"+":""}${J>0?ie(J):""}`:w(Dt?{id:"QzzGsY"}:On?{id:"n1PNla"}:{id:"PiVIlD"})})]}),o(mt,{onClick:$o,className:`menu-favourite ${Ft?"checked":""}`,children:[o(x,{icon:"heart"}),o("span",{children:jt>0?ie(jt):w(Ft?{id:"OcUmcH"}:{id:"W9FRBT"})})]}),Gn("@mastodon/post-bookmark")&&o(mt,{onClick:rr,className:`menu-bookmark ${ot?"checked":""}`,children:[o(x,{icon:"bookmark"}),o("span",{children:w(ot?{id:"q8EQYI"}:{id:"PZlHt8"})})]})]})}),!it&&q&&(it||k)&&o(vn,{}),(it||k)&&o(N,{children:[o(mt,{onClick:()=>{B.showGenericAccounts={heading:w({id:"+XOeb+"}),fetchAccounts:xa,instance:E,showReactions:!0,postID:R}},children:[o(x,{icon:"react"}),o("span",{children:o(I,{id:"+XOeb+"})})]}),Gt()&&o(mt,{onClick:()=>{Lo(!0)},children:[o(x,{icon:"quote"}),o("span",{children:o(I,{id:"5t4KSs"})})]})]}),(it||!b&&(d||!pt||De))&&o(vn,{}),!b&&(d||!pt||De)&&o("div",{class:_i?"menu-horizontal":"",children:[d?o(mt,{disabled:Co,onClick:()=>wa(!0),children:[o(x,{icon:"translate"}),o("span",{children:o(I,{id:"pi8x/S"})})]}):o(xr,{to:`${E?`/${E}`:""}/s/${H}?translate=1`,children:[o(x,{icon:"translate"}),o("span",{children:o(I,{id:"pi8x/S"})})]}),_i&&o(mt,{onClick:()=>{try{const y=ii(e,{hideInlineQuote:Gt()});y&&Im(y,pt)}catch{}},children:[o(x,{icon:"speak"}),o("span",{children:o(I,{id:"yIBLq8"})})]})]}),it&&o(mt,{onClick:()=>{try{const y=ii(e,{hideInlineQuote:Gt(),htmlTextOpts:{truncateLinks:!1}});navigator.clipboard.writeText(y),ht(w({id:"iSRQvy"}))}catch{ht(w({id:"N1MyiN"}))}},children:[o(x,{icon:"clipboard"}),o("span",{children:o(I,{id:"iQgJaz"})})]}),(!it&&q||d||!pt||De)&&o(vn,{}),!it&&o(N,{children:o(xr,{to:E?`/${E}/s/${H}`:`/s/${H}`,onClick:y=>{v(y,e)},children:[o(x,{icon:"arrows-right"}),o("small",{children:[o(I,{id:"8MkSAW",values:{0:gt||V},components:{0:o("span",{class:"bidi-isolate"})}}),o("br",{}),o("span",{class:"more-insignificant",children:[C(Oe[Y])," • ",Ji]})]})]})}),!!U&&o(N,{children:o(mt,{onClick:()=>{Nn(H)},children:[o(x,{icon:"history"}),o("small",{children:[o(I,{id:"QL+7Jw"}),o("br",{}),o("span",{class:"more-insignificant",children:o(I,{id:"DuJJm9",values:{editedDateText:tr}})})]})]})}),o(mt,{href:Tt,target:"_blank",children:[o(x,{icon:"external"}),o("small",{class:"menu-double-lines should-cloak",style:{maxWidth:"16em"},children:jg(Tt)})]}),o("div",{class:"menu-horizontal",children:[o(mt,{onClick:()=>{try{navigator.clipboard.writeText(Tt),ht(w({id:"edWbV6"}))}catch{ht(w({id:"W1ewR0"}))}},children:[o(x,{icon:"link"}),o("span",{children:o(I,{id:"he3ygx"})})]}),We&&navigator?.share&&navigator?.canShare?.({url:Tt})&&o(mt,{onClick:()=>{try{navigator.share({url:Tt})}catch{alert(w({id:"TtG3Uh"}))}},children:[o(x,{icon:"share"}),o("span",{children:o(I,{id:"LFKLqp"})})]})]}),We&&it&&o(mt,{onClick:()=>{Mo(!0)},children:[o(x,{icon:"code"}),o("span",{children:o(I,{id:"jdVwsS"})})]}),D&&o(N,{children:[(ne||Wi)&&o(vn,{}),(ne||Wi)&&o(mt,{onClick:async()=>{try{const y=await M.v1.statuses.$select(H)[vt?"unmute":"mute"]();Se(y,E),ht(w(vt?{id:"Pm+5jw"}:{id:"ywB7JM"}))}catch{ht(w(vt?{id:"c6jxNY"}:{id:"8SN9kN"}))}},children:vt?o(N,{children:[o(x,{icon:"unmute"}),o("span",{children:o(I,{id:"i51zUR"})})]}):o(N,{children:[o(x,{icon:"mute"}),o("span",{children:o(I,{id:"OiUYO5"})})]})}),ne&&La&&o(mt,{onClick:async()=>{try{const y=await M.v1.statuses.$select(H)[kt?"unpin":"pin"]();Se(y,E),ht(w(kt?{id:"Yx809+"}:{id:"S6P6E+"}))}catch{ht(w(kt?{id:"A6cs15"}:{id:"vgUfWO"}))}},children:kt?o(N,{children:[o(x,{icon:"unpin"}),o("span",{children:o(I,{id:"XQMQZw"})})]}):o(N,{children:[o(x,{icon:"pin"}),o("span",{children:o(I,{id:"lfHLsx"})})]})}),ne&&o(N,{children:[Gt()&&!["private","direct"].includes(Y)&&o(mt,{onClick:()=>Io(!0),children:[o(x,{icon:"quote2"}),o("small",{children:[o(I,{id:"eKInue"}),o("br",{}),o("span",{class:"more-insignificant",children:C(Kg[er])})]})]}),o("div",{class:"menu-horizontal",children:[Gn("@mastodon/post-edit")&&o(mt,{onClick:()=>{Ee({editStatus:e,quoteStatus:e.quote?.quotedStatus})},children:[o(x,{icon:"pencil"}),o("span",{children:o(I,{id:"ePK91l"})})]}),it&&o(Wn,{subMenu:!0,confirmLabel:o(N,{children:[o(x,{icon:"trash"}),o("span",{children:o(I,{id:"FbPNuJ"})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{(async()=>{try{await M.v1.statuses.$select(H).remove();const y=ps(H,E);y._deleted=!0,ht(w({id:"KiyvHV"}))}catch{ht(w({id:"Yb6p2q"}))}})()},children:[o(x,{icon:"trash"}),o("span",{children:o(I,{id:"Jb6/SB"})})]})]})]}),!ne&&it&&o(N,{children:[o(vn,{}),Ma&&o(Wn,{subMenu:!0,confirmLabel:o(N,{children:[o(x,{icon:"quote"}),o("span",{children:o(I,{id:"FMGfUd",values:{0:gt||V},components:{0:o("span",{class:"bidi-isolate"})}})})]}),itemProps:{className:"danger"},menuItemClassName:"danger",onClick:()=>{(async()=>{try{const y=xt.quotedStatus.id;await M.v1.statuses.$select(y).quotes.$select(H).revoke.create(),ht(w({id:"YgM2yU"})),B.reloadStatusPage++}catch{ht(w({id:"VzLGaA"}))}})()},children:[o(x,{icon:"quote"}),o(I,{id:"ukL58r"})]}),o(mt,{className:"danger",onClick:()=>{B.showReportModal={account:e.account,post:e}},children:[o(x,{icon:"flag"}),o("span",{children:o(I,{id:"7PQAMY"})})]})]})]})]}),dr=O(),[zn,mn]=z(!1),[hr,Bn]=z({}),Hn=_||!it&&!u&&!Ot&&!m,Da=Ds(Rg&&Hn?y=>{if(y.pointerType==="mouse")return;const{clientX:$,clientY:st}=y.touches?.[0]||y,at=y.target.closest("a");at&&qe.current.contains(at)&&!at.getAttribute("href").startsWith("#")||(y.preventDefault(),Bn({anchorPoint:{x:$,y:st},direction:"right"}),mn(!0))}:null,{threshold:600,captureEvent:!0,detect:"touch",cancelOnMovement:2}),gn=!a&&!u&&!m,Pa=$e("r, shift+r",Fn,{enabled:gn,useKey:!0,ignoreEventWhen:y=>y.metaKey||y.ctrlKey||y.altKey}),$a=$e("f, l",$o,{enabled:gn,ignoreEventWhen:y=>y.metaKey||y.ctrlKey||y.altKey||y.shiftKey,useKey:!0}),Ra=$e("d",rr,{enabled:gn,useKey:!0,ignoreEventWhen:y=>y.metaKey||y.ctrlKey||y.altKey||y.shiftKey}),Na=$e("shift+b",y=>{y.shiftKey&&(async()=>{try{const $=await Po();!it&&$&&ht(w(Dt?{id:"bpDheH",values:{0:gt||V}}:{id:"dbNZdP",values:{0:gt||V}}))}catch{}})()},{enabled:gn&&fn,useKey:!0,ignoreEventWhen:y=>y.metaKey||y.ctrlKey||y.altKey}),Oa=$e("x",y=>{const $=document.activeElement.closest(".status-link, .status-focus");if($){const st=$.querySelector(".spoiler-button:not(.spoiling)");if(st)y.stopPropagation(),st.click();else{const at=$.querySelector(".spoiler-media-button:not(.spoiling)");at&&(y.stopPropagation(),at.click())}}},{useKey:!0,ignoreEventWhen:y=>y.metaKey||y.ctrlKey||y.altKey||y.shiftKey}),Fa=$e("q",y=>{if(!q||!D)return alert(hn);Gt()?Ve?ht(ke):Ee({quoteStatus:e}):Ee({draftStatus:{status:`
${Tt}`}})},{enabled:gn,useKey:!0,ignoreEventWhen:y=>y.metaKey||y.ctrlKey||y.altKey||y.shiftKey}),Kn=ut.slice(0,it?void 0:4),jn=ut.length>1&&Kn.some(y=>!!y.description&&!ia(y.description)),za=ct(()=>{if(!jn)return null;const y=[];return Kn.forEach(($,st)=>{if(!$.description)return;const at=y.findIndex(Jt=>Jt.media.description===$.description);at===-1?y.push({media:$,indices:[st]}):y[at].indices.push(st)}),y.map(({media:$,indices:st})=>o("div",{"data-caption-index":st.map(at=>at+1).join(" "),onClick:at=>{at.preventDefault(),at.stopPropagation(),B.showMediaAlt={alt:$.description,lang:pt}},title:$.description,children:[o("sup",{children:st.map(at=>at+1).join(" ")})," ",$.description]},$.id))},[jn,Kn,pt]),Ze=ct(()=>!!At&&ft===e.account?.id||!!Q.statusThreadNumber[R],[At,ft,e.account?.id,Q.statusThreadNumber[R]]),Ba=ct(()=>s&&!Ze&&!c&&!At&&Y==="public"&&bt>0,[s,Ze,c,At,bt,Y]),fr=ct(()=>{if(A&&bt>0)return!0;if(j||lt||Vt||_t||ut?.length||Ze||c||At||bt<=0||!/[???︖❓❔⁇⁈⁉¿‽؟]/.test(yt))return!1;if(Te>0&&Te<=Ig)return!0},[A,j,lt,Vt,_t,ut,ce,Ze,c,At,bt,yt,Te]);return o(ba,{children:[S&&!!(At&&ft)&&o(Ag,{sKey:R}),o("article",{"data-state-post-id":R,ref:y=>{qe.current=y;const $=y?.closest?.(".timeline-item, .timeline-item-alt, .status-link, .status-focus")||y;Pa.current=$,$a.current=$,Ra.current=$,Na.current=$,Oa.current=$,Fa.current=$},tabindex:"-1",class:`status ${!c&&At&&Rn?"status-reply-to":""} visibility-${Y} ${wt?"status-pinned":""} ${zg[i]} ${Ot?"status-deleted":""} ${m?"status-card":""} ${zn?"status-menu-open":""} ${b&&un?"status-media-first":""}`,onMouseEnter:oe,onContextMenu:y=>{if(!Hn||y.metaKey)return;const $=y.target.closest("a");if($&&qe.current.contains($)&&!$.getAttribute("href").startsWith("#"))return;const st=window.getSelection?.();if(st.toString().length>0){const{anchorNode:at}=st;if(qe.current?.contains(at))return}y.preventDefault(),Bn({anchorPoint:{x:y.clientX,y:y.clientY},direction:"right"}),mn(!0)},...Hn?Da():{},children:[Hn&&o(Ss,{ref:dr,state:zn?"open":void 0,...hr,onClose:y=>{mn(!1),y?.reason==="click"&&qe.current?.closest("[tabindex]")?.focus?.()},portal:{target:document.body},containerProps:{style:{zIndex:1001},onClick:()=>{dr.current?.closeMenu?.()}},overflow:"auto",boundingBoxPadding:Ns(),unmountOnClose:!0,children:ur}),k&&i!=="l"&&!u&&!a&&!Ot&&!m&&o("div",{class:`status-actions ${zn==="actions-bar"?"open":""}`,ref:Ia,children:[o(Xe,{size:"s",title:w({id:"ImOQa9"}),alt:w({id:"ImOQa9"}),class:"reply-button",icon:"comment",iconSize:"m",onClick:Fn}),o(Xe,{size:"s",checked:Ft,title:[w({id:"W9FRBT"}),w({id:"OcUmcH"})],alt:[w({id:"W9FRBT"}),w({id:"8ab1sR"})],class:"favourite-button",icon:"heart",iconSize:"m",count:jt,onClick:$o}),o("button",{type:"button",title:w({id:"2FYpfJ"}),class:"plain more-button",onClick:y=>{y.preventDefault(),y.stopPropagation(),Bn({anchorRef:{current:y.currentTarget},align:"start",direction:"left",gap:0,shift:-8}),mn("actions-bar")},children:o(x,{icon:"more2",size:"m",alt:w({id:"2FYpfJ"})})})]}),i!=="l"&&o("div",{class:"status-badge",children:[Dt&&o(x,{class:"reblog",icon:"rocket",size:"s",alt:w({id:"b7T5Zj"})}),Ft&&o(x,{class:"favourite",icon:"heart",size:"s",alt:w({id:"8ab1sR"})}),ot&&o(x,{class:"bookmark",icon:"bookmark",size:"s",alt:w({id:"1C/9Sa"})}),wt&&o(x,{class:"pin",icon:"pin",size:"s",alt:w({id:"kNiQp6"})})]}),i!=="s"&&o("a",{href:Lt,tabindex:"-1",title:`@${V}`,onClick:y=>{y.preventDefault(),y.stopPropagation(),B.showAccount={account:e.account,instance:E}},children:o(ge,{url:G||rt,size:"xxl",squircle:te})}),o("div",{class:"container",children:[!!g&&o("div",{class:"status-quote-meta",children:o("span",{class:"domain",children:g})}),!!(e.account||tt)&&o("div",{class:"meta",children:[o("span",{class:"meta-name",children:o(Ce,{account:e.account,instance:E,showAvatar:i==="s",showAcct:it})}),c&&Ze&&o(ts,{showIcon:it,index:Q.statusThreadNumber[R]})," ",i!=="l"&&(Ot?o("span",{class:"status-deleted-tag",children:o(I,{id:"vGjmyl"})}):Tt&&!u&&!a&&!m?o(He,{to:E?`/${E}/s/${H}`:`/s/${H}`,onClick:y=>{y.metaKey||y.ctrlKey||y.shiftKey||y.altKey||y.which===2||(y.preventDefault(),y.stopPropagation(),v?.(y,e),Bn({anchorRef:{current:y.currentTarget},align:"end",direction:"bottom",gap:4}),mn(!0))},class:`time ${zn&&hr?.anchorRef?"is-open":""}`,children:[Ba&&!fr?o(x,{icon:"comment2",size:"s",alt:Pt._({id:"RXmXDR",values:{repliesCount:bt}})}):Y!=="public"&&Y!=="direct"&&o(x,{icon:xn[Y],alt:C(Oe[Y]),size:"s"})," ",o(me,{datetime:Zt,format:"micro"}),!u&&!a&&o(x,{icon:"more2",class:"more",alt:w({id:"2FYpfJ"})})]}):o("span",{class:"time",children:[Y!=="public"&&Y!=="direct"&&o(N,{children:[o(x,{icon:xn[Y],alt:C(Oe[Y]),size:"s"})," "]}),o(me,{datetime:Zt,format:"micro"})]}))]}),Y==="direct"&&o(N,{children:[o("div",{class:"status-direct-badge",children:o(I,{id:"IV4QaU"})})," "]}),!c&&o(N,{children:Ze?o(ts,{showIcon:!0,showText:!0,index:Q.statusThreadNumber[R]}):!!At&&!!Rn&&(!!_t||!Xt.find(y=>y.id===ft))&&o("div",{class:"status-reply-badge",children:[o(x,{icon:"reply"})," ",o(Ce,{account:Rn,instance:E,short:!0})]})}),o("div",{class:`content-container ${_t||Vt||Qt?.action==="blur"?"has-spoiler":""} ${le?"show-spoiler":""} ${dn?"show-media":""}`,"data-content-text-weight":r?Qi():null,style:(it||r)&&{"--content-text-weight":Qi()},children:b&&un?o(N,{children:[(!!_t||!!Vt)&&!_e&&o(N,{children:[!!_t&&o("span",{class:"spoiler-content media-first-spoiler-content",lang:pt,dir:"auto",ref:Xi,"data-read-more":C(tn),children:[o(on,{text:_t,emojis:Rt})," "]}),o("button",{class:`light spoiler-button media-first-spoiler-button ${le?"spoiling":""}`,type:"button",onClick:y=>{y.preventDefault(),y.stopPropagation(),le?(delete B.spoilers[H],_e||delete B.spoilersMedia[H]):(B.spoilers[H]=!0,_e||(B.spoilersMedia[H]=!0))},children:[o(x,{icon:le?"eye-open":"eye-close"})," ",w(le?{id:"6lGV3K"}:{id:"lqBX03"})]})]}),o(fg,{mediaAttachments:ut,language:pt,postID:H,instance:E}),!!yt&&o("div",{class:"media-first-content content",ref:Do,children:o(Vr,{post:e,instance:E,previewMode:u})})]}):o(N,{children:[!!_t&&o(N,{children:[o("div",{class:"content spoiler-content",lang:pt,dir:"auto",ref:Xi,"data-read-more":C(tn),children:o("p",{children:o(on,{text:_t,emojis:Rt})})}),_e||u?o("div",{class:"spoiler-divider",children:[o(x,{icon:"eye-open"})," ",o(I,{id:"gnKo7f"})]}):o("button",{class:`light spoiler-button ${le?"spoiling":""}`,type:"button",onClick:y=>{y.preventDefault(),y.stopPropagation(),le?(delete B.spoilers[H],_e||delete B.spoilersMedia[H]):(B.spoilers[H]=!0,_e||(B.spoilersMedia[H]=!0))},children:[o(x,{icon:le?"eye-open":"eye-close"})," ",w(le?{id:"6lGV3K"}:{id:"lqBX03"})]})]}),!!yt&&o("div",{class:"content",ref:Do,"data-read-more":C(tn),inert:_t&&!le?!0:void 0,children:o(Vr,{post:e,instance:E,previewMode:u},Ea)}),!!yt&&o(Fm,{content:yt,contentRef:Do,onRevert:Ca}),!!lt&&o(mg,{lang:pt,poll:lt,readOnly:a||!q||!D,onUpdate:y=>{B.statuses[R].poll=y},refresh:()=>M.v1.polls.$select(lt.id).fetch().then(y=>{B.statuses[R].poll=y}).catch(y=>{}),votePoll:y=>M.v1.polls.$select(lt.id).votes.create({choices:y}).then($=>{B.statuses[R].poll=$}).catch($=>{})}),((d||Yi)&&Og(yt,Rt)&&De||Co)&&o(gm,{forceTranslate:Co||Yi,mini:!it&&!c,sourceLanguage:pt,autoDetected:ln,text:ii(e,{maskCustomEmojis:!0,maskURLs:!0,hideInlineQuote:!0})}),!u&&(Vt||Qt?.action==="blur")&&!!ut.length&&(Zi!=="show_all"||Qt?.action==="blur")&&o("button",{class:`plain spoiler-media-button ${dn?"spoiling":""}`,type:"button",hidden:!_e&&!!_t,onClick:y=>{y.preventDefault(),y.stopPropagation(),dn?delete B.spoilersMedia[H]:B.spoilersMedia[H]=!0},children:[o(x,{icon:dn?"eye-open":"eye-close"})," ",o("span",{children:[Qt?.action==="blur"&&o("small",{children:[o(I,{id:"suKjh3",values:{0:Qt?.titlesStr}}),o("br",{})]}),w(dn?{id:"6lGV3K"}:{id:"9ZCilh"})]})]}),!!ut.length&&(ut.length>1&&(it||c&&i==="m")?o("div",{class:"media-large-container",children:ut.map((y,$)=>o("div",{class:"media-container media-eq1",children:o(Ti,{media:y,autoAnimate:!0,showCaption:!0,allowLongerCaption:!yt||it,lang:pt,to:`/${E}/s/${H}?${c?"media":"media-only"}=${$+1}`,onClick:p?st=>p(st,$,y,e):void 0})},y.id))}):o(pg,{lang:pt,enabled:jn,captionChildren:za,children:o("div",{ref:Sa,class:`media-container media-eq${ut.length} ${ut.length>2?"media-gt2":""} ${ut.length>4?"media-gt4":""}`,children:Kn.map((y,$)=>o(Ti,{media:y,autoAnimate:it,showCaption:ut.length===1,allowLongerCaption:!yt&&ut.length===1,lang:pt,altIndex:jn&&!!y.description&&$+1,to:`/${E}/s/${H}?${c?"media":"media-only"}=${$+1}`,onClick:p?st=>{p(st,$,y,e)}:void 0,checkAspectRatio:ut.length===1},y.id))})})),o(Wg,{id:H,instance:E,level:m,collapsed:!it&&!c}),!!j&&/^https/i.test(j?.url)&&!Vt&&!_t&&!lt&&!ut.length&&!Q.statusQuotes[R]&&o(Cg,{card:j,selfReferential:j?.url===e.url||j?.url===e.uri,selfAuthor:j?.authors?.some(y=>y.account?.url===Lt),instance:P})]})}),!it&&fr&&o("div",{class:"content-comment-hint insignificant",children:[o(x,{icon:"comment2",alt:w({id:"N8UzTV"})})," ",bt]}),it&&o(N,{children:[o("div",{class:"extra-meta",children:Ot?o("span",{class:"status-deleted-tag",children:o(I,{id:"vGjmyl"})}):o(N,{children:[o("span",{children:C(Oe[Y])})," •"," ",o("a",{href:Tt,target:"_blank",rel:"noopener",children:[Date.now()-Zt.getTime()<864e5&&o(N,{children:[o(me,{datetime:Zt,format:"micro"})," ",""," "]}),!!tt&&o("time",{class:"created",datetime:Zt.toISOString(),title:Zt.toLocaleString(),children:Ji})]}),U&&o("span",{class:"edited-container",children:[" ","• ",o(x,{icon:"pencil",alt:w({id:"MRZxAn"})})," ",o("time",{tabIndex:"0",class:"edited",datetime:Ue.toISOString(),onClick:()=>{Nn(H)},children:tr})]})]})}),!!Ie?.length&&o("div",{class:"emoji-reactions",children:Ie.map(y=>{const{name:$,count:st,me:at,url:Jt,staticUrl:Ha}=y;if(Jt)return o("span",{class:`emoji-reaction tag ${at?"":"insignificant"}`,children:[o(mi,{alt:$,url:Jt,staticUrl:Ha})," ",st]});if(/^:.+?:$/.test($)){const No=Rt.find(Ka=>Ka.shortcode===$.replace(/^:/,"").replace(/:$/,""));if(No)return o("span",{class:`emoji-reaction tag ${at?"":"insignificant"}`,children:[o(mi,{alt:$,url:No.url,staticUrl:No.staticUrl})," ",st]})}return o("span",{class:`emoji-reaction tag ${at?"":"insignificant"}`,children:[$," ",st]})})}),o("div",{class:`actions ${Ot?"disabled":""}`,children:[o("div",{class:"action has-count",children:o(Xe,{title:w({id:"ImOQa9"}),alt:w({id:"VbyRUy"}),class:"reply-button",icon:"comment",count:bt,onClick:Fn})}),o("div",{class:`action ${On&&Ct>0&&J>0?"has-counts":"has-count"}`,children:o(Wn,{disabled:!fn,onClick:Po,confirmLabel:o(N,{children:[o(x,{icon:"rocket"}),o("span",{children:w(Dt?{id:"QzzGsY"}:{id:"kulphB"})})]}),menuExtras:o(N,{children:[Gt()&&o(mt,{disabled:Ve,onClick:()=>{Ee({quoteStatus:e})},children:[o(x,{icon:"quote"}),ke?o("small",{children:[pn,o("br",{}),ke]}):o("span",{children:pn})]}),(oo||!Gt())&&o(mt,{onClick:()=>{Ee({draftStatus:{status:`
${Tt}`}})},children:[o(x,{icon:"quote"}),o("span",{children:o(I,{id:"ygxzZR"})}),Gt()&&oo&&o("small",{class:"tag collapsed",children:"DEV"})]})]}),menuFooter:lr,children:o(Xe,{checked:Dt,title:[w(On?{id:"n1PNla"}:{id:"PiVIlD"}),w({id:"QzzGsY"})],alt:[w({id:"kulphB"}),w({id:"b7T5Zj"})],class:"reblog-button",icon:"rocket",count:Ct,extraCount:J,disabled:!fn})})}),o("div",{class:"action has-count",children:o(Xe,{checked:Ft,title:[w({id:"W9FRBT"}),w({id:"OcUmcH"})],alt:[w({id:"W9FRBT"}),w({id:"8ab1sR"})],class:"favourite-button",icon:"heart",count:jt,onClick:or})}),Gn("@mastodon/post-bookmark")&&o("div",{class:"action",children:o(Xe,{checked:ot,title:[w({id:"PZlHt8"}),w({id:"q8EQYI"})],alt:[w({id:"PZlHt8"}),w({id:"1C/9Sa"})],class:"bookmark-button",icon:"bookmark",onClick:ir})}),o(zs,{portal:{target:document.querySelector(".status-deck")||document.body},align:"end",gap:4,overflow:"auto",viewScroll:"close",menuButton:o("div",{class:"action",children:o("button",{type:"button",title:w({id:"2FYpfJ"}),class:"plain more-button",children:o(x,{icon:"more",size:"l",alt:w({id:"2FYpfJ"})})})}),children:[ur," "]})]})]})]}),!!xo&&o(En,{onClick:y=>{y.target===y.currentTarget&&Nn(!1)},children:o(Vg,{statusID:xo,instance:E,fetchStatusHistory:()=>M.v1.statuses.$select(xo).history.list(),onClose:()=>{Nn(!1),qe.current?.focus()}})}),!!_a&&o(En,{onClose:()=>{Mo(!1)},children:o(Tg,{post:e,instance:E,onClose:()=>{Mo(!1)}})}),!!Ta&&o(En,{onClose:()=>{Io(!1),B.reloadStatusPage++},children:o(kg,{onClose:()=>{Io(!1),B.reloadStatusPage++},post:e,currentPolicy:er})}),!!ka&&o(En,{onClose:()=>{Lo(!1)},children:o(Sg,{statusId:H,instance:E,onClose:()=>{Lo(!1)}})})]})]})}function jg(t){if(!t)return;const e=URL.parse(t);if(!e)return;const{host:n,pathname:i}=e,r=i.replace(/\/$/,""),[a,s,c]=r.match(/\/(@[^\/]+)\/(.*)/)||[];return o(N,{children:[ac.toUnicode(n),s?o(N,{children:["/",s,o("wbr",{}),o("span",{class:"more-insignificant",children:["/",c]})]}):o("span",{class:"more-insignificant",children:r})]})}const Ug=["deleted","unauthorized","pending","rejected","revoked"],qg={filterHidden:{id:"XC9Jpz"},pending:{id:"ptPep5"},deleted:{id:"2C0g0G"},unauthorized:{id:"2C0g0G"},rejected:{id:"2C0g0G"},revoked:{id:"5bAOta"}},Wg=Ke(({id:t,instance:e,level:n=0,collapsed:i=!1})=>{if(!t||!e)return;const{_:r}=Wt(),a=sn(B),s=re(t,e);let l=a.statusQuotes[s]?.filter((f,p,m)=>f.native||m.findIndex(g=>g.url===f.url)===p);if(!l?.length||n>2)return;i&&(l=[l[0]]);const d=It(Ki),h=Pi(),u=An();return o("div",{class:"status-card-container",ref:u,"data-read-more":r(tn),children:l.map(f=>{let p;const m=a.statuses[re(f.id,f.instance)];if(m&&(!(h&&h===m.account?.id)&&ko(m.filtered,d))?.action==="hide"&&(p="filterHidden"),p||(p=Ug.find(v=>f.state===v)),p)return o("div",{class:`status-card-unfulfilled ${p==="filterHidden"?"status-card-ghost":""} ${f.native?"quote-post-native":""}`,children:[o(x,{icon:"quote"}),o("i",{children:r(qg[p])})]});const g=f.native?N:qs;return o(g,{id:f.instance+f.id,children:o(He,{to:`${f.instance?`/${f.instance}`:""}/s/${f.id}`,class:`status-card-link ${f.native?"quote-post-native":""}`,"data-read-more":r(tn),children:o(rn,{statusID:f.id,instance:f.instance,size:"s",quoted:n+1,quoteDomain:f.originalDomain,enableCommentHint:!0})},f.instance+f.id)},f.instance+f.id)})})});function Vg({statusID:t,instance:e,fetchStatusHistory:n=()=>{},onClose:i}){const{_:r}=Wt(),[a,s]=z("default"),[c,l]=z([]);return W(()=>{s("loading"),(async()=>{try{const d=await n();l(d),s("default")}catch{s("error")}})()},[]),o("div",{id:"edit-history",class:"sheet",children:[!!i&&o("button",{type:"button",class:"sheet-close",onClick:i,children:o(x,{icon:"x",alt:r({id:"yz7wBu"})})}),o("header",{children:[o("h2",{children:o(I,{id:"OKiofn"})}),a==="error"&&o("p",{children:o(I,{id:"EANWES"})}),a==="loading"&&o("p",{children:[o(ho,{abrupt:!0})," ",o(I,{id:"Pwqkdw"})]})]}),o("main",{tabIndex:"-1",children:c.length>0&&o("ol",{children:c.map(d=>{const{createdAt:h}=d,u=new Date(h);return o("li",{class:"history-item",children:[o("h3",{children:o("time",{children:Dn(u,{formatOpts:{weekday:"short",second:"numeric"}})})}),o(rn,{status:d,instance:e,size:"s",withinContext:!0,readOnly:!0,previewMode:!0})]},h)})})})]})}function Zg({status:t,filterInfo:e,instance:n,containerProps:i={},showFollowedTags:r,quoted:a}){const{_:s,_:c}=Wt(),l=sn(B),{id:d,account:{avatar:h,avatarStatic:u,bot:f,group:p},createdAt:m,visibility:g,reblog:v}=t,T=!!v,_=e?.titlesStr||"",k=new Date(m),S=Os(t.reblog||t),[b,A]=z(!1),C=Ds(()=>{A(!0)},{threshold:600,captureEvent:!0,detect:"touch",cancelOnMovement:2}),w=An(),L=re(t.id,n),F=re(t.id,n)+" "+(re(v?.id,n)||""),M=v?.id||d,E=n?`/${n}/s/${M}`:`/s/${M}`,D=r&&!!l.statusFollowedTags[L]?.length;return o("div",{class:`${a?"":T?p?"status-group":"status-reblog":D?"status-followed-tags":""} visibility-${g}`,...i,onContextMenu:P=>{P.preventDefault(),A(!0)},...C(),children:[o("article",{"data-state-post-id":F,class:`status filtered ${a?"status-card":""}`,tabindex:"-1",children:[o("b",{class:"status-filtered-badge clickable badge-meta",title:_,onClick:P=>{P.preventDefault(),A(!0)},children:[o("span",{children:o(I,{id:"03Qqf9"})}),o("span",{children:_})]})," ",o(ge,{url:u||h,squircle:f}),o("span",{class:"status-filtered-info",children:[o("span",{class:"status-filtered-info-1",children:T?o(I,{id:"zJyf/5",components:{0:o(Ce,{account:t.account,instance:n}),1:o(x,{icon:xn[g],alt:s(Oe[g]),size:"s"})}}):D?o(N,{children:[o(Ce,{account:t.account,instance:n})," ",o(x,{icon:xn[g],alt:s(Oe[g]),size:"s"})," ",o("span",{children:l.statusFollowedTags[L].slice(0,3).map(P=>o("span",{class:"status-followed-tag-item",children:["#",P]},P))})]}):o(N,{children:[o(Ce,{account:t.account,instance:n})," ",o(x,{icon:xn[g],alt:s(Oe[g]),size:"s"})," ",o(me,{datetime:k,format:"micro"})]})}),o("span",{class:"status-filtered-info-2",children:[T&&o(N,{children:[o(ge,{url:v.account.avatarStatic||v.account.avatar,squircle:f})," "]}),S]})]})]}),!!b&&o(En,{onClick:P=>{P.target===P.currentTarget&&A(!1)},children:o("div",{id:"filtered-status-peek",class:"sheet",children:[o("button",{type:"button",class:"sheet-close",onClick:()=>A(!1),children:o(x,{icon:"x",alt:c({id:"yz7wBu"})})}),o("header",{children:[o("b",{class:"status-filtered-badge",children:o(I,{id:"03Qqf9"})})," ",_]}),o("main",{tabIndex:"-1",children:o(He,{ref:w,class:"status-link",to:E,onClick:()=>{A(!1)},"data-read-more":s(tn),children:o(rn,{status:t,instance:n,size:"s",readOnly:!0})})})]})})]})}const aa=Ke(rn,(t,e)=>{const{status:n,...i}=t,{status:r,...a}=e;return n?.id===r?.id&&rc(i,a)});var ns=36,ca="";for(;ns--;)ca+=ns.toString(36);function iy(t){for(var e="",n=t||11;n--;)e+=ca[Math.random()*36|0];return e}function ve(t){return Array.isArray?Array.isArray(t):da(t)==="[object Array]"}const Gg=1/0;function Yg(t){if(typeof t=="string")return t;let e=t+"";return e=="0"&&1/t==-Gg?"-0":e}function Xg(t){return t==null?"":Yg(t)}function de(t){return typeof t=="string"}function la(t){return typeof t=="number"}function Qg(t){return t===!0||t===!1||Jg(t)&&da(t)=="[object Boolean]"}function ua(t){return typeof t=="object"}function Jg(t){return ua(t)&&t!==null}function Yt(t){return t!=null}function ri(t){return!t.trim().length}function da(t){return t==null?t===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(t)}const tv="Incorrect 'index' type",ev=t=>`Invalid value for key ${t}`,nv=t=>`Pattern length exceeds max of ${t}.`,ov=t=>`Missing ${t} property in key`,iv=t=>`Property 'weight' in key '${t}' must be a positive integer`,os=Object.prototype.hasOwnProperty;class rv{constructor(e){this._keys=[],this._keyMap={};let n=0;e.forEach(i=>{let r=ha(i);this._keys.push(r),this._keyMap[r.id]=r,n+=r.weight}),this._keys.forEach(i=>{i.weight/=n})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}}function ha(t){let e=null,n=null,i=null,r=1,a=null;if(de(t)||ve(t))i=t,e=is(t),n=Ei(t);else{if(!os.call(t,"name"))throw new Error(ov("name"));const s=t.name;if(i=s,os.call(t,"weight")&&(r=t.weight,r<=0))throw new Error(iv(s));e=is(s),n=Ei(s),a=t.getFn}return{path:e,id:n,weight:r,src:i,getFn:a}}function is(t){return ve(t)?t:t.split(".")}function Ei(t){return ve(t)?t.join("."):t}function sv(t,e){let n=[],i=!1;const r=(a,s,c)=>{if(Yt(a))if(!s[c])n.push(a);else{let l=s[c];const d=a[l];if(!Yt(d))return;if(c===s.length-1&&(de(d)||la(d)||Qg(d)))n.push(Xg(d));else if(ve(d)){i=!0;for(let h=0,u=d.length;h<u;h+=1)r(d[h],s,c+1)}else s.length&&r(d,s,c+1)}};return r(t,de(e)?e.split("."):e,0),i?n:n[0]}const av={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},cv={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(t,e)=>t.score===e.score?t.idx<e.idx?-1:1:t.score<e.score?-1:1},lv={location:0,threshold:.6,distance:100},uv={useExtendedSearch:!1,getFn:sv,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1};var K={...cv,...av,...lv,...uv};const dv=/[^ ]+/g;function hv(t=1,e=3){const n=new Map,i=Math.pow(10,e);return{get(r){const a=r.match(dv).length;if(n.has(a))return n.get(a);const s=1/Math.pow(a,.5*t),c=parseFloat(Math.round(s*i)/i);return n.set(a,c),c},clear(){n.clear()}}}class Ui{constructor({getFn:e=K.getFn,fieldNormWeight:n=K.fieldNormWeight}={}){this.norm=hv(n,3),this.getFn=e,this.isCreated=!1,this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((n,i)=>{this._keysMap[n.id]=i})}create(){this.isCreated||!this.docs.length||(this.isCreated=!0,de(this.docs[0])?this.docs.forEach((e,n)=>{this._addString(e,n)}):this.docs.forEach((e,n)=>{this._addObject(e,n)}),this.norm.clear())}add(e){const n=this.size();de(e)?this._addString(e,n):this._addObject(e,n)}removeAt(e){this.records.splice(e,1);for(let n=e,i=this.size();n<i;n+=1)this.records[n].i-=1}getValueForItemAtKeyId(e,n){return e[this._keysMap[n]]}size(){return this.records.length}_addString(e,n){if(!Yt(e)||ri(e))return;let i={v:e,i:n,n:this.norm.get(e)};this.records.push(i)}_addObject(e,n){let i={i:n,$:{}};this.keys.forEach((r,a)=>{let s=r.getFn?r.getFn(e):this.getFn(e,r.path);if(Yt(s)){if(ve(s)){let c=[];const l=[{nestedArrIndex:-1,value:s}];for(;l.length;){const{nestedArrIndex:d,value:h}=l.pop();if(Yt(h))if(de(h)&&!ri(h)){let u={v:h,i:d,n:this.norm.get(h)};c.push(u)}else ve(h)&&h.forEach((u,f)=>{l.push({nestedArrIndex:f,value:u})})}i.$[a]=c}else if(de(s)&&!ri(s)){let c={v:s,n:this.norm.get(s)};i.$[a]=c}}}),this.records.push(i)}toJSON(){return{keys:this.keys,records:this.records}}}function fa(t,e,{getFn:n=K.getFn,fieldNormWeight:i=K.fieldNormWeight}={}){const r=new Ui({getFn:n,fieldNormWeight:i});return r.setKeys(t.map(ha)),r.setSources(e),r.create(),r}function fv(t,{getFn:e=K.getFn,fieldNormWeight:n=K.fieldNormWeight}={}){const{keys:i,records:r}=t,a=new Ui({getFn:e,fieldNormWeight:n});return a.setKeys(i),a.setIndexRecords(r),a}function io(t,{errors:e=0,currentLocation:n=0,expectedLocation:i=0,distance:r=K.distance,ignoreLocation:a=K.ignoreLocation}={}){const s=e/t.length;if(a)return s;const c=Math.abs(i-n);return r?s+c/r:c?1:s}function pv(t=[],e=K.minMatchCharLength){let n=[],i=-1,r=-1,a=0;for(let s=t.length;a<s;a+=1){let c=t[a];c&&i===-1?i=a:!c&&i!==-1&&(r=a-1,r-i+1>=e&&n.push([i,r]),i=-1)}return t[a-1]&&a-i>=e&&n.push([i,a-1]),n}const Ne=32;function mv(t,e,n,{location:i=K.location,distance:r=K.distance,threshold:a=K.threshold,findAllMatches:s=K.findAllMatches,minMatchCharLength:c=K.minMatchCharLength,includeMatches:l=K.includeMatches,ignoreLocation:d=K.ignoreLocation}={}){if(e.length>Ne)throw new Error(nv(Ne));const h=e.length,u=t.length,f=Math.max(0,Math.min(i,u));let p=a,m=f;const g=c>1||l,v=g?Array(u):[];let T;for(;(T=t.indexOf(e,m))>-1;){let C=io(e,{currentLocation:T,expectedLocation:f,distance:r,ignoreLocation:d});if(p=Math.min(C,p),m=T+h,g){let w=0;for(;w<h;)v[T+w]=1,w+=1}}m=-1;let _=[],k=1,S=h+u;const b=1<<h-1;for(let C=0;C<h;C+=1){let w=0,L=S;for(;w<L;)io(e,{errors:C,currentLocation:f+L,expectedLocation:f,distance:r,ignoreLocation:d})<=p?w=L:S=L,L=Math.floor((S-w)/2+w);S=L;let F=Math.max(1,f-L+1),M=s?u:Math.min(f+L,u)+h,E=Array(M+2);E[M+1]=(1<<C)-1;for(let P=M;P>=F;P-=1){let q=P-1,R=n[t.charAt(q)];if(g&&(v[q]=+!!R),E[P]=(E[P+1]<<1|1)&R,C&&(E[P]|=(_[P+1]|_[P])<<1|1|_[P+1]),E[P]&b&&(k=io(e,{errors:C,currentLocation:q,expectedLocation:f,distance:r,ignoreLocation:d}),k<=p)){if(p=k,m=q,m<=f)break;F=Math.max(1,2*f-m)}}if(io(e,{errors:C+1,currentLocation:f,expectedLocation:f,distance:r,ignoreLocation:d})>p)break;_=E}const A={isMatch:m>=0,score:Math.max(.001,k)};if(g){const C=pv(v,c);C.length?l&&(A.indices=C):A.isMatch=!1}return A}function gv(t){let e={};for(let n=0,i=t.length;n<i;n+=1){const r=t.charAt(n);e[r]=(e[r]||0)|1<<i-n-1}return e}const vo=String.prototype.normalize?t=>t.normalize("NFD").replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,""):t=>t;class pa{constructor(e,{location:n=K.location,threshold:i=K.threshold,distance:r=K.distance,includeMatches:a=K.includeMatches,findAllMatches:s=K.findAllMatches,minMatchCharLength:c=K.minMatchCharLength,isCaseSensitive:l=K.isCaseSensitive,ignoreDiacritics:d=K.ignoreDiacritics,ignoreLocation:h=K.ignoreLocation}={}){if(this.options={location:n,threshold:i,distance:r,includeMatches:a,findAllMatches:s,minMatchCharLength:c,isCaseSensitive:l,ignoreDiacritics:d,ignoreLocation:h},e=l?e:e.toLowerCase(),e=d?vo(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;const u=(p,m)=>{this.chunks.push({pattern:p,alphabet:gv(p),startIndex:m})},f=this.pattern.length;if(f>Ne){let p=0;const m=f%Ne,g=f-m;for(;p<g;)u(this.pattern.substr(p,Ne),p),p+=Ne;if(m){const v=f-Ne;u(this.pattern.substr(v),v)}}else u(this.pattern,0)}searchIn(e){const{isCaseSensitive:n,ignoreDiacritics:i,includeMatches:r}=this.options;if(e=n?e:e.toLowerCase(),e=i?vo(e):e,this.pattern===e){let g={isMatch:!0,score:0};return r&&(g.indices=[[0,e.length-1]]),g}const{location:a,distance:s,threshold:c,findAllMatches:l,minMatchCharLength:d,ignoreLocation:h}=this.options;let u=[],f=0,p=!1;this.chunks.forEach(({pattern:g,alphabet:v,startIndex:T})=>{const{isMatch:_,score:k,indices:S}=mv(e,g,v,{location:a+T,distance:s,threshold:c,findAllMatches:l,minMatchCharLength:d,includeMatches:r,ignoreLocation:h});_&&(p=!0),f+=k,_&&S&&(u=[...u,...S])});let m={isMatch:p,score:p?f/this.chunks.length:1};return p&&r&&(m.indices=u),m}}class Me{constructor(e){this.pattern=e}static isMultiMatch(e){return rs(e,this.multiRegex)}static isSingleMatch(e){return rs(e,this.singleRegex)}search(){}}function rs(t,e){const n=t.match(e);return n?n[1]:null}class vv extends Me{constructor(e){super(e)}static get type(){return"exact"}static get multiRegex(){return/^="(.*)"$/}static get singleRegex(){return/^=(.*)$/}search(e){const n=e===this.pattern;return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class yv extends Me{constructor(e){super(e)}static get type(){return"inverse-exact"}static get multiRegex(){return/^!"(.*)"$/}static get singleRegex(){return/^!(.*)$/}search(e){const i=e.indexOf(this.pattern)===-1;return{isMatch:i,score:i?0:1,indices:[0,e.length-1]}}}class bv extends Me{constructor(e){super(e)}static get type(){return"prefix-exact"}static get multiRegex(){return/^\^"(.*)"$/}static get singleRegex(){return/^\^(.*)$/}search(e){const n=e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,this.pattern.length-1]}}}class wv extends Me{constructor(e){super(e)}static get type(){return"inverse-prefix-exact"}static get multiRegex(){return/^!\^"(.*)"$/}static get singleRegex(){return/^!\^(.*)$/}search(e){const n=!e.startsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class _v extends Me{constructor(e){super(e)}static get type(){return"suffix-exact"}static get multiRegex(){return/^"(.*)"\$$/}static get singleRegex(){return/^(.*)\$$/}search(e){const n=e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[e.length-this.pattern.length,e.length-1]}}}class Tv extends Me{constructor(e){super(e)}static get type(){return"inverse-suffix-exact"}static get multiRegex(){return/^!"(.*)"\$$/}static get singleRegex(){return/^!(.*)\$$/}search(e){const n=!e.endsWith(this.pattern);return{isMatch:n,score:n?0:1,indices:[0,e.length-1]}}}class ma extends Me{constructor(e,{location:n=K.location,threshold:i=K.threshold,distance:r=K.distance,includeMatches:a=K.includeMatches,findAllMatches:s=K.findAllMatches,minMatchCharLength:c=K.minMatchCharLength,isCaseSensitive:l=K.isCaseSensitive,ignoreDiacritics:d=K.ignoreDiacritics,ignoreLocation:h=K.ignoreLocation}={}){super(e),this._bitapSearch=new pa(e,{location:n,threshold:i,distance:r,includeMatches:a,findAllMatches:s,minMatchCharLength:c,isCaseSensitive:l,ignoreDiacritics:d,ignoreLocation:h})}static get type(){return"fuzzy"}static get multiRegex(){return/^"(.*)"$/}static get singleRegex(){return/^(.*)$/}search(e){return this._bitapSearch.searchIn(e)}}class ga extends Me{constructor(e){super(e)}static get type(){return"include"}static get multiRegex(){return/^'"(.*)"$/}static get singleRegex(){return/^'(.*)$/}search(e){let n=0,i;const r=[],a=this.pattern.length;for(;(i=e.indexOf(this.pattern,n))>-1;)n=i+a,r.push([i,n-1]);const s=!!r.length;return{isMatch:s,score:s?0:1,indices:r}}}const Ci=[vv,ga,bv,wv,Tv,_v,yv,ma],ss=Ci.length,kv=/ +(?=(?:[^\"]*\"[^\"]*\")*[^\"]*$)/,Sv="|";function Ev(t,e={}){return t.split(Sv).map(n=>{let i=n.trim().split(kv).filter(a=>a&&!!a.trim()),r=[];for(let a=0,s=i.length;a<s;a+=1){const c=i[a];let l=!1,d=-1;for(;!l&&++d<ss;){const h=Ci[d];let u=h.isMultiMatch(c);u&&(r.push(new h(u,e)),l=!0)}if(!l)for(d=-1;++d<ss;){const h=Ci[d];let u=h.isSingleMatch(c);if(u){r.push(new h(u,e));break}}}return r})}const Cv=new Set([ma.type,ga.type]);class Av{constructor(e,{isCaseSensitive:n=K.isCaseSensitive,ignoreDiacritics:i=K.ignoreDiacritics,includeMatches:r=K.includeMatches,minMatchCharLength:a=K.minMatchCharLength,ignoreLocation:s=K.ignoreLocation,findAllMatches:c=K.findAllMatches,location:l=K.location,threshold:d=K.threshold,distance:h=K.distance}={}){this.query=null,this.options={isCaseSensitive:n,ignoreDiacritics:i,includeMatches:r,minMatchCharLength:a,findAllMatches:c,ignoreLocation:s,location:l,threshold:d,distance:h},e=n?e:e.toLowerCase(),e=i?vo(e):e,this.pattern=e,this.query=Ev(this.pattern,this.options)}static condition(e,n){return n.useExtendedSearch}searchIn(e){const n=this.query;if(!n)return{isMatch:!1,score:1};const{includeMatches:i,isCaseSensitive:r,ignoreDiacritics:a}=this.options;e=r?e:e.toLowerCase(),e=a?vo(e):e;let s=0,c=[],l=0;for(let d=0,h=n.length;d<h;d+=1){const u=n[d];c.length=0,s=0;for(let f=0,p=u.length;f<p;f+=1){const m=u[f],{isMatch:g,indices:v,score:T}=m.search(e);if(g){if(s+=1,l+=T,i){const _=m.constructor.type;Cv.has(_)?c=[...c,...v]:c.push(v)}}else{l=0,s=0,c.length=0;break}}if(s){let f={isMatch:!0,score:l/s};return i&&(f.indices=c),f}}return{isMatch:!1,score:1}}}const Ai=[];function xv(...t){Ai.push(...t)}function xi(t,e){for(let n=0,i=Ai.length;n<i;n+=1){let r=Ai[n];if(r.condition(t,e))return new r(t,e)}return new pa(t,e)}const yo={AND:"$and",OR:"$or"},Mi={PATH:"$path",PATTERN:"$val"},Ii=t=>!!(t[yo.AND]||t[yo.OR]),Mv=t=>!!t[Mi.PATH],Iv=t=>!ve(t)&&ua(t)&&!Ii(t),as=t=>({[yo.AND]:Object.keys(t).map(e=>({[e]:t[e]}))});function va(t,e,{auto:n=!0}={}){const i=r=>{let a=Object.keys(r);const s=Mv(r);if(!s&&a.length>1&&!Ii(r))return i(as(r));if(Iv(r)){const l=s?r[Mi.PATH]:a[0],d=s?r[Mi.PATTERN]:r[l];if(!de(d))throw new Error(ev(l));const h={keyId:Ei(l),pattern:d};return n&&(h.searcher=xi(d,e)),h}let c={children:[],operator:a[0]};return a.forEach(l=>{const d=r[l];ve(d)&&d.forEach(h=>{c.children.push(i(h))})}),c};return Ii(t)||(t=as(t)),i(t)}function Lv(t,{ignoreFieldNorm:e=K.ignoreFieldNorm}){t.forEach(n=>{let i=1;n.matches.forEach(({key:r,norm:a,score:s})=>{const c=r?r.weight:null;i*=Math.pow(s===0&&c?Number.EPSILON:s,(c||1)*(e?1:a))}),n.score=i})}function Dv(t,e){const n=t.matches;e.matches=[],Yt(n)&&n.forEach(i=>{if(!Yt(i.indices)||!i.indices.length)return;const{indices:r,value:a}=i;let s={indices:r,value:a};i.key&&(s.key=i.key.src),i.idx>-1&&(s.refIndex=i.idx),e.matches.push(s)})}function Pv(t,e){e.score=t.score}function $v(t,e,{includeMatches:n=K.includeMatches,includeScore:i=K.includeScore}={}){const r=[];return n&&r.push(Dv),i&&r.push(Pv),t.map(a=>{const{idx:s}=a,c={item:e[s],refIndex:s};return r.length&&r.forEach(l=>{l(a,c)}),c})}class $n{constructor(e,n={},i){this.options={...K,...n},this.options.useExtendedSearch,this._keyStore=new rv(this.options.keys),this.setCollection(e,i)}setCollection(e,n){if(this._docs=e,n&&!(n instanceof Ui))throw new Error(tv);this._myIndex=n||fa(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight})}add(e){Yt(e)&&(this._docs.push(e),this._myIndex.add(e))}remove(e=()=>!1){const n=[];for(let i=0,r=this._docs.length;i<r;i+=1){const a=this._docs[i];e(a,i)&&(this.removeAt(i),i-=1,r-=1,n.push(a))}return n}removeAt(e){this._docs.splice(e,1),this._myIndex.removeAt(e)}getIndex(){return this._myIndex}search(e,{limit:n=-1}={}){const{includeMatches:i,includeScore:r,shouldSort:a,sortFn:s,ignoreFieldNorm:c}=this.options;let l=de(e)?de(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e);return Lv(l,{ignoreFieldNorm:c}),a&&l.sort(s),la(n)&&n>-1&&(l=l.slice(0,n)),$v(l,this._docs,{includeMatches:i,includeScore:r})}_searchStringList(e){const n=xi(e,this.options),{records:i}=this._myIndex,r=[];return i.forEach(({v:a,i:s,n:c})=>{if(!Yt(a))return;const{isMatch:l,score:d,indices:h}=n.searchIn(a);l&&r.push({item:a,idx:s,matches:[{score:d,value:a,norm:c,indices:h}]})}),r}_searchLogical(e){const n=va(e,this.options),i=(c,l,d)=>{if(!c.children){const{keyId:u,searcher:f}=c,p=this._findMatches({key:this._keyStore.get(u),value:this._myIndex.getValueForItemAtKeyId(l,u),searcher:f});return p&&p.length?[{idx:d,item:l,matches:p}]:[]}const h=[];for(let u=0,f=c.children.length;u<f;u+=1){const p=c.children[u],m=i(p,l,d);if(m.length)h.push(...m);else if(c.operator===yo.AND)return[]}return h},r=this._myIndex.records,a={},s=[];return r.forEach(({$:c,i:l})=>{if(Yt(c)){let d=i(n,c,l);d.length&&(a[l]||(a[l]={idx:l,item:c,matches:[]},s.push(a[l])),d.forEach(({matches:h})=>{a[l].matches.push(...h)}))}}),s}_searchObjectList(e){const n=xi(e,this.options),{keys:i,records:r}=this._myIndex,a=[];return r.forEach(({$:s,i:c})=>{if(!Yt(s))return;let l=[];i.forEach((d,h)=>{l.push(...this._findMatches({key:d,value:s[h],searcher:n}))}),l.length&&a.push({idx:c,item:s,matches:l})}),a}_findMatches({key:e,value:n,searcher:i}){if(!Yt(n))return[];let r=[];if(ve(n))n.forEach(({v:a,i:s,n:c})=>{if(!Yt(a))return;const{isMatch:l,score:d,indices:h}=i.searchIn(a);l&&r.push({score:d,key:e,value:a,idx:s,norm:c,indices:h})});else{const{v:a,n:s}=n,{isMatch:c,score:l,indices:d}=i.searchIn(a);c&&r.push({score:l,key:e,value:a,norm:s,indices:d})}return r}}$n.version="7.1.0";$n.createIndex=fa;$n.parseIndex=fv;$n.config=K;$n.parseQuery=va;xv(Av);const Rv=6*60*1e3,Nv=90*24*60*60*1e3;function ry({scheduledAt:t,setScheduledAt:e}){if(!t||!(t instanceof Date))return;const[n,i]=z(),[r,a]=z(),s=t.getTimezoneOffset();W(()=>{function l(){const u=new Date(Date.now()+Rv),f=new Date(u.getTime()-s*6e4).toISOString().slice(0,16);i(f)}l();function d(){const u=new Date(Date.now()+Nv),f=new Date(u.getTime()-s*6e4).toISOString().slice(0,16);a(f)}d();const h=setInterval(()=>{l(),d()},1e3*10);return()=>clearInterval(h)},[]);const c=t?new Date(t.getTime()-t.getTimezoneOffset()*6e4).toISOString().slice(0,16):null;return o("input",{type:"datetime-local",name:"scheduledAt",defaultValue:c,min:n,max:r,required:!0,onChange:l=>{e(new Date(l.target.value))}})}function sy(){const t=new Date;return new Intl.DateTimeFormat(void 0,{timeZoneName:"long"}).formatToParts(t).find(r=>r.type==="timeZoneName")?.value}export{ts as $,ge as A,ie as B,Ss as C,Zv as D,on as E,aa as F,Vv as G,_i as H,x as I,Im as J,pi as K,He as L,xr as M,Ce as N,ji as O,Ti as P,mi as Q,me as R,Ml as S,gm as T,ko as U,Ds as V,An as W,Dm as X,Ki as Y,Lm as Z,Yv as _,ml as a,iy as a0,Mm as a1,yi as a2,Hv as a3,il as a4,Kv as a5,$n as a6,sy as a7,ry as a8,Cm as a9,hg as aa,Gv as ab,Jp as ac,xg as ad,Cc as ae,Uo as af,Fe as ag,Rm as ah,Ps as ai,Rv as aj,Fs as ak,vp as al,Ll as am,Oe as an,xn as ao,Ee as b,vn as c,mt as d,Os as e,Ns as f,En as g,zs as h,Wn as i,Bs as j,Hs as k,bn as l,Gt as m,Dn as n,vl as o,jv as p,Gn as q,qv as r,ht as s,Uv as t,Bv as u,To as v,$e as w,Wv as x,Ks as y,Bp as z};
//# sourceMappingURL=ScheduledAtField-O5kh-u-d.js.map